IAX2->PJSIP forward problem

Dear all,

I’m trying to use Asterisk as a proxy between an application (WarVOX) that makes IAX2 calls and a GoIP GSM Gateway which provides a SIP interface and will allow me to access the PTSN network.

The IAX2 incoming part is woking fine and Asterisk accepts the call, but I’m having trouble bouncing it to the PJSIP trunk. From what I understand from the debug, seems like the call is falling into a IAX2<->PJSIP loop.

192.168.0.102 is the GoIP and
192.168.0.112 is my Asterisk box.

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: REGREQ
    Timestamp: 00000ms  SCall: 00001  DCall: 00000 192.168.0.112:46350
    USERNAME        : warvox
    REFRESH         : 60

Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: REGAUTH
    Timestamp: 00018ms  SCall: 09460  DCall: 00001 192.168.0.112:46350
    AUTHMETHODS     : 2
    CHALLENGE       : \x36\x32\x37\x34\x32\x34\x39\x35\x33
    USERNAME        : warvox

Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: REGREQ
    Timestamp: 00000ms  SCall: 00001  DCall: 09460 192.168.0.112:46350
    USERNAME        : warvox
    MD5 RESULT      : bc6684469607e5cd9daa792dbc8fd39e
    REFRESH         : 60

    -- Registered IAX2 'warvox' (AUTHENTICATED) at 192.168.0.112:46350
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: REGACK
    Timestamp: 00021ms  SCall: 09460  DCall: 00001 192.168.0.112:46350
    USERNAME        : warvox
    DATE TIME       : 2022-09-09  21:31:28
    REFRESH         : 60
    APPARENT ADDRES : IPV4 192.168.0.112:46350

Rx-Frame Retry[ No] -- OSeqno: 002 ISeqno: 002 Type: IAX     Subclass: ACK
    Timestamp: 00001ms  SCall: 00001  DCall: 09460 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
    Timestamp: 00000ms  SCall: 00002  DCall: 00000 192.168.0.112:46350
    VERSION         : 2
    CALLING NUMBER  : 900400555
    CALLING NAME    :
    CALLING PRESNTN : 1
    CALLING TYPEOFN : 0
    CALLING TRANSIT : 0
    FORMAT          : 4
    CAPABILITY      : 76
    USERNAME        : warvox
    CALLED NUMBER   : 900400555
    DNID            : 900400555
    ADSICPE         : 0
    CALLTOKEN       : Present
    FW BLOCK DATA   : 12 bytes

Tx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: CTOKEN
    Timestamp: 00000ms  SCall: 00001  DCall: 00002 192.168.0.112:46350
    CALLTOKEN       : 51 bytes

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
    Timestamp: 00000ms  SCall: 00002  DCall: 00000 192.168.0.112:46350
    VERSION         : 2
    CALLING NUMBER  : 900400555
    CALLING NAME    :
    CALLING PRESNTN : 1
    CALLING TYPEOFN : 0
    CALLING TRANSIT : 0
    FORMAT          : 4
    CAPABILITY      : 76
    USERNAME        : warvox
    CALLED NUMBER   : 900400555
    DNID            : 900400555
    ADSICPE         : 0
    CALLTOKEN       : 51 bytes
    FW BLOCK DATA   : 12 bytes

Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: AUTHREQ
    Timestamp: 00003ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
    AUTHMETHODS     : 2
    CHALLENGE       : \x31\x39\x37\x37\x32\x34\x31\x35\x34
    USERNAME        : warvox

Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: AUTHREP
    Timestamp: 00001ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
    MD5 RESULT      : ed993265f40ee1eb5da2eada4566f8a1

    -- Accepting AUTHENTICATED call from 192.168.0.112:46350:
    --        > requested format = ulaw,
    --        > requested prefs = (),
    --        > actual format = ulaw,
    --        > host prefs = (ulaw|alaw|siren14|siren7|g722|slin16|slin|g726|g726aal2|adpcm|gsm|ilbc|speex|lpc10|g729|g723),
    --        > priority = mine
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: ACCEPT
    Timestamp: 00006ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
    FORMAT          : 4
    FORMAT2         : ulaw

    -- Executing [900400555@prueba:1] Dial("IAX2/warvox-15437", "PJSIP/GoIP") in new stack
Rx-Frame Retry[ No] -- OSeqno: 002 ISeqno: 002 Type: IAX     Subclass: ACK
    Timestamp: 00001ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
    -- Called PJSIP/GoIP
    -- PJSIP/GoIP-0000000b is making progress passing it to IAX2/warvox-15437
