]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3571 try this, I don't have a way to test it so this is just guessing, give me...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 21 Sep 2011 19:56:49 +0000 (14:56 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 21 Sep 2011 19:56:49 +0000 (14:56 -0500)
src/include/switch_types.h
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index e0419718c1600a5f54bf78f766a1e0a76c787c97..21dfa513395f2e74205b3a36a60839dd3f0dadf5 100644 (file)
@@ -1181,7 +1181,8 @@ typedef enum {
        CF_APP_TAGGED = (1 << 0),
        CF_APP_T38 = (1 << 1),
        CF_APP_T38_REQ = (1 << 2),
-       CF_APP_T38_FAIL = (1 << 3)
+       CF_APP_T38_FAIL = (1 << 3),
+       CF_APP_T38_NEGOTIATED = (1 << 4)
 } switch_channel_app_flag_t;
 
 
index 4653d9cee8cf03f3b6ec6ee468b3a381d5b72a05..23cb9031bf7afd66f36f7a770145ba6cf8db4aaf 100644 (file)
@@ -806,7 +806,7 @@ static t38_mode_t negotiate_t38(pvt_t *pvt)
         switch_channel_set_private(channel, "t38_options", NULL);
     } else {
         pvt->t38_mode = T38_MODE_NEGOTIATED;
-
+        switch_channel_set_app_flag_key("T38", channel, CF_APP_T38_NEGOTIATED);
 
         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38 SDP Origin = %s\n", t38_options->sdp_o_line);        
         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "T38FaxVersion = %d\n", t38_options->T38FaxVersion);
@@ -1211,6 +1211,7 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
                 } else if (switch_channel_test_app_flag_key("T38", channel, CF_APP_T38)) {
                     switch_core_session_message_t msg = { 0 };
                     pvt->t38_mode = T38_MODE_NEGOTIATED;
+                    switch_channel_set_app_flag_key("T38", channel, CF_APP_T38_NEGOTIATED);
                     spanfax_init(pvt, T38_MODE);
                     configure_t38(pvt);
 
@@ -1493,13 +1494,14 @@ static switch_status_t t38_gateway_on_soft_execute(switch_core_session_t *sessio
         spanfax_init(pvt, T38_GATEWAY_MODE);
         configure_t38(pvt);
         pvt->t38_mode = T38_MODE_NEGOTIATED;
+        switch_channel_set_app_flag_key("T38", channel, CF_APP_T38_NEGOTIATED);
     } else {
         if (negotiate_t38(pvt) != T38_MODE_NEGOTIATED) {
             switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s Could not negotiate T38\n", switch_channel_get_name(channel));
             switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
             goto end_unlock;
         }
-
+        switch_channel_set_app_flag_key("T38", channel, CF_APP_T38_NEGOTIATED);
         spanfax_init(pvt, T38_GATEWAY_MODE);
     }
 
index ef65a7ce95b088dbfa89e5b8d7921e580d9e726e..e32b96cd01a06734ae3501905d7f1a6cbcbd6328 100644 (file)
@@ -5605,6 +5605,12 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                                        }
                                        goto done;
                                } else {
+
+                                       if (switch_channel_test_app_flag_key("T38", tech_pvt->channel, CF_APP_T38_NEGOTIATED)) {
+                                               nua_respond(tech_pvt->nh, SIP_200_OK, TAG_END());
+                                               goto done;
+                                       }
+
                                        sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE);
 
                                        if (tech_pvt->num_codecs) {
@@ -5620,6 +5626,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                                                if (sofia_glue_tech_choose_port(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {
                                                        goto done;
                                                }
+                                               
                                                sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
 
                                                if (sofia_glue_activate_rtp(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {
index af55c13a9a424fde05f8ed5e2806995a5b837d50..a85098bc8dc4d2834d43e83f1e175a3d02a9833e 100644 (file)
@@ -4404,6 +4404,11 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
                if (got_udptl && m->m_type == sdp_media_image && m->m_port) {
                        switch_t38_options_t *t38_options = tech_process_udptl(tech_pvt, sdp, m);
 
+                       if (switch_channel_test_app_flag_key("T38", tech_pvt->channel, CF_APP_T38_NEGOTIATED)) {
+                               match = 1;
+                               goto done;
+                       }
+
                        if (switch_channel_test_app_flag_key("T38", tech_pvt->channel, CF_APP_T38)) {
                                sofia_set_flag(tech_pvt, TFLAG_NOREPLY);
                        }