T.38/spandsp_fax interop problem
Hi 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). 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. 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. 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. My sending script is as follows: var variables = "{"; variables += "loopback_bowout=false,"; variables += "ignore_early_media=true,"; variables += "origination_caller_id_number='" + callerid + "',"; variables += "origination_caller_id_name='" + callername + "',"; variables += "fax_ident='" + callerid + "',"; variables += "fax_header='" + callername + "',"; variables += "fax_email='" + email + "',"; variables += "fax_dest='" + dest + "',"; variables += "fax_tiff='" + tiff + "',"; variables += "fax_attempt='" + attempt + "',"; variables += "fax_max_attempts='" + max_attempts + "',"; variables += "fax_delay='" + delay + "',"; variables += "fax_enable_t38=true,"; variables += "fax_enable_t38_insist=true,"; variables += "fax_enable_t38_request=true,"; variables += "fax_disable_v17=false,"; variables += "fax_use_ecm=true,"; //variables += "fax_force_caller=true,"; variables += "fax_verbose=true"; variables += "}"; var s = new Session(variables + "loopback/"+dest+"/pbx/XML"); hook_run = 0; s.setHangupHook(hangup_hook); if (s.ready()) { console_log("DEBUG", "calling txfax\n"); s.execute("txfax", tiff); console_log("DEBUG", "returning from txfax" + "\n"); } else { console_log("INFO", "sending fax from " + callerid + " to " + dest + ": could not connect: " + s.cause + "(" + s.causecode + ")" + "\n"); return; } 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. Usually the only thing there is in the logs is: 2012-05-16 17:27:19.824842 [DEBUG] mod_spandsp_fax.c:1357 Raw read codec activation Success L16 20000 2012-05-16 17:27:19.824842 [DEBUG] mod_spandsp_fax.c:1373 Raw write codec activation Success L16 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 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 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 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 nal status is Carrier down (-1) in state 18 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 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- 16 17:27:28.884836 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 HDLC signal status is Abort (-8) in state 18 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Status changing to 'The call dropped prematurely' 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:491 ============================================================================== 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:504 Fax processing not successful - result (49) The call dropped prematurely. 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:509 Remote station id: 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:510 Local station id: 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:511 Pages transferred: 0 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:513 Total fax pages: 0 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:514 Image resolution: 0x0 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:515 Transfer Rate: 14400 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:517 ECM status off 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:518 remote country: 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:519 remote vendor: 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:520 remote model: 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:522 ============================================================================== 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Changing from state 18 to 32 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 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW FAX Set rx type 9 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW FAX FAX exchange complete 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW FAX Set tx type 9 2012-05-16 17:27:46.304847 [DEBUG] mod_spandsp_fax.c:286 FLOW FAX FAX exchange complete The same script transmits faxes correctly with Cisco gateway, but Cisco correctly re-INVITEs FS when FS is transmitting fax. PCAP dumps available, but I'd like to keep them private and not post on public pastebin. I'd appreciate any help on this issue. Best regards -- Marcin Gozdalik
2012/5/16 Marcin Gozdalik <gozdal@gmail.com>
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).
[snip]
For anybody struggling with the same problem: it turned out to be loopback problem. It is possible to transmit a fax through loopback using txfax when the other side is issuing reINVITE. It is however not possible to force FS to issue reINVITE in txfax over loopback (using enable_t38_request). Best regards -- Marcin Gozdalik
participants (1)
-
Marcin Gozdalik