IAX Trunking of 2 Servers

Alright, here’s what I’ve got going.

I am working on setting up Asterisk as the main phone system for my company. This will involve a lot of work, but right now I’m trying to get 2 servers talking to each other. I’ve accomplished this somewhat but need a little guidance.

I have Asterisk installed on top of CentOS with everything working. I can make a call inside of each server, asterisk01 and asterisk02, and even have an IAX trunk up and working between them and can make calls. I do have 2 questions though.

  1. The status of the trunks shows ‘Rejected’ on both sides. Why?
    I have the iax.conf configured on both sides with the user information.
  2. How can I get caller id to pass through the trunk? Right now the name comes across as anonymous@anonymous.invalid.
    Can this get changed?

If anyone can help me I would greatly appreciate this.


If these are both your servers then you should be using "switch " statement and not exten =>

switch: A switch statement allows an Asterisk server to search for extensions outside of the local dialplan. The only currently implemented use is the IAX switch, though other uses of this feature are planned. The IAX switch uses the IAX protocol to find extensions on a remote dialplan and connect them. If a caller dials an extension that is not accesable in the local dialplan, and a switch statement is present in the callers present context, the extension will be tried against the remote server or servers specified. The switch statement includes as an argument a context, which will be the context within the remote dialplan that will be searched. Page 4 Examples To look for a remote extension using the IAX protocol: switch => IAX/username:password@server/context Alternately, if RSA is turned on (see iax.conf) you may replace the password with a keyname, which will be the key sent to the remote server. switch => IAX/username:[password]@server/context Complete File Example The following is a complete short example of an /etc/asterisk/extensions.conf file: [provider] switch => IAX/bob:passme@misery/local [default] exten => 6161,1,Dial,IAX/suid|20 exten => 6161,2,Voicemail,u6161 exten => 6161,102,Voicemail,b6161 exten => 8500,1,VoicemailMain [local] include => provider include => default [incoming] include => default exten => s,1,Playback,welcome exten => s,2,Background,Menu exten => 1,1,Goto,default|6161|1 exten => 2,1,Goto,default|6161|2 exten => t,1,Goto,s|2 exten => i,1,Goto,s|2 exten => o,1,Goto,default|6161|1

Thank you for the information, I think this is what I am looking for, though I do have a question.

Will I have to setup each user and extension in the file or can I add the full extension group?
Right now it’s setup like this…

The main server extensions are in the _4XXX range.
The second server extensions are in the _5XXX range.
When I add other servers they will be in the _6XXX and _7XXX ranges.

Can I just setup the servers to allow the ranges in and not have to setup each extension? From the code that you gave it looks like each extension will have to be setup, of couse I could be reading it wrong, this is still all new to me.

Thanks again!

Hi was this solve? Im having problem also in the callerid via iax trunking…