How to debug a failing call through an IAX2 trunk

Hi,

I’ve set up an IAX2 trunk between 2 Asterisk servers.

Server 1:

asterisk -rx "iax2 show peer BRIinVoIP2"


  * Name       : BRIinVoIP2
  Description  :
  Secret       : <Set>
  Context      : from-BRI
  Parking lot  :
  Mailbox      :
  Dynamic      : No
  Callnum limit: 0
  Calltoken req: No
  Trunk        : No
  Encryption   : No
  Callerid     : "" <>
  Expire       : -1
  ACL          : Yes
  Addr->IP     : 192.168.136.2 Port 4569
  Defaddr->IP  : (null) Port (null)
  Username     : BRIin
  Codecs       : (g723|gsm|ulaw|alaw|g726aal2|adpcm|slin|lpc10|g729|speex|ilbc|g726|g722|siren7|siren14|slin16|h264|vp8|opus)
  Codec Order  : (ulaw|alaw|siren14|siren7|g722|slin16|slin|g726|g726aal2|adpcm|gsm|ilbc|speex|lpc10|g729|g723|opus|vp8|h264)
  Status       : OK (3 ms)
  Qualify      : every 60000ms when OK, every 10000ms when UNREACHABLE (sample smoothing Off)

Server 2:

#  asterisk -rx "iax2 show peer BRIinVoIP2"


  * Name       : BRIinVoIP2
  Secret       : <Set>
  Context      : from-BRI
  Mailbox      :
  Dynamic      : No
  Callnum limit: 0
  Calltoken req: No
  Trunk        : No
  Callerid     : "" <>
  Expire       : -1
  ACL          : No
  Addr->IP     : 10.215.144.92 Port 4569
  Defaddr->IP  : 0.0.0.0 Port 0
  Username     : BRIin
  Codecs       : 0x20000e (gsm|ulaw|alaw|h264)
  Codec Order  : (ulaw|alaw|gsm)
  Status       : OK (3 ms)
  Qualify      : every 60000ms when OK, every 10000ms when UNREACHABLE (sample smoothing Off)

So it seems to be OK.
However, when I try to Dial through this IAX2 trunk from Server 2 I get the following in the log there but I don’t see anything in Server 1’s log.

Executing [123456789@mycontext:3] Dial("mISDN/7-u550", "IAX2/BRIin:MYPASSWORD@BRIinVoIP2/123456789|300|Twg") in new stack
chan_iax2.c: prepending 8 to prefs
logger.c:     -- Called BRIin:MYPASSWORD@BRIinVoIP2/123456789
logger.c:     -- Hungup 'IAX2/BRIinVoIP2-16129'
logger.c:   == Everyone is busy/congested at this time (1:0/0/1)

How can I tell where I misconfigured the trunk?
Enabling IAX2 debug gives me an overwhelming amount of messages.

Regards

Have you tried setting debug on the appropriate peer? E.g.

iax2 set debug peer BRIinVoIP2

Unfortunately, Server 2 is an old Asterisk 1.4 system.

That command doesn’t exist. I get:

iax2 set debug
jb     off    trunk

I don’t think I can use “trunk” for this.

Usage: iax2 set debug trunk
       Requests current status of IAX trunking

Anyway, I enabled iax2 debug globally and I found this:

