Eg, Thank you very much, We have done it. I try it so many time and even, I format the server and started everything new.. But finally, Is done but it has left one problem, extension to extension work fine but If I can my sip provider number, it ring but if i pick up, I can hear from the mobile and the mobile can not hear from me.
My ip trunk is online and its Registered. This is the information provider gave to me:
This configuration example assumes that your Asterisk server is on a private IP address behind NAT. If your Asterisk is behind NAT it must be setup to work behind NAT, i.e it should send it's private IP address in the contact field. This way the mydivert.com server knows that the respective peer is behind NAT and it can send back the packet properly.
With this configuration, Asterisk uses the address defined by externip for all calls to the peers configured with nat=yes. The addition of qualify=yes causes Asterisk to test the connection frequently so that the NAT translations are not removed from the firewall. With these two commands, there always will be a communications channel between Asterisk and the peer, and Asterisk will use the outside address when sending SIP messages.
To configure Asterisk with mydivert.com please make the following replacements in the sip.conf and extensions.conf examples given below:
SIPUSERNAME = Your SIP account username
SIPPASSWORD = Your SIP account password
LOCAL-IP = Your asterisk LOCAL IP address (example: 192.168.1.0/255.255.255.0)
PUBLIC-IP = Your PUBLIC IP address (example: 200.43.215.194)
The configuration for Asterisk (sip.conf) should look very simlar to this :
[general]
context = default
disallow = all
allow = ulaw
allow = alaw
maxexpiry = 120
defaultexpiry = 90
allow = g729 ;a license from digium will be required if transcoding g729 to other codecs, else disallow g729
trustrpid = yes
sendrpid = yes
nat = yes
bindport = 5060
externip = PUBLIC-IP
localnet = LOCAL-IP
useragent = Asterisk
register => SIPUSERNAME:SIPPASSWORD@sip.mydivert.com/SIPUSERNAME
[mydivert]
fromuser = SIPUSERNAME
username = SIPUSERNAME
authuser = SIPUSERNAME
secret = SIPPASSWORD
insecure = port,invite
dtmf = rfc2833
disallow = all
allow = g729
allow = ulaw
allow = alaw
type = friend
host = sip.mydivert.com
nat = yes
;force keep-alives with qualify=yes
qualify = yes
;here we state the context for incoming calls on the mydivert.com channel. we need to set this up also in extensions.conf
context = from-mydivert
;this could be your extension - your voip phone using mydivert.com
;[8000]
;insecure = no
;canreinvite = no
;regexten = 8000
;dtmf= rfc2833
;context = sip-phone
;host= dynamic
;type= friend
;username = 8000
;secret = 1234
;nat= yes
;qualify = yes
In extensions.conf you need to setup the context and routing. It would look something like this:
[general]
autofallthrough=yes
[globals]
[default]
[from-mydivert]
;this is the context we need to setup to receive incoming calls
;first is the default extension that calls arrive on.
exten => SIPUSERNAME,1,Answer
exten => SIPUSERNAME,2,Dial(SIP/8000)
exten => SIPUSERNAME,3,Hangup
;if you have SIP trunking enabled for your account calls will arrive with DID invites.
;You then add each DID in this context with routing. example DID number 15166179421
;exten => 15166179421,1,Answer
;exten => 15166179421,2,Dial(SIP/8000)
;exten => 15166179421,3,Hangup
;this is the context of your extension voip phone dialing into asterisk and placing an outgoing call
;[sip-phone]
;exten => _X.,1,Answer
;if you have caller-id 'set by equipment' enabled you can set the CID for the outgoing call via the mydivert.com trunk.
;If not, then the mydivert.com server will set CID for you.
;exten => _X.,2,Set(CALLERID(name)=15166179421)
;exten => _X.,3,Set(CALLERID(num)=15166179421)
;exten => _X.,4,Dial(SIP/${EXTEN}@mydivert,30,Tt)
;exten => _X.,5,Hangup
and I have done with this code:
register => SIPUSERNAME:SIPPASSWORD@sip.mydivert.com/SIPUSERNAME
[mydivert]
fromuser = SIPUSERNAME
username = SIPUSERNAME
authuser = SIPUSERNAME
secret = SIPPASSWORD
insecure = port,invite
dtmf = rfc2833
disallow = all
allow = g729
allow = ulaw
allow = alaw
type = friend
host = sip.mydivert.com
nat = yes
;force keep-alives with qualify=yes
qualify = yes
;here we state the context for incoming calls on the mydivert.com channel. we need to set this up also in extensions.conf
context = from-mydivert
Someone should help me. Thanks
Roakus