MP Asterisk hook up
One only needs to add the trunk to the asterisk configuration files. In order to do that you will need the hostname of the upstream trunk as well as the username and password and codec. Note: the MP does not include codec G729 so you will need an Asterisk that has IAX or GSM codec support.
Each of the following tasks will be scripted and at some point added to the management gui interface. The scripts are required to configure multiple Mesh Potatoes (MPs) as a batch. Without the scripts each MP must be configured independently.
Configure the routing on the MP to use an Internet gateway
Elektra to help here please... the following will instruct the MP to get it's routes from a dhcp server
ip r (to see routing table) udhcpc -i eth0
Note: it is important to know if you will have a fully routed global IP of if you are behind a NAT. If behind a NAT make sure the correct port forwarding has been setup.
Configure an IAX2 connection
- Note: IAX2 is currently not working on the MP but we expect this will work best when behind a NAT and/or firewall
1. Setup registration in /etc/asterisk/iax.conf (this will enable inbound calls)
register => username:secretpassword@server.dabba.net
To enable inbound calls to ring on the MP phone edit /etc/asterisk/extensions.conf so
exten => s,1,Dial(MP/1)
- this will be set to default
2. Setup outbound calls via dialplan in /etc/asterisk/extensions.conf (in the following example when you dial 4006, the MP will connect to the upstream server ct1.dabba.net with user: user and password:password and then dial ext 111 on that server)
exten => 4006,1,Dial(IAX2/user:password@ct1.dabba.net/111)
When the above is completed don't forget to:
iax2 reload
and:
dialplan reload
to test that the IAX connection is registered you can use the following checks
show iax2 registry show dialplan
Configure a SIP connection
this may not work well behind a firewall or NAT connection
Create/edit the 'ast' route:
Edit the /etc/asterisk/extensions.conf file (using vi editor)
Find [default] configurations (/[default in vi)
Add/edit the line with ast in the brackets so you have one:
exten => 4003,1,Dial(SIP/ast/10)
Add the SIP login details:
Edit the /etc/asterisk/sip.conf file (using vi editor)
Find ast (/ast in vi) and setup the server host, username and password and codec (in the following example username=mp1 pw=mp server host: 196.35.197.196 and codec=gsm)
[ast] type=peer username=mp1 fromuser=ast secret=mp context=default disallow=all qualify=500 dtmfmode=rfc2833 callerid=server canreinvite=no host=196.35.197.196 allow=gsm
Once that is done go to asterisk console and type:
dialplan reload
Notes:
- Ensure the Asterisk gateway has required codecs
- show dialplan default
- dialplan reload
- sip debug (to turn off sip set debug off)
- sip show peers
- show dialplan default