VERBOSE[18292] logger.c:     -- Called BRIin:MYPASSWORD@BRIinVoIP2/0123456789
VERBOSE[18889] logger.c: Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
VERBOSE[18889] logger.c:    Timestamp: 00008ms  SCall: 00439  DCall: 00000 [10.215.144.92:4569]
VERBOSE[18889] logger.c:    VERSION         : 2
VERBOSE[18889] logger.c:    CALLED NUMBER   : 0123456789
VERBOSE[18889] logger.c:    CODEC_PREFS     : (alaw|ulaw|gsm)
VERBOSE[18889] logger.c:    CALLING NUMBER  : 0987654321
VERBOSE[18889] logger.c:    CALLING PRESNTN : 0
VERBOSE[18889] logger.c:    CALLING TYPEOFN : 0
VERBOSE[18889] logger.c:    CALLING TRANSIT : 0
VERBOSE[18889] logger.c:    LANGUAGE        : en
VERBOSE[18889] logger.c:    USERNAME        : BRIin
VERBOSE[18889] logger.c:    FORMAT          : 8
VERBOSE[18889] logger.c:    CAPABILITY      : 2097166
VERBOSE[18889] logger.c:    ADSICPE         : 0
VERBOSE[18889] logger.c:    DATE TIME       : 2024-12-13  10:00:38
VERBOSE[18889] logger.c:
VERBOSE[18884] logger.c: Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: (40?)
VERBOSE[18884] logger.c:    Timestamp: 00008ms  SCall: 00001  DCall: 00439 [10.215.144.92:4569]
VERBOSE[18884] logger.c:    Unknown IE 054  : Present
VERBOSE[18884] logger.c:
VERBOSE[18889] logger.c: Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
VERBOSE[18889] logger.c:    Timestamp: 00028ms  SCall: 00439  DCall: 00000 [10.215.144.92:4569]
VERBOSE[18889] logger.c:    VERSION         : 2
VERBOSE[18889] logger.c:    CALLED NUMBER   : 0123456789
VERBOSE[18889] logger.c:    CODEC_PREFS     : (alaw|ulaw|gsm)
VERBOSE[18889] logger.c:    CALLING NUMBER  : 0987654321
VERBOSE[18889] logger.c:    CALLING PRESNTN : 0
VERBOSE[18889] logger.c:    CALLING TYPEOFN : 0
VERBOSE[18889] logger.c:    CALLING TRANSIT : 0
VERBOSE[18889] logger.c:    LANGUAGE        : en
VERBOSE[18889] logger.c:    USERNAME        : BRIin
VERBOSE[18889] logger.c:    FORMAT          : 8
VERBOSE[18889] logger.c:    CAPABILITY      : 2097166
VERBOSE[18889] logger.c:    ADSICPE         : 0
VERBOSE[18889] logger.c:    DATE TIME       : 2024-12-13  10:00:38
VERBOSE[18889] logger.c:    Unknown IE 054  : Present
VERBOSE[18889] logger.c:
VERBOSE[18885] logger.c: Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: AUTHREQ
VERBOSE[18885] logger.c:    Timestamp: 00006ms  SCall: 11897  DCall: 00439 [10.215.144.92:4569]
VERBOSE[18885] logger.c:    AUTHMETHODS     : 2
VERBOSE[18885] logger.c:    CHALLENGE       : 127156196
VERBOSE[18885] logger.c:    USERNAME        : BRIin
VERBOSE[18885] logger.c:
VERBOSE[18889] logger.c: Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: AUTHREP
VERBOSE[18889] logger.c:    Timestamp: 00031ms  SCall: 00439  DCall: 11897 [10.215.144.92:4569]
VERBOSE[18889] logger.c:    MD5 RESULT      : 6e241bc98008cfb0ea329685d632cef7
VERBOSE[18889] logger.c:
VERBOSE[18886] logger.c: Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: ACK
VERBOSE[18886] logger.c:    Timestamp: 00031ms  SCall: 11897  DCall: 00439 [10.215.144.92:4569]
VERBOSE[18881] logger.c: Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: REJECT
VERBOSE[18881] logger.c:    Timestamp: 00009ms  SCall: 11897  DCall: 00439 [10.215.144.92:4569]
VERBOSE[18881] logger.c:    CAUSE           : No authority found
VERBOSE[18881] logger.c:    CAUSE CODE      : 50
VERBOSE[18881] logger.c:
WARNING[18881] chan_iax2.c: Call rejected by 10.215.144.92: No authority found
VERBOSE[18881] logger.c: Tx-Frame Retry[-01] -- OSeqno: 002 ISeqno: 002 Type: IAX     Subclass: ACK
VERBOSE[18881] logger.c:    Timestamp: 00009ms  SCall: 00439  DCall: 11897 [10.215.144.92:4569]
VERBOSE[18292] logger.c:     -- Hungup 'IAX2/BRIinVoIP2-439'
VERBOSE[18292] logger.c:   == Everyone is busy/congested at this time (1:0/0/1)

