Inter Asterisk Calling


I have two asteriks servers configured and working. One is at the office, whilst the other is at home.

The Office box has a static IP, whereby the Home machine has a dynamic IP.

The Home machine’s IAX.conf is as follows:-

type = friend
auth = md5
host =
trunk = yes
secret = secret
context = incoming_OFFICE

Whereby the Office machine’s IAX.conf is as follows:-
register => OFFICE:secret@

type = friend
auth = md5
host = dynamic
trunk = yes
secret = secret
context = incoming_HOME

No problem with registration between the Asterisk servers.

To enable dialing from the OFFICE to HOME is done simply by creating a context within extensions.conf such as:-

exten => _2X.,1,Dial(IAX2/HOME/${EXTEN:1})
exten => _2X.,n,Hangup()

Dialing from HOME to the OFFICE would be:-

exten => _1X.,1,Dial(IAX2/OFFICE/${EXTEN:1})
exten => _1X.,n,Hangup

This works fine, yet we prefer using “FQDN names”, such as

And this is where my issue starts…

DNS service records has been created.

When at home, I can phone John on either of the following ways:-

1.) John
2.) John@

However, should I wish to phone John from the office, I need to call

4.) 1John

(Pattern matching being applied to route the call to the HOME server)

I’ve created a [Home] context at the Office machine’s extensions.conf:-

exten => _.,1,Verbose(1|Transfer to Home)
exten => _.,n,Dial(IAX2/HOME/${EXTEN}@Home)
exten => _.,n,Hangup()

with basically the same config at the OFFICE machine.

Doing a “console dial” from the Home machine, creates the following at the Office machine’s CLI:-

[Nov 19 17:56:31] NOTICE[19774]: chan_iax2.c:7613 socket_process: Rejected connect attempt from, who was trying to reach '
[Nov 19 17:56:32] NOTICE[19778]: chan_iax2.c:7613 socket_process: Rejected connect attempt from, who was trying to reach '

A call from a soft client, results in nothing at either side, till the softclient times out…

We wish to phone users as "" with a fallback to an extension number. (Say when a PSTN caller, wished to contact John)

Is this possible with Asterisk?

Can anyone please shed some light on how to accomplish this ? or point me in the right direction… ? if possible.

Thanks in advance

I believe I might clear a bit of my own “understanding” of my previous post … :blush:

The DNS service records is merely to “locate” an asterisk server within a domain. Thereby allowing one to take a machine off-line, for say maintenance, whilst another can take over. Thus allowing users to still register with an asterisk server.

Yet, to allow the dialing of other domain’s users via "", would this also be accomplished via pattern matching with contexts or is there a “better” way of doing this via asterisk ? (Does asterisk do any type of DNS resolution WITHIN it’s dialplan?)

Also, is it “bad practice” to reach the same extension in the dialplan via a numeric reference ( 1 800 555 8520) as well as a character reference (i.e. (Or would this only be possible with two seperate extensions?)

Please correct me in my thinking and any advice would be appreciated !