Tx-Frame Retry[000] -- OSeqno: 002 ISeqno: 002 Type: CONTROL Subclass: PROGRES
    Timestamp: 00009ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 002 ISeqno: 003 Type: IAX     Subclass: ACK
    Timestamp: 00044ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[000] -- OSeqno: 003 ISeqno: 002 Type: VOICE   Subclass: 4
    Timestamp: 00088ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 002 ISeqno: 004 Type: IAX     Subclass: ACK
    Timestamp: 00089ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[000] -- OSeqno: 004 ISeqno: 002 Type: IAX     Subclass: LAGRQ
    Timestamp: 10000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 002 ISeqno: 005 Type: IAX     Subclass: LAGRP
    Timestamp: 10000ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 005 ISeqno: 003 Type: IAX     Subclass: ACK
    Timestamp: 10000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[000] -- OSeqno: 005 ISeqno: 003 Type: IAX     Subclass: LAGRQ
    Timestamp: 19999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 003 ISeqno: 007 Type: IAX     Subclass: LAGRP
    Timestamp: 19999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 007 ISeqno: 004 Type: IAX     Subclass: ACK
    Timestamp: 19999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[000] -- OSeqno: 006 ISeqno: 004 Type: IAX     Subclass: PING
    Timestamp: 21000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 004 ISeqno: 009 Type: IAX     Subclass: PONG
    Timestamp: 21000ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 009 ISeqno: 005 Type: IAX     Subclass: ACK
    Timestamp: 21000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[001] -- OSeqno: 005 ISeqno: 005 Type: IAX     Subclass: LAGRQ
    Timestamp: 19999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 005 ISeqno: 011 Type: IAX     Subclass: LAGRP
    Timestamp: 19999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 011 ISeqno: 006 Type: IAX     Subclass: ACK
    Timestamp: 19999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[001] -- OSeqno: 006 ISeqno: 006 Type: IAX     Subclass: PING
    Timestamp: 21000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 006 ISeqno: 013 Type: IAX     Subclass: PONG
    Timestamp: 21000ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 013 ISeqno: 007 Type: IAX     Subclass: ACK
    Timestamp: 21000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[000] -- OSeqno: 007 ISeqno: 007 Type: IAX     Subclass: LAGRQ
    Timestamp: 29999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 007 ISeqno: 015 Type: IAX     Subclass: LAGRP
    Timestamp: 29999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 015 ISeqno: 008 Type: IAX     Subclass: ACK
    Timestamp: 29999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[002] -- OSeqno: 005 ISeqno: 008 Type: IAX     Subclass: LAGRQ
    Timestamp: 19999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 008 ISeqno: 017 Type: IAX     Subclass: LAGRP
    Timestamp: 19999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 017 ISeqno: 009 Type: IAX     Subclass: ACK
    Timestamp: 19999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[002] -- OSeqno: 006 ISeqno: 009 Type: IAX     Subclass: PING
    Timestamp: 21000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 009 ISeqno: 019 Type: IAX     Subclass: PONG
    Timestamp: 21000ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 019 ISeqno: 010 Type: IAX     Subclass: ACK
    Timestamp: 21000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[001] -- OSeqno: 007 ISeqno: 010 Type: IAX     Subclass: LAGRQ
    Timestamp: 29999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 010 ISeqno: 021 Type: IAX     Subclass: LAGRP
    Timestamp: 29999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 021 ISeqno: 011 Type: IAX     Subclass: ACK
    Timestamp: 29999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[000] -- OSeqno: 008 ISeqno: 011 Type: IAX     Subclass: LAGRQ
    Timestamp: 39999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 011 ISeqno: 023 Type: IAX     Subclass: LAGRP
    Timestamp: 39999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 023 ISeqno: 012 Type: IAX     Subclass: ACK
    Timestamp: 39999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[003] -- OSeqno: 005 ISeqno: 012 Type: IAX     Subclass: LAGRQ
    Timestamp: 19999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[000] -- OSeqno: 009 ISeqno: 012 Type: IAX     Subclass: PING
    Timestamp: 41999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 012 ISeqno: 025 Type: IAX     Subclass: LAGRP
    Timestamp: 19999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 025 ISeqno: 013 Type: IAX     Subclass: ACK
    Timestamp: 19999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 013 ISeqno: 026 Type: IAX     Subclass: PONG
    Timestamp: 41999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 026 ISeqno: 014 Type: IAX     Subclass: ACK
    Timestamp: 41999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[003] -- OSeqno: 006 ISeqno: 014 Type: IAX     Subclass: PING
    Timestamp: 21000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 014 ISeqno: 029 Type: IAX     Subclass: PONG
    Timestamp: 21000ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 029 ISeqno: 015 Type: IAX     Subclass: ACK
    Timestamp: 21000ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[002] -- OSeqno: 007 ISeqno: 015 Type: IAX     Subclass: LAGRQ
    Timestamp: 29999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 015 ISeqno: 031 Type: IAX     Subclass: LAGRP
    Timestamp: 29999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 031 ISeqno: 016 Type: IAX     Subclass: ACK
    Timestamp: 29999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[000] -- OSeqno: 010 ISeqno: 016 Type: IAX     Subclass: LAGRQ
    Timestamp: 49998ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Tx-Frame Retry[001] -- OSeqno: 008 ISeqno: 016 Type: IAX     Subclass: LAGRQ
    Timestamp: 39999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 016 ISeqno: 033 Type: IAX     Subclass: LAGRP
    Timestamp: 49998ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 033 ISeqno: 017 Type: IAX     Subclass: ACK
    Timestamp: 49998ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
