Thursday, April 28, 2011

Asterisk Notes

Simple call file contents

Channel: Local@s/default
Callerid: 911
Extension: 12345


Then move the file to /var/spool/asterisk/outgoing (not by copying it) to make a call to default channel.

Creating an extension

[default]
exten => 12345,1,Answer()
exten => 12345,n,Wait(0.5)
exten => 12345,n,AGI(demo)
exten => 12345,n,Hangup()


This will create extension number 12345 at default channel, when dialled it will excecute an AGI file.

Connect to a SIP account

Edit /etc/asterisk/sip.conf and enter the registration information. For this example, I will add SIP server 192.168.1.100 with extension 12345 to be dialled when the extension is called, remember that 12345 must be already defined.

register => username:password@192.168.1.100/12345

SIP server

First create the SIP account, in this example account will use user extension context.

[sip_user]
type=peer
username=sip_user
secret=1234
host=dynamic
context=user


then register it.

register => sip_user:1234@192.168.24.203