Thursday 3 March 2011

AQL and Asterisk Freepbx inbound IAX settings

After spending a lot of time trying to get my new freebpx installation working with inbound calls from AQL I thought it best to document my settings for anyone else out there.

IAX2 Trunk settings
Trunk desc : aql
Outbound caller id : {IAX Caller ID provided by AQL}
CID options : Allow Any CID
--Outgoing settings--
Trunk name : aql
PEER Details:
type=peer
auth=md5
username={username provided by AQL}
secret={outbound secret provided by AQL}
host=sip.aql.com
trunk=yes
--Incoming settings--
User context : {username provided by AQL}
type=user
username={username provided by AQL}
auth=md5
host=sip.aql.com
trunk=yes
secret={outbound secret provided by AQL}
context=from-trunk
;qualify=yes
requirecalltoken=no

The requirecalltoken and context bit kept catching me out.

Once I installed the Asterisk Log freepbx module it was blatently obvious what the problem was when I viewed the log.

[Mar 3 10:35:10] ERROR[3338] chan_iax2.c: Call rejected, CallToken Support required. If unexpected, resolve by placing address x.x.x.x in the calltokenoptional list or setting user username requirecalltoken=no


You'll need to setup an inbound route for the numbers you're expecting calls on and then these inbound routes need pointing at extensions or ring groups etc.

My inbound route settings
Description : Name of person
DID Number : {IAX Caller ID provided by AQL}
Set Destination : Select extension

6 comments:

  1. Thank you for this post.
    However, do you have your Outbound working?
    I am having the hardest time getting the outbound calls to work.

    Thank you for any info

    ReplyDelete
  2. I Finally figured it out. aql support forget to give me one of the serveral passwords requred to get this thing up and running. I am including my configuration as below. I hope it is able to help others:

    AQL IAX Trunk on Asterisk with FreePBX:

    INbound Secret: 2......3 (8 digits long?)
    OUTbound Secret: 2......b (8 digits long?) / OUTbound Username: unique (unique length)
    Trunk 44203......1 = Trunk Username: 2....3(6 digits long?) Trunk Password: 1...3 (5 digits long)

    ------------------------------------------
    (User's Extension must not have a caller ID, because it is being passed to aql, which I think is a bug on the version of Asterisk that I am using. You should theoretically be able to Disable the extension's Caller ID pass through with the Trunks "Never Override CallerID" setting)
    ------- Trunk Configuration --------
    Outbound Caller ID:

    -- Outgoing Trunk PEER Details: --
    type=peer
    auth=md5
    host=sip.aql.com
    username=OUTbound Username
    secret=OUTbound Secret
    trunk=yes
    -- USER Context: Trunk Username
    -- USER Details: ---
    type=user
    context=iax-inbound
    auth=md5
    host=sip.aql.com
    username=Trunk Username
    secret=INbound Secret
    trunk=yes
    requirecalltoken=no
    -- Register String: --
    TrunkUsername:TrunkPassword@sip.aql.com/TrunkUsername

    --------- Outbound Routing ----------
    -- Dial Patterns: --
    9|. (This forces us to dial a 9, in order to use the UK line)
    -- then config the Trunk Sequence as you wish.
    ---------- Inbound Routing ------------
    DID Number: Trunk Username
    Set Destination: (set as you wish)

    ReplyDelete
  3. for some reason the Outbound Caller ID setting disapeard abouve, and this is a critical setting:

    Outbound Caller ID: set to the trunk username

    ReplyDelete
  4. Just found this. Very useful.

    Any idea if it's still in date as i'm having issues connecting outgoing on v14.0.1.20 FreePBX

    ReplyDelete
  5. 먹튀사이트 잡는 고릴라의 먹튀검증 통과 메이저토토사이트 안전놀이터 추천 훌륭한 먹튀검증을 통한 안전토토사이트를 추천합니다 고릴라만의 검증 시스템은 특별합니다 전세계적인 먹튀검증을 인전받은 최고의 메이저사이트 추천을 합니다 자세한 내용은 내 웹 사이트를 방문하십시오 토토사이트.

    ReplyDelete
  6. Great article by the great author, it is very massive and informative but still preaches the way to sound like that it has some beautiful thoughts described so I really appreciate this article. Sipviscious hacks Asterisk PBX

    ReplyDelete