]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak sofia
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 2 Oct 2006 17:21:06 +0000 (17:21 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 2 Oct 2006 17:21:06 +0000 (17:21 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2952 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 6b66858f4a551065e6b0d8b30f4ec364a875b54a..88f3fadf38f333fe396be88648fe44ade99f65a7 100644 (file)
@@ -618,7 +618,7 @@ static void set_local_sdp(private_object_t *tech_pvt)
        }
        
        if (tech_pvt->te > 96) {
-               snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d telephone-event/8000\na=fmtp:%d 0-16", tech_pvt->te, tech_pvt->te);
+               snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d telephone-event/8000\na=fmtp:%d 0-16\n", tech_pvt->te, tech_pvt->te);
        }
 
 
@@ -1137,11 +1137,12 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
                set_local_sdp(tech_pvt);
                activate_rtp(tech_pvt);
                if (tech_pvt->nh) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local SDP:\n%s\n", tech_pvt->local_sdp_str);
                        nua_respond(tech_pvt->nh, SIP_200_OK, 
                                                //SIPTAG_CONTACT(tech_pvt->contact),
-                                               SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), TAG_END());
-
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local SDP:\n%s\n", tech_pvt->local_sdp_str);
+                                               SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+                                               SOATAG_AUDIO_AUX("cn telephone-event"),
+                                               TAG_END());
                }
        }
 
@@ -1434,7 +1435,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "183 SDP:\n%s\n", tech_pvt->local_sdp_str);
                        nua_respond(tech_pvt->nh, SIP_183_SESSION_PROGRESS,
                                                //SIPTAG_CONTACT(tech_pvt->contact),
-                                               SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), TAG_END());
+                                               SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+                                               SOATAG_AUDIO_AUX("cn telephone-event"),
+                                               TAG_END());
            }
        }
                break;
@@ -2243,7 +2246,9 @@ static void sip_r_register(int status,
        
        if (!oreg) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No authentication available!\n");
-               nua_handle_destroy(nh); 
+               if (sofia_private->oreg) {
+                       nua_handle_destroy(nh); 
+               }
                return;
        }
        
@@ -2254,10 +2259,10 @@ static void sip_r_register(int status,
        }
 
        if (status == 200) {
-               if (!sofia_private->session) {
+               if (sofia_private->oreg) {
                        oreg->state = REG_STATE_REGISTER;
+                       nua_handle_destroy(nh);
                }
-               nua_handle_destroy(nh);
        } else if (authenticate) {
                char const *realm = (char const *) *authenticate->au_params;
                char const *scheme = (char const *) authenticate->au_scheme;