]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix fax negotiation issue
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 24 May 2010 19:38:43 +0000 (14:38 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 24 May 2010 19:38:43 +0000 (14:38 -0500)
src/mod/applications/mod_fax/mod_fax.c

index dbe018ab1fb85270d65d77f8d00e91d55386ae3d..c242e848b18e8a869c4d8251bacdd069027f3879 100644 (file)
@@ -685,7 +685,7 @@ static t38_mode_t configure_t38(pvt_t *pvt)
     switch_t38_options_t *t38_options = switch_channel_get_private(channel, "t38_options");
     int method = 2;
 
-    if (!t38_options) {
+    if (!t38_options || !pvt || !pvt->t38_core) {
         pvt->t38_mode = T38_MODE_REFUSED;
         return pvt->t38_mode;
     }
@@ -1481,6 +1481,7 @@ static switch_status_t t38_gateway_on_soft_execute(switch_core_session_t *sessio
     }
 
     if (pvt->t38_mode == T38_MODE_REQUESTED) {
+        spanfax_init(pvt, T38_GATEWAY_MODE);
         configure_t38(pvt);
         pvt->t38_mode = T38_MODE_NEGOTIATED;
     } else {
@@ -1489,9 +1490,9 @@ static switch_status_t t38_gateway_on_soft_execute(switch_core_session_t *sessio
             switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
             goto end_unlock;
         }
-    }
 
-    spanfax_init(pvt, T38_GATEWAY_MODE);
+        spanfax_init(pvt, T38_GATEWAY_MODE);
+    }
 
     /* This will change the rtp stack to udptl mode */
     msg.from = __FILE__;