]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3915 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 17 Feb 2012 15:57:56 +0000 (09:57 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 17 Feb 2012 15:57:56 +0000 (09:57 -0600)
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index 0a49cc3730fa406d109bfd70bfb03d46b942a1e9..a33b46881977d24fbfe2ed4e249fbf2188ab3784 100644 (file)
@@ -1912,13 +1912,18 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                {
                        switch_t38_options_t *t38_options = switch_channel_get_private(tech_pvt->channel, "t38_options");
 
-                       sofia_glue_set_image_sdp(tech_pvt, t38_options, msg->numeric_arg);
+                       if (t38_options) {
+                               sofia_glue_set_image_sdp(tech_pvt, t38_options, msg->numeric_arg);
 
-                       if (!switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
-                               switch_channel_set_flag(channel, CF_REQ_MEDIA);
+                               if (!switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
+                                       switch_channel_set_flag(channel, CF_REQ_MEDIA);
+                               }
+                               sofia_set_flag_locked(tech_pvt, TFLAG_SENT_UPDATE);
+                               sofia_glue_do_invite(session);
+                       } else {
+                               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s Request to send IMAGE on channel with not t38 options.\n", 
+                                                                 switch_channel_get_name(channel));
                        }
-                       sofia_set_flag_locked(tech_pvt, TFLAG_SENT_UPDATE);
-                       sofia_glue_do_invite(session);
                }
                break;
 
index 1e23e40ee356235a0db523cf2a8c0ef077f4fe36..3f754462e71b3d42d3c9c1ee5ec62da1ac630a30 100644 (file)
@@ -44,10 +44,10 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
        char buf[2048] = "";
        char max_buf[128] = "";
        char max_data[128] = "";
-       const char *ip = t38_options->local_ip;
-       uint32_t port = t38_options->local_port;
+       const char *ip;
+       uint32_t port;
        const char *family = "IP4";
-       const char *username = tech_pvt->profile->username;
+       const char *username;
        const char *bit_removal_on = "a=T38FaxFillBitRemoval\n";
        const char *bit_removal_off = "";
        
@@ -59,6 +59,13 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
        const char *var;
        int broken_boolean;
 
+       switch_assert(tech_pvt);
+       switch_assert(t38_options);
+
+       ip = t38_options->local_ip;
+       port = t38_options->local_port;
+       username = tech_pvt->profile->username;
+
        //sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
 
        var = switch_channel_get_variable(tech_pvt->channel, "t38_broken_boolean");