Page MenuHomePhabricator

pjsip-sip_inv-stop_on_create_offer_processing.patch
No OneTemporary

pjsip-sip_inv-stop_on_create_offer_processing.patch

--- pjsip/include/pjsip-ua/sip_inv.h 2012-05-21 09:44:57.000000000 +0200
+++ pjsip/include/pjsip-ua/sip_inv.h 2012-05-21 14:48:43.000000000 +0200
@@ -192,7 +192,7 @@
* application.
*/
void (*on_create_offer)(pjsip_inv_session *inv,
- pjmedia_sdp_session **p_offer);
+ pjsip_rx_data *rdata);
/**
* This callback is called after SDP offer/answer session has completed.
--- pjsip/src/pjsip-ua/sip_inv.c 2012-05-21 09:44:57.000000000 +0200
+++ pjsip/src/pjsip-ua/sip_inv.c 2012-05-23 10:45:46.000000000 +0200
@@ -3718,58 +3718,33 @@
return;
}
- if (rdata->msg_info.msg->body != NULL && mod_inv.cb.on_rx_reinvite
- && inv->notify) {
+ if (rdata->msg_info.msg->body != NULL && mod_inv.cb.on_rx_reinvite && inv->notify) {
return;
- }
-
-
- /* Create 2xx ANSWER */
- status = pjsip_dlg_create_response(dlg, rdata, 200, NULL, &tdata);
- if (status != PJ_SUCCESS)
- return;
-
- /* If the INVITE request has SDP body, send answer.
- * Otherwise generate offer from local active SDP.
- */
- if (rdata->msg_info.msg->body != NULL) {
- status = process_answer(inv, 200, tdata, NULL);
} else {
/* INVITE does not have SDP.
* If on_create_offer() callback is implemented, ask app.
* to generate an offer, otherwise just send active local
* SDP to signal that nothing gets modified.
*/
- pjmedia_sdp_session *sdp = NULL;
if (mod_inv.cb.on_create_offer) {
- (*mod_inv.cb.on_create_offer)(inv, &sdp);
- if (sdp) {
- /* Notify negotiator about the new offer. This will
- * fix the offer with correct SDP origin.
- */
- status = pjmedia_sdp_neg_modify_local_offer(dlg->pool,
- inv->neg,
- sdp);
-
- /* Retrieve the "fixed" offer from negotiator */
- if (status==PJ_SUCCESS) {
- const pjmedia_sdp_session *lsdp = NULL;
- pjmedia_sdp_neg_get_neg_local(inv->neg, &lsdp);
- sdp = (pjmedia_sdp_session*)lsdp;
- }
- }
- }
-
- if (sdp == NULL) {
- const pjmedia_sdp_session *active_sdp = NULL;
- status = pjmedia_sdp_neg_send_local_offer(dlg->pool,
- inv->neg,
- &active_sdp);
- if (status == PJ_SUCCESS)
- sdp = (pjmedia_sdp_session*) active_sdp;
+ (*mod_inv.cb.on_create_offer)(inv, rdata);
+ /* The application will generate the reply */
+ return;
}
+ status = pjsip_dlg_create_response(dlg, rdata, 200, NULL, &tdata);
+ if (status != PJ_SUCCESS)
+ return;
+
+ pjmedia_sdp_session *sdp = NULL;
+ const pjmedia_sdp_session *active_sdp = NULL;
+ status = pjmedia_sdp_neg_send_local_offer(dlg->pool,
+ inv->neg,
+ &active_sdp);
+ if (status == PJ_SUCCESS)
+ sdp = (pjmedia_sdp_session*) active_sdp;
+
if (sdp) {
tdata->msg->body = create_sdp_body(tdata->pool, sdp);
}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Feb 1, 5:27 AM (22 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3488750
Default Alt Text
pjsip-sip_inv-stop_on_create_offer_processing.patch (3 KB)

Event Timeline