]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9745: [mod_sofia] Call to FS WebRTC Gateway fails when no SDP on invite #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 20 Dec 2016 18:20:41 +0000 (12:20 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 20 Dec 2016 18:20:41 +0000 (12:20 -0600)
src/mod/endpoints/mod_verto/mod_verto.c

index 327f922524201c39169b7a112bfe9ccffc8ef987..aa7678739b28ffda45ba3130833f5a01b36c71c8 100644 (file)
@@ -2669,6 +2669,7 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
 
        if ((session = switch_core_session_locate(call_id))) {
                verto_pvt_t *tech_pvt = switch_core_session_get_private_class(session, SWITCH_PVT_SECONDARY);
+               switch_core_session_t *other_session = NULL;
 
                tech_pvt->r_sdp = switch_core_session_strdup(session, sdp);
                switch_channel_set_variable(tech_pvt->channel, SWITCH_R_SDP_VARIABLE, sdp);             
@@ -2678,6 +2679,12 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
 
                switch_ivr_set_user(session, jsock->uid);
 
+               if (switch_core_session_get_partner(tech_pvt->session, &other_session) == SWITCH_STATUS_SUCCESS) {
+                       switch_channel_t *other_channel = switch_core_session_get_channel(other_session);
+                       switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, sdp);
+                       switch_core_session_rwunlock(other_session);
+               }
+
                if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE)) {
                        pass_sdp(tech_pvt);
                } else {