Asterisk configuration examples

extensions.conf:

[from-didww]
exten => _X.,1,Ringing
exten => _X.,n,Answer
exten => _X.,n,Echo
exten => _X.,n,Wait(600)
exten => _X.,n,Hangup

SIP

sip.conf:

[didww-us]
host=46.19.209.14
dtmfmode=rfc2833
dtmf=rfc2833
type=peer
context=from-didww
insecure=very
nat=never
allow=all

[didww-eu]
host=46.19.210.14
dtmfmode=rfc2833
dtmf=rfc2833
type=peer
context=from-didww
insecure=very
nat=never
allow=all

IAX

iax.conf:

[didww-iax-us]
type=user
permit=46.19.209.42
context=from-didww

[didww-iax-eu]
type=user
permit=46.19.210.42
context=from-didww

Note

If asterisk will not be able to find extension within given context you will get an unhelpful No such context/extension IAX2 debug error. Thus, it’s better to use catch-all extension pattern _X. during debugging

You can find detailed explanation of asterisk IAX authentication here.