[asterisk-commits] file: branch group/pimp_my_sip r381639 - /team/group/pimp_my_sip/res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Feb 16 15:36:28 CST 2013
Author: file
Date: Sat Feb 16 15:36:24 2013
New Revision: 381639
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381639
Log:
Tweak where answer SDP is set as the dialog can't be locked from two different threads at once.
Modified:
team/group/pimp_my_sip/res/res_sip_session.c
Modified: team/group/pimp_my_sip/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_session.c?view=diff&rev=381639&r1=381638&r2=381639
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_session.c (original)
+++ team/group/pimp_my_sip/res/res_sip_session.c Sat Feb 16 15:36:24 2013
@@ -1234,6 +1234,7 @@
struct on_rx_offer_data {
pjsip_inv_session *inv;
const pjmedia_sdp_session *offer;
+ pjmedia_sdp_session *answer;
};
static int on_rx_offer(void *data)
@@ -1242,15 +1243,13 @@
pjsip_inv_session *inv = orod->inv;
const pjmedia_sdp_session *offer = orod->offer;
struct ast_sip_session *session = inv->mod_data[session_module.id];
- pjmedia_sdp_session *answer;
if (handle_incoming_sdp(session, offer)) {
return -1;
}
- if ((answer = create_local_sdp(inv, session, offer))) {
- pjsip_inv_set_sdp_answer(inv, answer);
- }
+ orod.answer = create_local_sdp(inv, session, offer);
+
return 0;
}
@@ -1260,12 +1259,17 @@
struct on_rx_offer_data orod;
orod.inv = inv;
orod.offer = offer;
+ orod.answer = NULL;
/* PJSIP requires us to have set an SDP answer when this returns, so we have to push this
* task synchronously
*/
if (ast_sip_push_task_synchronous(session->work, on_rx_offer, &orod)) {
ast_log(LOG_WARNING, "Synchronous threadpool task to create SDP answer failed. Using saved local SDP\n");
+ }
+
+ if (orod.answer) {
+ pjsip_inv_set_sdp_answer(inv, answer);
}
}
More information about the asterisk-commits
mailing list