The No authority found message suggests there’s any one of these:

  1. trunk credential mismatch
  2. type mismatch
  3. “This error also occurs when the context requested in the incoming call is different from one in the section of incoming peer.”

I’m excluding 1) because I set exactly the same username:password credentials on both Server 1 and Server 2.

I’m not sure about the “type” in 2), but I suppose there’s no mismatch there or I wouldn’t see the trunks up and their status as “OK”, right?

As for 3), here’s how I configured each peer:

On Server 1:

[BRIinVoIP2]
deny=all
allow=opus
allow=ulaw
allow=alaw
allow=gsm
allow=vp8
allow=h264
type=friend
host=192.168.136.2
secret=MYPASSWORD
auth=plaintext
requirecalltoken=no
qualify=yes
context=from-BRI
trunk=no
username=BRIin
videosupport=yes

On Server 2:

[BRIinVoIP2]
deny=all
videosupport=yes
username=BRIin
type=friend
trunk=no
secret=MYPASSWORD
requirecalltoken=no
qualify=yes
host=10.215.144.92
context=from-BRI
auth=plaintext
allow=ulaw
allow=alaw
allow=gsm
allow=opus
allow=vp8
allow=h264

At first glance I don’t see anything wrong there…

Any ideas?

[UPDATE]

On Server 1 I finally got to see the right debug messages, and I can confirm that the cause is the same. I still can’t see why though (No authority found)…

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
    Timestamp: 00004ms  SCall: 15425  DCall: 00000 192.168.136.2:4569
    VERSION         : 2
    CALLED NUMBER   : 0123456789
    CODEC_PREFS     : (alaw|ulaw|gsm)
    CALLING NUMBER  : 0987654321
    CALLING PRESNTN : 0
    CALLING TYPEOFN : 0
    CALLING TRANSIT : 0
    LANGUAGE        : en
    USERNAME        : BRIin
    FORMAT          : 8
    CAPABILITY      : 2097166
    ADSICPE         : 0
    DATE TIME       : 2024-12-13  11:11:12

Tx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: CTOKEN
    Timestamp: 00004ms  SCall: 00001  DCall: 15425 192.168.136.2:4569
    CALLTOKEN       : 51 bytes

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
    Timestamp: 00014ms  SCall: 15425  DCall: 00000 192.168.136.2:4569
    VERSION         : 2
    CALLED NUMBER   : 0123456789
    CODEC_PREFS     : (alaw|ulaw|gsm)
    CALLING NUMBER  : 0987654321
    CALLING PRESNTN : 0
    CALLING TYPEOFN : 0
    CALLING TRANSIT : 0
    LANGUAGE        : en
    USERNAME        : BRIin
    FORMAT          : 8
    CAPABILITY      : 2097166
    ADSICPE         : 0
    DATE TIME       : 2024-12-13  11:11:12
    CALLTOKEN       : 51 bytes

Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: AUTHREQ
    Timestamp: 00006ms  SCall: 07943  DCall: 15425 192.168.136.2:4569
    AUTHMETHODS     : 2
    CHALLENGE       : \x37\x32\x37\x38\x34\x36\x33\x33\x31
    USERNAME        : BRIin

Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: AUTHREP
    Timestamp: 00017ms  SCall: 15425  DCall: 07943 192.168.136.2:4569
    MD5 RESULT      : cc5880ed16f2aa3d70cc14ef1a433499

Tx-Frame Retry[-01] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: ACK
    Timestamp: 00017ms  SCall: 07943  DCall: 15425 192.168.136.2:4569
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: REJECT
    Timestamp: 00007ms  SCall: 07943  DCall: 15425 192.168.136.2:4569
    CAUSE           : No authority found
    CAUSE CODE      : 50

It seems that all I needed to do was change the above to:

[BRIinVoIP2]
username=BRIinVoIP2

So the trunk peer’s name must match the username.
Silly misconfiguration.
Sorry for the noise.

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