robx
May 7, 2008, 10:44am
#1
Hi i need help figuring out why my phpAGI dialplan is not working, I will provide you debug details and server info. Thanks in advance.
AGI DEBUG:
Launched AGI Script /var/lib/asterisk/agi-bin/lotwagi.php
AGI Tx >> agi_request: lotwagi.php
AGI Tx >> agi_channel: SIP/*****-006b0f80
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1210156921.24
AGI Tx >> agi_callerid: 5034308619
AGI Tx >> agi_calleridname: 5034308619
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 9713279797
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: inbound
AGI Tx >> agi_extension: ******
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >> exit
AGI Rx << Extension '/var/lib/asterisk/agi-bin/lotwagi.php' not present.
AGI Tx >> 510 Invalid or unknown command
-- AGI Script lotwagi.php completed, returning 0
Im running PHP 5.2.5, Mysql 5 and asterisk 1.4.18.1
mbruni
May 7, 2008, 11:03am
#2
AGI Rx << Extension '/var/lib/asterisk/agi-bin/lotwagi.php' not present.
AGI Tx >> 510 Invalid or unknown command
Here is the problem, please post the relevant extensions.conf context if you want help.
Cheers.
Marco Bruni
robx
May 8, 2008, 4:36am
#3
heres my extensions.conf
[code][outbound]
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@vitel-outbound )
exten => _011.,2,Dial(SIP/${EXTEN}@vitel-outbound )
; e911 must be enabled. see DIDs > NPANXXNXXX > Action > e911
exten => _911,3,Dial(SIP/911@vitel-outbound)
[inbound]
exten => 9713279797,1,AGI(lotwagi.php)
exten => 9713279797,n,Hangup
[/code]
Extensions.conf seems ok, please post lotwagi.php.
Cheers.
Marco Bruni
robx
May 8, 2008, 8:38am
#5
heres my script and im sure theres no syntax error cause i have use it in the previous asterisk server.
mbruni
May 8, 2008, 10:23am
#6
Ok, so if the script worked before the problem isn’t in the script.
Which are the differences between this server and the others ? Php version ? Asterisk version ?
Cheers.
Marco Bruni
robx
May 9, 2008, 4:18am
#7
Yea, in the previous server its using PHP4 and asterisk 1.4.18.1. My initial suspect is the shebang line at the top of my script is not correct, this one.
#!/usr/local/bin/php -q
robx
May 9, 2008, 5:13am
#8
Its FIXED!!. the problem is in the shebang line and some sort of php warning that cant read by asterisk so I added error_reporting(0) in the code and it works. Thanks mbruni for helping me out .