Hi<div><br></div><div>I'm trying to send fax from FreeSWITCH to PSTN using T.38. FS is connected to Broadsoft softswitch. The softswitch is connected to PSTN using SIP-trunk to external provider. Apparently there is no T.38 on Broadsoft and it is provided by the external provider (i.e. Broadsoft provides only T.38 pass-through).</div>
<div><br></div><div>I can receive faxes destined at FS without a problem. I call rxfax and FS sends re-INVITE to Broadsoft and T.38 transmission begins.</div><div><br></div><div>However, when I want to send fax, I can't get re-INVITE from Broadsoft with T.38. From the company that operates the Broadsoft softswitch I received a PCAP of working transmission with Linksys/SPA2102-5.2.10: SPA2102 issues re-INVITE itself when sending fax and T.38 is negotiated correctly. Unfortunately I can't get FS to issue the re-INVITE.</div>
<div><br></div><div>I thought that a part of the problem is that FS receives from Broadsoft RTP-event Fax ANS (32) messages and it somehow interferes with fax-detecting routing in spandsp. Unfortunately, disabling telephone-event altogether didn't help - Broadsoft does not sent RTP-event packets but still FS does not re-INVITE.</div>
<div><br></div><div>My sending script is as follows:</div><div><br></div><div><div> var variables = "{";</div><div> variables += "loopback_bowout=false,";</div><div> variables += "ignore_early_media=true,";</div>
<div> variables += "origination_caller_id_number='" + callerid + "',";</div><div> variables += "origination_caller_id_name='" + callername + "',";</div><div><br>
</div><div> variables += "fax_ident='" + callerid + "',";</div><div> variables += "fax_header='" + callername + "',";</div><div> variables += "fax_email='" + email + "',";</div>
<div> variables += "fax_dest='" + dest + "',";</div><div> variables += "fax_tiff='" + tiff + "',";</div><div> variables += "fax_attempt='" + attempt + "',";</div>
<div> variables += "fax_max_attempts='" + max_attempts + "',";</div><div> variables += "fax_delay='" + delay + "',";</div><div><br></div><div> variables += "fax_enable_t38=true,";</div>
<div> variables += "fax_enable_t38_insist=true,";</div><div> variables += "fax_enable_t38_request=true,";</div><div> variables += "fax_disable_v17=false,";</div><div> variables += "fax_use_ecm=true,";</div>
<div> //variables += "fax_force_caller=true,";</div><div> variables += "fax_verbose=true";</div><div> variables += "}";</div></div><div><br></div><div><div> var s = new Session(variables + "loopback/"+dest+"/pbx/XML");</div>
<div><br></div><div> hook_run = 0;</div><div> s.setHangupHook(hangup_hook);</div><div> if (s.ready()) {</div><div> console_log("DEBUG", "calling txfax\n");</div><div> s.execute("txfax", tiff);</div>
<div> console_log("DEBUG", "returning from txfax" + "\n");</div><div> } else {</div><div> console_log("INFO", "sending fax from " + callerid + " to " + dest + ": could not connect: " + s.cause + "(" + s.causecode + ")" + "\n");</div>
<div> return;</div><div> }</div></div><div><br></div><div>I do send the fax through loopback as I need it to establish rating session. I have experimented with various settings in fax_* variables. The only combination where anything happens (there is some T.30 negotiation in the logs) is when I set fax_enable_t38_request to false - then FS tries to negotiate T.30 transmission over G.711. I've never observed T.38 connection when sending fax, but it always ends with (20) Received no response to DCS or TCF. </div>
<div><br></div><div>Usually the only thing there is in the logs is:</div><div><br></div><div><div>2012-05-16 17:27:19.824842 [DEBUG] mod_spandsp_fax.c:1357 Raw read codec activation Success L16 20000</div><div>2012-05-16 17:27:19.824842 [DEBUG] mod_spandsp_fax.c:1373 Raw write codec activation Success L16</div>
<div>2012-05-16 17:27:22.124834 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div></div><div><div>2012-05-16 17:27:22.884832 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div>
<div>2012-05-16 17:27:23.444834 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div><div>2012-05-16 17:27:23.784833 [DEBUG] switch_rtp.c:3452 RTP RECV DTMF 2012-05-16 17:27:23.804833 [DEBUG] switch_rtp.c:3452 RTP RECV DTMF 2012-05-16 17:27:26.544834 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC sig</div>
<div>nal status is Carrier down (-1) in state 18</div><div>2012-05-16 17:27:26.544834 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div><div>2012-05-16 17:27:27.264833 [DEBUG] switch_rtp.c:3452 RTP RECV DTMF 2012-05-16 17:27:27.284873 [DEBUG] switch_rtp.c:3452 RTP RECV DTMF 2012-05-16 17:27:27.604841 [DEBUG] switch_rtp.c:3452 RTP RECV DTMF 2012-05-</div>
<div>16 17:27:28.884836 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Abort (-8) in state 18</div><div>2012-05-16 17:27:28.884836 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div>
<div>2012-05-16 17:27:30.704933 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div><div>2012-05-16 17:27:30.764833 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div>
<div>2012-05-16 17:27:31.904833 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div><div>2012-05-16 17:27:34.544835 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div>
<div>2012-05-16 17:27:37.544837 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div><div>2012-05-16 17:27:40.164835 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div>
<div>2012-05-16 17:27:41.184835 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div><div>2012-05-16 17:27:41.224837 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Abort (-8) in state 18</div>
<div>2012-05-16 17:27:41.224837 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div><div>2012-05-16 17:27:43.184834 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div>
<div>2012-05-16 17:27:44.824838 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div><div>2012-05-16 17:27:45.664833 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div>
<div>2012-05-16 17:27:45.664833 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div><div>2012-05-16 17:27:45.724837 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div>
<div>2012-05-16 17:27:45.724837 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div><div>2012-05-16 17:27:45.784837 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier up (-2) in state 18</div>
<div>2012-05-16 17:27:45.804837 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Carrier down (-1) in state 18</div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Status changing to 'The call dropped prematurely'</div>
<div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:491 ==============================================================================</div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:504 Fax processing not successful - result (49) The call dropped prematurely.</div>
<div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:509 Remote station id: </div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:510 Local station id: </div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:511 Pages transferred: 0</div>
<div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:513 Total fax pages: 0</div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:514 Image resolution: 0x0</div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:515 Transfer Rate: 14400</div>
<div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:517 ECM status off</div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:518 remote country: </div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:519 remote vendor: </div>
<div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:520 remote model: </div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:522 ==============================================================================</div>
<div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Changing from state 18 to 32</div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Changing from phase T30_PHASE_A_CNG to T30_PHASE_CALL_FINISHED</div>
<div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW FAX Set rx type 9</div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW FAX FAX exchange complete</div><div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW FAX Set tx type 9</div>
<div>2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW FAX FAX exchange complete</div></div><div><br></div><div>The same script transmits faxes correctly with Cisco gateway, but Cisco correctly re-INVITEs FS when FS is transmitting fax.</div>
<div><br></div><div>PCAP dumps available, but I'd like to keep them private and not post on public pastebin.</div><div><br></div><div>I'd appreciate any help on this issue.</div><div><br></div><div>Best regards</div>
<div><div><br></div>-- <br>Marcin Gozdalik<br>
</div>