]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix the crash that was caused by fixing the leak that was preventing the crash in...
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 8 Oct 2009 14:55:16 +0000 (14:55 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 8 Oct 2009 14:55:16 +0000 (14:55 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15115 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_core_file.c

index 6c922781a0ba5272c965ad18cdd8e58ca2101d2e..b44a26bccd492874908e74136413951612fb5fe9 100644 (file)
@@ -483,6 +483,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
                                                        SOATAG_REUSE_REJECTED(1),
                                                        SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), 
                                                        TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+                                                       SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
                                                        TAG_END());
 
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "3PCC-PROXY, Sent a 200 OK, waiting for ACK\n");
@@ -571,6 +572,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
                                        SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
                                        SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), 
                                        TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+                                       SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
                                        TAG_END());
                switch_safe_free(extra_headers);
                sofia_set_flag_locked(tech_pvt, TFLAG_ANS);
@@ -1491,6 +1493,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                                SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
                                                SIPTAG_HEADER_STR(generate_pai_str(session)), 
                                                TAG_IF(!switch_strlen_zero(extra_header), SIPTAG_HEADER_STR(extra_header)),
+                                               SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
                                                TAG_END());
                        switch_safe_free(extra_header);
                        switch_channel_mark_ring_ready(channel);
@@ -1576,6 +1579,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                                                SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
                                                                SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), 
                                                                TAG_IF(!switch_strlen_zero(extra_header), SIPTAG_HEADER_STR(extra_header)),
+                                                               SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
                                                                TAG_END());
                                        switch_safe_free(extra_header);
                                }
index ded096607a7308e4a74e0e16bacb591f7e3dfedf..d33ea704ff2e005ed482432ef7a73629986b07b2 100644 (file)
@@ -96,6 +96,7 @@ typedef struct private_object private_object_t;
 #define SOFIA_SECURE_MEDIA_CONFIRMED_VARIABLE "sip_secure_media_confirmed"
 #define SOFIA_HAS_CRYPTO_VARIABLE "sip_has_crypto"
 #define SOFIA_CRYPTO_MANDATORY_VARIABLE "sip_crypto_mandatory"
+#define SOFIA_ACTUALLY_SUPPORT "UPDATE"
 
 #include <sofia-sip/nua.h>
 #include <sofia-sip/sip_status.h>
@@ -580,6 +581,8 @@ struct private_object {
        char *extrtpip;
        char *stun_ip;
        char *route_uri;
+       char *x_actually_supported_remote;
+       char *x_actually_supported_local;
        switch_port_t stun_port;
        uint32_t stun_flags;
        unsigned long rm_rate;
index 58cff55069947200b769a107d91dbdf39606bb46..f5186b14bee8ed1ef04d3a225e6b3fee4d9bffe4 100644 (file)
@@ -5491,6 +5491,8 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
                                }
                        } else if (!strncasecmp(un->un_name, "History-Info", 12)) {
                                switch_channel_set_variable(channel, "sip_history_info", un->un_value);
+                       } else if (!strcasecmp(un->un_name, "X-Actually-Supported")) {
+                               tech_pvt->x_actually_supported_remote = switch_core_session_strdup(session, un->un_value);
                        } else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) {
                                if (!switch_strlen_zero(un->un_value)) {
                                        char new_name[512] = "";
index 36ef42036666e8e10218d6b7079ffb61c5451f7b..becf2e4fef9677919640310a57aa3a8dbe03a6c9 100644 (file)
@@ -1767,6 +1767,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
                           TAG_IF(!switch_strlen_zero(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->privacy)),
                           TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)),
                           TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+                          SIPTAG_HEADER_STR("X-Actually-Support: UPDATE"),
                           TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
                           TAG_IF(!switch_strlen_zero(route_uri), NUTAG_PROXY(route_uri)),
                           TAG_IF(!switch_strlen_zero(route), SIPTAG_ROUTE_STR(route)),
index dac692e44d8bfa55cee9b490e4cf55df3ea19431..da63956bbd03a6d4e6117eaaf96aa89452e17e94 100644 (file)
@@ -104,7 +104,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
 
                if ((ext = strrchr(file_path, '.')) == 0) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown file Format [%s]\n", file_path);
-                       switch_goto_status(SWITCH_STATUS_FALSE, end);
+                       switch_goto_status(SWITCH_STATUS_FALSE, fail);
                }
                ext++;
                fh->file_path = switch_core_strdup(fh->memory_pool, file_path);
@@ -114,7 +114,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
 
        if ((fh->file_interface = switch_loadable_module_get_file_interface(ext)) == 0) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid file format [%s] for [%s]!\n", ext, file_path);
-               switch_goto_status(SWITCH_STATUS_GENERR, end);
+               switch_goto_status(SWITCH_STATUS_GENERR, fail);
        }
 
        fh->file = file;
@@ -155,7 +155,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Spool dir is set.  Make sure [%s] is also a valid path\n", fh->spool_path);
                }
                UNPROTECT_INTERFACE(fh->file_interface);
-               switch_goto_status(status, end);
+               switch_goto_status(status, fail);
        }
 
 
@@ -164,7 +164,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "File [%s] not created!\n", file_path);
                fh->file_interface->file_close(fh);
                UNPROTECT_INTERFACE(fh->file_interface);
-               switch_goto_status(status, end);
+               switch_goto_status(status, fail);
        }
 
        if ((flags & SWITCH_FILE_FLAG_READ)) {
@@ -191,8 +191,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
        }
 
        switch_set_flag(fh, SWITCH_FILE_OPEN);
+       return status;
 
end:
fail:
        
        if (switch_test_flag(fh, SWITCH_FILE_FLAG_FREE_POOL)) {
                switch_core_destroy_memory_pool(&fh->memory_pool);