Rx-Frame Retry[ No] -- OSeqno: 017 ISeqno: 034 Type: IAX     Subclass: LAGRP
    Timestamp: 39999ms  SCall: 00002  DCall: 15437 192.168.0.112:46350
Tx-Frame Retry[-01] -- OSeqno: 034 ISeqno: 018 Type: IAX     Subclass: ACK
    Timestamp: 39999ms  SCall: 15437  DCall: 00002 192.168.0.112:46350
[Sep  9 21:32:20] WARNING[3237]: chan_iax2.c:3569 __attempt_transmit: Max retries exceeded to host 192.168.0.112 on IAX2/warvox-15437 (type = 6, subclass = 11, ts=19999, seqno=5)
  == Spawn extension (prueba, 900400555, 1) exited non-zero on 'IAX2/warvox-15437'
    -- Hungup 'IAX2/warvox-15437'
Rx-Frame Retry[ No] -- OSeqno: 018 ISeqno: 036 Type: IAX     Subclass: HANGUP
    Timestamp: 53002ms  SCall: 00002  DCall: 15437 192.168.0.112:46350

This is the Dialplan from extensions.conf:

exten => _900XXXXXX,1,Dial(PJSIP/GoIP)

And this is my pjsip.conf:

[transport-udp-nat]
type = transport
protocol = udp
bind = 0.0.0.0:5060
allow_reload=no

[GoIP]
type=endpoint
context=from-goip
disallow=all
allow=ulaw
outbound_auth=GoIP
auth=GoIP
aors=GoIP
transport=transport-udp-nat
from_user=GoIP
send_diversion=yes
send_pai=yes
send_rpid=yes
trust_id_inbound=yes
trust_id_outbound=yes

[GoIP]
type=aor
contact=sip:192.168.0.102:5060
qualify_frequency=200
max_contacts=1
remove_existing=yes

[GoIP]
type=auth
auth_type=userpass
username=GoIP
password=mypass

[GoIP]
type=identify
endpoint=GoIP
match=192.168.0.102

And from what I understand, the PJSIP endpoint is working fine:

> pjsip show endpoints
> 
>  Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
>     I/OAuth:  <AuthId/UserName...........................................................>
>         Aor:  <Aor............................................>  <MaxContact>
>       Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
>   Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
>    Identify:  <Identify/Endpoint.........................................................>
>         Match:  <criteria.........................>
>     Channel:  <ChannelId......................................>  <State.....>  <Time.....>
>         Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
> ==========================================================================================
> 
>  Endpoint:  GoIP                                            Not in use    0 of inf
>     OutAuth:  GoIP/GoIP
>      InAuth:  GoIP/GoIP
>         Aor:  613073127                                          1
>       Contact:  GoIP/sip:GoIP@192.168.0.102:5060 2dcdc80de3 Avail         6.104
>       Contact:  GoIP/sip:192.168.0.102:5060           353c89f0f6 Avail         7.398
>   Transport:  transport-udp-nat         udp      0      0  0.0.0.0:5060
>    Identify:  GoIP/GoIP
>         Match: 192.168.0.102/32
> 
> 
> Objects found: 1

Any guidance on this would be greately appreciated.

That might suggest for some reason your Asterisk system isn’t able to send packets to the IAX2 side of things.

Does and IAX2 to another IAX2 call work? What about PJSIP → IAX2, or local → IAX2?

You may want to do “core set debug 3 chan_iax2” as well and see if there are any other clues there.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.