[asterisk-users] iaxmodem errors.

Larry Moore lmoore at starwon.com.au
Sat Nov 12 23:42:05 CST 2016

Some additional information which may help you with your installation.

I have 4 IAX Modems named iaxmodem0 - iaxmodem3. I use iaxmodem3 for 
outbound fax transmissions.

I created a queue for the other 3 modems, here is my entry in queues.conf:


    member => IAX2/iaxmodem2
    member => IAX2/iaxmodem1
    member => IAX2/iaxmodem0

In case you are wondering about the 'musicclass' I have used, here is 
the section from musiconhold.conf, the actual location of the files may 
be elsewhere on your system:

    ; ls /usr/local/share/asterisk/silence
    ; 10.gsm
    ; The file 10.gsm came from /usr/local/share/asterisk/sounds/en/silence

I changed 'callbackextension' in my sip.conf for the trunk so that it 
would go directly to the 'fax' extension in the dialplan i.e. 

I've included the console output when an incoming fax is received:

       == Using SIP RTP TOS bits 184
         -- Executing [fax at from-itsp:1] NoOp("SIP/itsp-00000044", "Fax
    Detected 2016-11-13 12:33:40 +0800") in new stack
         -- Executing [fax at from-itsp:2] GotoIf("SIP/itsp-00000044",
    "0?3:8") in new stack
         -- Goto (from-itsp,fax,8)
         -- Executing [fax at from-itsp:8] NoOp("SIP/itsp-00000044",
    "Finish if_from-itsp_237") in new stack
         -- Executing [fax at from-itsp:9] GotoIf("SIP/itsp-00000044",
    "0?10:13") in new stack
         -- Goto (from-itsp,fax,13)
         -- Executing [fax at from-itsp:13] NoOp("SIP/itsp-00000044",
    "Finish if_from-itsp_238") in new stack
         -- Executing [fax at from-itsp:14] Set("SIP/itsp-00000044",
    "FAXOPT(gateway)=yes") in new stack
         -- Executing [fax at from-itsp:15] Queue("SIP/itsp-00000044",
    "hylafax-iax,dRt,,,15") in new stack
         -- Started music on hold, class 'silence', on SIP/itsp-00000044
         -- Call accepted by (format alaw)
         -- Format for call is (alaw)
         -- IAX2/iaxmodem2-3086 is ringing
         -- Stopped music on hold on SIP/itsp-00000044
         -- IAX2/iaxmodem2-3086 answered SIP/itsp-00000044
            > 0x89bac000 -- Probation passed - setting RTP source
    address to <ITSP IP Address>:18998
       == Using UDPTL TOS bits 184
         -- Executing [h at from-itsp:1] GotoIf("SIP/itsp-00000044",
    "0?2:3") in new stack
         -- Goto (from-itsp,h,3)
         -- Executing [h at from-itsp:3] NoOp("SIP/itsp-00000044", "Finish
    if_from-itsp_239") in new stack
         -- Executing [h at from-itsp:4] NoOp("SIP/itsp-00000044",
    "Call/Fax Ended 2016-11-13 12:36:41 +0800") in new stack
         -- Hungup 'IAX2/iaxmodem2-3086'
       == Spawn extension (from-itsp, fax, 15) exited non-zero on

I'm sure you've already checked and confirmed you have 'alaw' and 'ulaw' 
codecs permitted in your IAX Modems, iax.conf and sip.conf configurations

To test your configuration you could set it up your environment so that 
you send an outgoing fax to yourself i.e. your dial your number at the 
VoIP provider, this assumes when you dial your VoIP number a connection 
is made back to you, you can then troubleshoot the communication.

This is how I performed the majority of my tests.

Not sure why you haven't explored the option of terminating a fax call 
in Asterisk, you will need some scripts to convert the received image to 
a PDF which is then e-mailed. An offer was made to you to provide 
scripts, if you set this up when your iaxmodem's aren't working a 
fallback will be for Asterisk to accept the call as it falls through, 
one thing you should know, if you use the T.38 Gateway in your dialplan 
you will need to disabled it prior to Asterisk terminating the call. I 
use extensions.ael so here is an example, I've included the macro I use 
to receive a fax in Asterisk:

    context from-itsp {

             s => {
                     NoOp(Call Received ${STRFTIME(,,%F %T %z)});
                     NoOp(Call Received from ${CALLERID(name)}, Tel:
             . other conditions checked and extensions dialled

             fax => {
                     NoOp(Fax Detected ${STRFTIME(,,%F %T %z)});


             h => {
                     if ( "X${FAXRXFILE}" != "X" )
                     NoOp(Call/Fax Ended ${STRFTIME(,,%F %T %z)});

    macro fax-receive( fax-number, header-info, sender, recipient ) {
             ${ARG1} is Receiving Station Fax Number
             ${ARG2} is Fax Header Information
             ${ARG3} is Fax Sender E-mail Address
             ${ARG4} is Fax Recipient E-mail Address
             NoOp(**** FAX RECEIVE ****);
             NoOp(**** SETTING FAXOPT ****);
             NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)});
             NoOp(FAXOPT(headerinfo) : ${FAXOPT(headerinfo)});
             NoOp(FAXOPT(localstationid) : ${FAXOPT(localstationid)});
             NoOp(**** RECEIVING FAX : ${FAXRXFILE} ****);
             NoOp(**** Subroutine Return ****);



On 13/11/2016 8:07 AM, Larry Moore wrote:
> Is your network/firewall configuration permitting the ports for UDPTL, 
> runn the command:  udptl show config
>     UDPTL Global options
>     --------------------
>     udptlstart:      4000
>     udptlend:        4999
>     udptlfecentries: 3
>     udptlfecspan:    3
>     use_even_ports:  No
>     udptlchecksums: Yes
> In your sip configuration for your 'mytrunk' peer have you set 
> applicable options e.g.:
>     t38pt_udptl=yes,redundancy,maxdatagram=400
> In your extensions.conf you could and probably should set the 
> following option prior to dialing the IAX channel, this is to enable 
> the T.38 gateway feature of Asterisk 11:
>     Set(FAXOPT(gateway)=yes)
> I have it working in my installation however I have incoming voice 
> calls too hence I use 'faxdetect' to direct the call to the 'fax' 
> extension.
> Cheers,
> Larry.
> On 12/11/2016 5:24 AM, tux john wrote:
>> hi. i am using asterisk 11.24.1 in my raspberry. i do have a sip 
>> trunk with a provider with g711a. I am trying to setup a fax server 
>> by following the guide in 
>> http://the-asterisk-book.com/1.6/faxserver.html.
>> i do live in Greece and the number is 00302112152130
>> the problem is that i am getting the following error and i am stuck:
>>   == Using SIP RTP TOS bits 184
>>   == Using SIP RTP CoS mark 5
>>     -- Executing [00302112152130 at fax-in:1] 
>> Dial("SIP/mytrunk-00000001", "IAX2/iaxmodem") in new stack
>>     -- Called IAX2/iaxmodem
>>     -- Hungup 'IAX2/iaxmodem-3818'
>>   == Everyone is busy/congested at this time (1:0/0/1)
>>     -- Auto fallthrough, channel 'SIP/mytrunk-00000001' status is 
>> RasPBX*CLI>
>> the extensions.conf has
>> [fax-in]
>> exten => 00302112152130,1,Dial(IAX2/iaxmodem)
>> any ideas, please?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20161113/d36a4ef5/attachment.html>

More information about the asterisk-users mailing list