Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Addons/New Feature
    • Labels:
      None
    • Mantis ID:
      12931
    • Regression:
      No

      Description

      Hi all,

      I'm sending you patch containing backport of T38 terminate functionality from asterisk 1.6 + backported app_fax.c (with T38) application + new application app_faxgateway.c ("FaxGateway").

      Feature is using spands library (I used spandsp-0.0.4pre18 and spandsp-0.0.5pre4).

      Tests:
      Tested on SIP and SS7 channels.
      Tested gateway modes T30<->T38.
      Tested with Linksys SPA2102.

      I don't think I've tested everything so changes are possible.

      Best regards
      Daniel.

                • ADDITIONAL INFORMATION ******

      There are two known bugs that I was not able to fix yet.
      1. 100% CPU usage when gatewaying

      I used profiler (gprof)and found that ast_waitfor_n used about 95% of the whole time. I don't know what is the problem inside ast_waitfor_n.

      2. Problem when using ast_indicate and ast_set_write_format in the same application.
      ast_indicate installs playtones generator (indications.c) that sets its own write format - AST_FORMAT_SLINEAR and makes a backup of write format of the channel.
      application itself uses ast_set_write_format AST_FORMAT_SLINEAR.
      When calling ast_write it comes to this point:
      if (chan->generatordata) {
      if (ast_test_flag(chan, AST_FLAG_WRITE_INT))
      ast_deactivate_generator(chan);
      ast_deactivate_generator calls playtones_release that resets format back to original format of the channel (in my case AST_FORMAT_ALAW).
      This causes that path from AST_FORMAT_SLINEAR to AST_FORMAT_ALAW stops existing and ast_write returns with error (because channel requires AST_FORMAT_ALAW but the frame is AST_FORMAT_SLINEAR).

      Is there anybody with simillar experiences? Can you please help?
      Thank you in adavance.

      1. asterisk-1.4.20.1_t38.diff
        230 kB
        Daniel Ferenci
      2. asterisk-1.6.trunk_t38.diff
        30 kB
        Daniel Ferenci

        Activity

        Hide
        Alisher added a comment -

        I set FaxGateway(SIP/trunk/$

        {EXTEN}

        ) on caller server and Dial(Zap/4) on callee.
        In CLI I can see that it tries to gateway T.38, call gets through, but fax fails, on the fax machine logs I can see that if fails to pickup the modulation, just CNGs and FSK. Usually,with ATAs it picks up V.29 or V.27 modulation at transmits faxes at 2400,4800 or 9600bps.

        Show
        Alisher added a comment - I set FaxGateway(SIP/trunk/$ {EXTEN} ) on caller server and Dial(Zap/4) on callee. In CLI I can see that it tries to gateway T.38, call gets through, but fax fails, on the fax machine logs I can see that if fails to pickup the modulation, just CNGs and FSK. Usually,with ATAs it picks up V.29 or V.27 modulation at transmits faxes at 2400,4800 or 9600bps.
        Hide
        Daniel Ferenci added a comment -

        Thank you for the report.
        First of all what version you have tested on?
        There are problems with trunk version.
        But patch for 1.4.20.1 should be stable.

        Then please try to switch on logs to debug level and sent me the output.
        Thank you in advance.
        Daniel.

        Show
        Daniel Ferenci added a comment - Thank you for the report. First of all what version you have tested on? There are problems with trunk version. But patch for 1.4.20.1 should be stable. Then please try to switch on logs to debug level and sent me the output. Thank you in advance. Daniel.
        Hide
        Martin Vit added a comment -

        can i use FaxGateway(Zap/g1/xxx) for voice call? I'm testing

        sip -> Zap/g1/xxx without fax (only testing dial). It consume 100% CPU and there are no voice (sniffed SIP traffic - it is OK). Log:

        [Jul 17 17:45:04] DEBUG[5533]: channel.c:2808 set_format: Set channel Zap/33-1 to write format ulaw
        [Jul 17 17:45:04] DEBUG[5533]: channel.c:2808 set_format: Set channel Zap/33-1 to read format ulaw
        [Jul 17 17:45:04] DEBUG[5533]: channel.c:1804 ast_settimeout: Scheduling timer at 160 sample intervals
        [Jul 17 17:45:04] DEBUG[4769]: chan_zap.c:9074 pri_dchannel: Queuing frame from PRI_EVENT_PROCEEDING on channel 0/2 span 1
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:623 transmit: faxGw - something happend on peer
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:639 transmit: faxGw - AST_FRAME_CONTROL
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:598 transmit: faxGw - waiting for activity on channels
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:623 transmit: faxGw - something happend on peer
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:598 transmit: faxGw - waiting for activity on channels
        [Jul 17 17:45:04] DEBUG[4769]: chan_zap.c:1442 zt_enable_ec: Enabled echo cancellation on channel 2
        [Jul 17 17:45:04] DEBUG[4768]: chan_sip.c:2109 __sip_autodestruct: Auto destroying SIP dialog '0343fbf87ed9df7e11ec99b8555a55ec@212.71.155.130'
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:623 transmit: faxGw - something happend on peer
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:639 transmit: faxGw - AST_FRAME_CONTROL
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:660 transmit: faxGw - AST_CONTROL_ANSWER
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:711 transmit: faxGw - connections build - ready 1 and erady to talk - 1
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:716 transmit: faxGw - ready to do gatewaing
        [Jul 17 17:45:04] DEBUG[5532]: chan_sip.c:3796 sip_answer: SIP answering channel: SIP/222350122-0821f4f8
        [Jul 17 17:45:04] DEBUG[5532]: chan_sip.c:6899 transmit_response_with_sdp: Setting framing from config on incoming call
        [Jul 17 17:45:04] NOTICE[5532]: app_faxgateway.c:729 transmit: faxGw - original call answered
        [Jul 17 17:45:04] NOTICE[5532]: app_faxgateway.c:761 transmit: Doing T.38 gateway [ 1,0]
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:382 ast_t38_gateway: faxGw - ast_t38_gateway entry
        [Jul 17 17:45:04] DEBUG[5532]: app_faxgateway.c:399 ast_t38_gateway: chan 0x81fdb88 peer 0x81eb818 channels[0] 0x81eb818 channels[1] 0x81fdb88
        [Jul 17 17:45:04] DEBUG[5532]: channel.c:2808 set_format: Set channel SIP/222350122-0821f4f8 to read format slin
        [Jul 17 17:45:04] DEBUG[5532]: channel.c:2808 set_format: Set channel SIP/222350122-0821f4f8 to write format slin
        [Jul 17 17:45:04] NOTICE[5532]: app_faxgateway.c:430 ast_t38_gateway: T.38 gateway started
        [Jul 17 17:45:04] DEBUG[4768]: chan_sip.c:2208 __sip_ack: Stopping retransmission on '2126975476-5060-32@172.24.92.239' of Response 311: Match Found
        [Jul 17 17:45:04] WARNING[5532]: utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852
        [Jul 17 17:45:04] WARNING[5532]: utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852
        [Jul 17 17:45:04] DEBUG[5532]: rtp.c:2771 ast_rtp_write: Ooh, format changed from unknown to alaw
        [Jul 17 17:45:04] DEBUG[5532]: rtp.c:2788 ast_rtp_write: Created smoother: format: 8 ms: 20 len: 160
        [Jul 17 17:45:04] WARNING[5532]: utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852
        [Jul 17 17:45:04] WARNING[5532]: utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852
        [Jul 17 17:45:04] WARNING[5532]: utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852
        [Jul 17 17:45:04] WARNING[5532]: utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852
        ------

        negative timestamps are logging until hangup.

        Show
        Martin Vit added a comment - can i use FaxGateway(Zap/g1/xxx) for voice call? I'm testing sip -> Zap/g1/xxx without fax (only testing dial). It consume 100% CPU and there are no voice (sniffed SIP traffic - it is OK). Log: [Jul 17 17:45:04] DEBUG [5533] : channel.c:2808 set_format: Set channel Zap/33-1 to write format ulaw [Jul 17 17:45:04] DEBUG [5533] : channel.c:2808 set_format: Set channel Zap/33-1 to read format ulaw [Jul 17 17:45:04] DEBUG [5533] : channel.c:1804 ast_settimeout: Scheduling timer at 160 sample intervals [Jul 17 17:45:04] DEBUG [4769] : chan_zap.c:9074 pri_dchannel: Queuing frame from PRI_EVENT_PROCEEDING on channel 0/2 span 1 [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:623 transmit: faxGw - something happend on peer [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:639 transmit: faxGw - AST_FRAME_CONTROL [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:598 transmit: faxGw - waiting for activity on channels [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:623 transmit: faxGw - something happend on peer [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:598 transmit: faxGw - waiting for activity on channels [Jul 17 17:45:04] DEBUG [4769] : chan_zap.c:1442 zt_enable_ec: Enabled echo cancellation on channel 2 [Jul 17 17:45:04] DEBUG [4768] : chan_sip.c:2109 __sip_autodestruct: Auto destroying SIP dialog '0343fbf87ed9df7e11ec99b8555a55ec@212.71.155.130' [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:623 transmit: faxGw - something happend on peer [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:639 transmit: faxGw - AST_FRAME_CONTROL [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:660 transmit: faxGw - AST_CONTROL_ANSWER [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:711 transmit: faxGw - connections build - ready 1 and erady to talk - 1 [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:716 transmit: faxGw - ready to do gatewaing [Jul 17 17:45:04] DEBUG [5532] : chan_sip.c:3796 sip_answer: SIP answering channel: SIP/222350122-0821f4f8 [Jul 17 17:45:04] DEBUG [5532] : chan_sip.c:6899 transmit_response_with_sdp: Setting framing from config on incoming call [Jul 17 17:45:04] NOTICE [5532] : app_faxgateway.c:729 transmit: faxGw - original call answered [Jul 17 17:45:04] NOTICE [5532] : app_faxgateway.c:761 transmit: Doing T.38 gateway [ 1,0] [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:382 ast_t38_gateway: faxGw - ast_t38_gateway entry [Jul 17 17:45:04] DEBUG [5532] : app_faxgateway.c:399 ast_t38_gateway: chan 0x81fdb88 peer 0x81eb818 channels [0] 0x81eb818 channels [1] 0x81fdb88 [Jul 17 17:45:04] DEBUG [5532] : channel.c:2808 set_format: Set channel SIP/222350122-0821f4f8 to read format slin [Jul 17 17:45:04] DEBUG [5532] : channel.c:2808 set_format: Set channel SIP/222350122-0821f4f8 to write format slin [Jul 17 17:45:04] NOTICE [5532] : app_faxgateway.c:430 ast_t38_gateway: T.38 gateway started [Jul 17 17:45:04] DEBUG [4768] : chan_sip.c:2208 __sip_ack: Stopping retransmission on '2126975476-5060-32@172.24.92.239' of Response 311: Match Found [Jul 17 17:45:04] WARNING [5532] : utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852 [Jul 17 17:45:04] WARNING [5532] : utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852 [Jul 17 17:45:04] DEBUG [5532] : rtp.c:2771 ast_rtp_write: Ooh, format changed from unknown to alaw [Jul 17 17:45:04] DEBUG [5532] : rtp.c:2788 ast_rtp_write: Created smoother: format: 8 ms: 20 len: 160 [Jul 17 17:45:04] WARNING [5532] : utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852 [Jul 17 17:45:04] WARNING [5532] : utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852 [Jul 17 17:45:04] WARNING [5532] : utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852 [Jul 17 17:45:04] WARNING [5532] : utils.c:1070 tvfix: warning negative timestamp 135410627.-1230240852 ------ negative timestamps are logging until hangup.
        Hide
        wubbla added a comment -

        Hi!
        I am experiencing exactly the same behavior as festr.

        Show
        wubbla added a comment - Hi! I am experiencing exactly the same behavior as festr.
        Hide
        Tilghman Lesher added a comment -

        We do not accept new features added to the 1.4 series. The 1.4 series was feature-frozen at the time of initial release.

        Show
        Tilghman Lesher added a comment - We do not accept new features added to the 1.4 series. The 1.4 series was feature-frozen at the time of initial release.

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development