Asterisk configuration

To configure your Asterisk server, check the below mentioned configuration files and its code(these files are common to all service providers), and make changes if necessary.

Extension.conf

Add the below mentioned line in your Extension.conf file.

[default]
exten => 2000,1,Dial(SIP/2000)
exten => 2000,n,Hangup()
[from-internal]
exten => _[0-9].,1,NoOp(#### [from-internal] ####)
exten => _[0-9].,n,Agi(agi://192.168.1.79/incoming.agi)
exten => _[0-9].,n,Hangup()
[from-external]
exten => _[0-9].,1,NoOp(#### [from-external] ####)
exten => _[0-9].,n,Agi(agi://192.168.1.79/incoming.agi)
exten => _[0-9].,n,Hangup()

Cdr_manager.conf

In this configuration file, check whether the enabled value is mentioned as no, if not change it to no.

[general]
enabled = no

Http.conf

Check the binary address field value. You can either use your Asterisk Address or 127.0.0.1

Manager.conf

Check the Manager.conf whether all the values are correct as mentioned below.

[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
[asterisk]
secret=smackcoders
deny=0.0.0.0/0.0.0.0
permit=ServerIP/255.255.255.0
read=all,system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
write=all,system,call,agent,user,config,command,reporting,originate,message

Sip.conf

This configuration file may vary based on different Asterisk Service Providers. Below weve listed a sample Sip.conf file for Gotrunk. Configure this based on your own Service Provider.

[general]
allowguest=yes
context=default
bindport=5060
udpenable=yes
tcpenable=yes
trunkname=asterisk
preferred_codec_only=yes
dtmfmode=rfc2833
autofallthrough=yes
disallow=all
allow=alaw
allow=ulaw
localnet=192.168.1.3/255.255.255.0
externaddr=192.168.1.3
rtcachefriends=yes
register => 46181:[email protected]

[trunk]
type=peer
host=amn.st.ssl7.net
context=from-trunk
qualify=yes
defaultuser=46181
remotesecret=yk$xS78Y

[1000]
type=friend
host=dynamic
context=from-internal
username=admin
dtmfmode=inband
call-limit=1
busylevel=1
password=smackcoders
qualify=yes
nat=force_rport,comedia

[2000]
type=friend
host=dynamic
context=from-external
username=admin
dtmfmode=inband
password=smackcoders
qualify=yes
nat=force_rport,comedia
call-limit=1
busylevel=1

[3000]
type=friend
host=dynamic
context=from-external
username=admin
dtmfmode=inband
password=smackcoders
qualify=yes
call-limit=1
busylevel=1
nat=force_rport,comedia