]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
ken, try this.
authorMichael Jerris <mike@jerris.com>
Wed, 20 Feb 2008 21:31:15 +0000 (21:31 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 20 Feb 2008 21:31:15 +0000 (21:31 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7713 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c

index f54891ca161a85ab6e0d11a8d27eb7b85018350a..afe6a447479c6902b2034eba9a9a6776dcd51856 100644 (file)
@@ -954,7 +954,16 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                                        TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END());
                        } else {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Responding with %d %s\n", code, reason);
-                               nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), TAG_END());
+
+                               if (!switch_strlen_zero(((char *)msg->pointer_arg))) {
+                                       nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
+                                       SOATAG_USER_SDP_STR(msg->pointer_arg),
+                                       SOATAG_AUDIO_AUX("cn telephone-event"),
+                                       NUTAG_INCLUDE_EXTRA_SDP(1),
+                                       TAG_END());
+                               } else {
+                                       nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), TAG_END());
+                               }
                        }
                        
                }
index 87d27a1c2cf70d37f4c824f3b378aa1a9057cb96..110f98796a29a6d494901b65d2d43fcc00d53ebb 100644 (file)
@@ -1327,14 +1327,20 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
                        switch_clear_flag_locked(tech_pvt, TFLAG_SENT_UPDATE);
 
                        if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
+                               const char *r_sdp = NULL;
                                switch_core_session_message_t msg = { 0 };
-                               
+                       
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Passing %d %s to other leg\n", status, phrase);
                                
+                               tl_gets(tags, SOATAG_REMOTE_SDP_STR_REF(r_sdp), TAG_END());
                                msg.message_id = SWITCH_MESSAGE_INDICATE_RESPOND;
                                msg.from = __FILE__;
                                msg.numeric_arg = status;
                                msg.string_arg = switch_core_session_strdup(other_session, phrase);
+                               if (r_sdp) {
+                                       msg.pointer_arg = switch_core_session_strdup(other_session, r_sdp);
+                                       msg.pointer_arg_size = strlen(r_sdp);
+                               }
                                switch_core_session_receive_message(other_session, &msg);
                                switch_core_session_rwunlock(other_session);
                        }