Upgrade 3CX to v18 and get it hosted free!

Asterisk sip client SER

Author image

Connecting from Asterisk over NAT to IPtel.org

Jan Janak of iptel.org writes:


I am using [email protected], all the SIP traffic will be sent to iptel.org proxy and the proxy will take care of NAT traversal. Currently I forward all numbers begining with 3 to iptel.org beucase I don’t know how to create “fall-back” rule that will match when there are no other rules (neither i nor _. works for me).

In the other direction, calls to [email protected] get translated to jan@my_asterisk_box and user jan registered at the asterisk box will receive them.

To able able to call anywhere through iptel.org, From header field must contain iptel.org so fromdomain parameter is necesarry in [iptel] section.

Testing scenario was as follows:

[Caller]—-[*]—[NAT]—-[iptel.org (public inet)]—-[NAT]—[Callee]

and vice versa.

sip.conf and extensions.conf follow. I have no previous experience in configuriing asterisk so maybe the config files are not the best ones, I simply took John Todd’s config files and tweaked them a bit, it seems to work for me.

To iptel.org proxy asterisk looks like a normal SIP user agent behind NAT. iptel.org is running SER with extended nathelper and RTP proxy.

sip.conf

;
; SIP Configuration for Asterisk
;
[general]
port = 5060 ; Port to bind to
bindaddr = 0.0.0.0 ; Address to bind to
context = from-sip ; Default for incoming calls
;
register => asterisk:[email protected]/jan ; Register with a SIP provider

[iptel]
type=friend
username=asterisk
secret=password
fromdomain=iptel.org
host=iptel.org

[jan]
type=friend
username=jan
host=dynamic
canreinvite=no

extensions.conf:

[from-sip]
exten => jan,1,Dial(SIP/jan)
exten => jan,2,Hangup
exten => _3.,1,SetCallerID(jan)
exten => _3.,2,SetCIDName(Jan Janak)
exten => _3.,3,Dial(SIP/${EXTEN:1}@iptel)
exten => _3.,4,Playback(invalid)
exten => _3.,5,Hangup



Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.