I use disallow g729 but still not work…
please can you show me step by step how to setup all this code>>>
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:[email protected]/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