1. I have uninstalled asterisk and installed again with yum and cleaned up code of the configuration files.
2. Followed the procedure on this page, but installed version 1.8
http://www.asterisk.org/downloads/yum3. Created the repositories and installed with yum
- Code: Select all
yum update
yum install asterisk18 asterisk18-configs asterisk18-voicemail libpri
4. extensions.conf
- Code: Select all
; extensions.conf - the Asterisk dial plan
;
[general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
CONSOLE=Console/dsp ; Console interface for demo
;CONSOLE=DAHDI/1
;CONSOLE=Phone/phone0
IAXINFO=guest ; IAXtel username/password
;IAXINFO=myuser:mypass
TRUNK=DAHDI/G2 ; Trunk interface
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)[default]
include => localphone-in
[localphone-in]
exten => 2300541,1,AGI(call.php)
exten => 2300541,2,Dial(SIP/sipphone,60,tr) ; phone must be registered
exten => 2300541,3,Hangup
6. sip.conf
- Code: Select all
[general]
port = 5060
bindaddr = 0.0.0.0
qualify = no
disable = all
allow = alaw
allow = ulaw
dtmfmode = rfc2833
srvlookup = yes
register => 2300541:PASSWORD@localphone.com/2300541
context=default ; Default context for incoming calls
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
tcpenable=no ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
;tlsenable=no ; Enable server for incoming TLS (secure) connections (default is no)
;tlsbindaddr=0.0.0.0 ; IP address for TLS server to bind to (0.0.0.0) binds to all interfaces)
; Optionally add a port number, 192.168.1.1:5063 (default is port 5061)
; Remember that the IP address must match the common name (hostname) in the
; certificate, so you don't want to bind a TLS socket to multiple IP addresses.
; For details how to construct a certificate for SIP see
; http://tools.ietf.org/html/draft-ietf-sip-domain-certs
[localphone]
type = friend
insecure = very
;nat = no
canreinvite = no
authuser = 2300541
username = 2300541
fromuser = 2300541
fromdomain = localphone.com
secret = PASSWORD
host = localphone.com
dtmfmode = rfc2833
context = localphone-in ; extensions.conf context for inbound calls
disallow = all
allow = ulaw
allow = alaw
qualify = yes
nat = yes
7. Changed permissions to 755 on the directory and files in /var/lib/asterisk/agi-bin
8. Changed group and user to asterisk on the directory and files in /var/lib/asterisk/agi-bin
9. Tried su asterisk and ran the PHP script without any problem.
10. Calling to the phone in the format +351 123123123, I can see the incoming calls in the Asterisk console.
11. I still can't see any log from AGI, I dont know how to execute them... I will copy/paste full console logs later.
How can I simulate the execution of an AGI script from the Asterisk console?