I'm trying to setup a test scenario that will run every 10 minutes and call from our asterisk server to one of our outside lines and play a series of dtmf tones to verify that we have good enough line quality for the dtmf tones to be made out.
I've been told that AGI is probably going to be the best way to do this, so I've been reading a bit and stumbled onto PHPAGI, I also downloaded the samples and found dtmf.php in there and thought I struck gold. I've created a batch file for one of our other tests and modified it a bit to have it try to run the dtmf.php AGI script.
The commented last 3 commented lines are for testing purposes only and just print whether the call was successful, failed, or expired. When I go to run this script the call is successful it calls 1234567890 but it immediately hangs up. I opened a second window and watched the asterisk CLI as I ran the script and notice that it's giving me this error and ending the call prematurely.
I thought maybe it was a permissions thing, ran chown asterisk:asterisk no luck, even tried chmod 777 /var/lib/asterisk/agi-bin/dtmf.php but no improvement, I just can't seem to figure out why it wont work and would greatly appreciate anyone who might have some advice on what else could possibly be causing the problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
#!/usr/local/bin/php -q<?phpset_time_limit(30);require('phpagi.php');error_reporting(E_ALL);$agi=newAGI();$agi->answer();$cid=$agi->parse_callerid();$agi->text2wav("Hello, {$cid['name']}.");do{$agi->text2wav('Enter some numbers and then press the pound key. Press 1 1 1 followed by the pound key to quit.');$result=$agi->get_data('beep',3000,20);$keys=$result['result'];$agi->text2wav("You entered $keys");}while($keys!='111');$agi->text2wav('Goodbye');$agi->hangup();?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
== Parsing '/etc/asterisk/asterisk.conf': == Found
Connected to Asterisk 1.8.4.3 currently running on allison2 (pid = 4479)
Verbosity is at least 19
-- Attempting call on Local/1234567890@from-internal for application AGI(hello-world.agi) (Retry 1)
-- Executing [1234567890@from-internal:1] Macro("Local/1234567890@from-internal-f638;2", "user-callerid,LIMIT,") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/1234567890@from-internal-f638;2", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("Local/1234567890@from-internal-f638;2", "1?report") in new stack
-- Goto (macro-user-callerid,s,12)
-- Executing [s@macro-user-callerid:12] GotoIf("Local/1234567890@from-internal-f638;2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,25)
-- Executing [s@macro-user-callerid:25] Set("Local/1234567890@from-internal-f638;2", "CALLERID(number)=") in new stack
-- Executing [s@macro-user-callerid:26] Set("Local/1234567890@from-internal-f638;2", "CALLERID(name)=") in new stack
-- Executing [s@macro-user-callerid:27] Set("Local/1234567890@from-internal-f638;2", "CHANNEL(language)=en") in new stack
-- Executing [1234567890@from-internal:2] Set("Local/1234567890@from-internal-f638;2", "MOHCLASS=default") in new stack
-- Executing [1234567890@from-internal:3] Set("Local/1234567890@from-internal-f638;2", "_NODEST=") in new stack
-- Executing [1234567890@from-internal:4] Macro("Local/1234567890@from-internal-f638;2", "record-enable,,OUT,") in new stack
-- Executing [s@macro-record-enable:1] MacroExit("Local/1234567890@from-internal-f638;2", "") in new stack
-- Executing [1234567890@from-internal:5] Macro("Local/1234567890@from-internal-f638;2", "dialout-trunk,1,1234567890,") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("Local/1234567890@from-internal-f638;2", "DIAL_TRUNK=1") in new stack
-- Executing [s@macro-dialout-trunk:2] GosubIf("Local/1234567890@from-internal-f638;2", "0?sub-pincheck,s,1") in new stack
-- Executing [s@macro-dialout-trunk:3] GotoIf("Local/1234567890@from-internal-f638;2", "0?disabletrunk,1") in new stack
-- Executing [s@macro-dialout-trunk:4] Set("Local/1234567890@from-internal-f638;2", "DIAL_NUMBER=1234567890") in new stack
-- Executing [s@macro-dialout-trunk:5] Set("Local/1234567890@from-internal-f638;2", "DIAL_TRUNK_OPTIONS=trx") in new stack
-- Executing [s@macro-dialout-trunk:6] Set("Local/1234567890@from-internal-f638;2", "OUTBOUND_GROUP=OUT_1") in new stack
-- Executing [s@macro-dialout-trunk:7] GotoIf("Local/1234567890@from-internal-f638;2", "1?nomax") in new stack
-- Goto (macro-dialout-trunk,s,9)
-- Executing [s@macro-dialout-trunk:9] GotoIf("Local/1234567890@from-internal-f638;2", "0?skipoutcid") in new stack
-- Executing [s@macro-dialout-trunk:10] Set("Local/1234567890@from-internal-f638;2", "DIAL_TRUNK_OPTIONS=x") in new stack
-- Executing [s@macro-dialout-trunk:11] Macro("Local/1234567890@from-internal-f638;2", "outbound-callerid,1") in new stack
-- Executing [s@macro-outbound-callerid:1] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(CALLERPRES()=)") in new stack
-- Executing [s@macro-outbound-callerid:2] ExecIf("Local/1234567890@from-internal-f638;2", "1?Set(REALCALLERIDNUM=)") in new stack
-- Executing [s@macro-outbound-callerid:3] GotoIf("Local/1234567890@from-internal-f638;2", "1?normcid") in new stack
-- Goto (macro-outbound-callerid,s,6)
-- Executing [s@macro-outbound-callerid:6] Set("Local/1234567890@from-internal-f638;2", "USEROUTCID=") in new stack
-- Executing [s@macro-outbound-callerid:7] Set("Local/1234567890@from-internal-f638;2", "EMERGENCYCID=") in new stack
-- Executing [s@macro-outbound-callerid:8] Set("Local/1234567890@from-internal-f638;2", "TRUNKOUTCID=<3102167575>") in new stack
-- Executing [s@macro-outbound-callerid:9] GotoIf("Local/1234567890@from-internal-f638;2", "1?trunkcid") in new stack
-- Goto (macro-outbound-callerid,s,12)
-- Executing [s@macro-outbound-callerid:12] ExecIf("Local/1234567890@from-internal-f638;2", "1?Set(CALLERID(all)=<3102167575>)") in new stack
-- Executing [s@macro-outbound-callerid:13] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(CALLERID(all)=)") in new stack
-- Executing [s@macro-outbound-callerid:14] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(CALLERID(all)=)") in new stack
-- Executing [s@macro-outbound-callerid:15] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
-- Executing [s@macro-dialout-trunk:12] GosubIf("Local/1234567890@from-internal-f638;2", "1?sub-flp-1,s,1") in new stack
-- Executing [s@sub-flp-1:1] ExecIf("Local/1234567890@from-internal-f638;2", "1?Set(TARGET_FLP_1=11234567890)") in new stack
-- Executing [s@sub-flp-1:2] GotoIf("Local/1234567890@from-internal-f638;2", "1?match") in new stack
-- Goto (sub-flp-1,s,6)
-- Executing [s@sub-flp-1:6] Set("Local/1234567890@from-internal-f638;2", "DIAL_NUMBER=11234567890") in new stack
-- Executing [s@sub-flp-1:7] Return("Local/1234567890@from-internal-f638;2", "") in new stack
-- Executing [s@macro-dialout-trunk:13] Set("Local/1234567890@from-internal-f638;2", "OUTNUM=+11234567890") in new stack
-- Executing [s@macro-dialout-trunk:14] Set("Local/1234567890@from-internal-f638;2", "custom=SIP/BW-SIP-A") in new stack
-- Executing [s@macro-dialout-trunk:15] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)x)") in new stack
-- Executing [s@macro-dialout-trunk:16] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(DIAL_TRUNK_OPTIONS=xM(confirm))") in new stack
-- Executing [s@macro-dialout-trunk:17] Macro("Local/1234567890@from-internal-f638;2", "dialout-trunk-predial-hook,") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("Local/1234567890@from-internal-f638;2", "") in new stack
-- Executing [s@macro-dialout-trunk:18] GotoIf("Local/1234567890@from-internal-f638;2", "0?bypass,1") in new stack
-- Executing [s@macro-dialout-trunk:19] GotoIf("Local/1234567890@from-internal-f638;2", "0?customtrunk") in new stack
-- Executing [s@macro-dialout-trunk:20] Dial("Local/1234567890@from-internal-f638;2", "SIP/BW-SIP-A/+11234567890,300,x") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called BW-SIP-A/+11234567890
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- SIP/BW-SIP-A-0001ed1c is making progress passing it to Local/1234567890@from-internal-f638;2
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- SIP/BW-SIP-A-0001ed1c answered Local/1234567890@from-internal-f638;2
> Channel Local/1234567890@from-internal-f638;1 was answered.
> Launching AGI(hello-world.agi) on Local/1234567890@from-internal-f638;1
-- Launched AGI Script /var/lib/asterisk/agi-bin/hello-world.agi
hello-world.agi: Failed to execute '/var/lib/asterisk/agi-bin/hello-world.agi': No such file or directory
-- Executing [h@macro-dialout-trunk:1] Macro("Local/1234567890@from-internal-f638;2", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("Local/1234567890@from-internal-f638;2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] Hangup("Local/1234567890@from-internal-f638;2", "") in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on 'Local/1234567890@from-internal-f638;2' in macro 'hangupcall'
== Spawn extension (macro-dialout-trunk, s, 20) exited non-zero on 'Local/1234567890@from-internal-f638;2' in macro 'dialout-trunk'
== Spawn extension (from-internal, 1234567890, 5) exited non-zero on 'Local/1234567890@from-internal-f638;2'
That's the output from the CLI and as for the AGI debug I'm not very familiar with it and will guess that it's probably not enabled, but if you could briefly outline it or point me in the right direction I'd appreciate it. In the meantime though I'll see what I can find on voip-info.org and a few other sites to figure out as much as I can.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had another hello-world.agi that I tried as well, having the same problem with it.
1 2 3 4 5 6 7 8 910
#!/usr/local/bin/php -q<?phpset_time_limit(0);require('phpagi.php');$agi=newAGI();$agi->answer();// Play the tt-monkeys file from /var/lib/asterisk/sounds$agi->stream_file('tt-monkeys');$agi->hangup();?>
core set a, ag, tab tab results in nothing
and core set agi debug
No such command 'core set agi debug' (type 'core show help core set agi debug' for other possible commands)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
[root@hostname ~]# asterisk -rvvvv
Asterisk 1.8.4.3, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
== Parsing '/etc/asterisk/asterisk.conf': == Found
Connected to Asterisk 1.8.4.3 currently running on hostname (pid = 4479)
Verbosity is at least 19
== Manager 'admin' logged off from 127.0.0.1
hostnameCLI> agi set debug on
AGI Debugging Enabled
-- Attempting call on Local/1234567890@from-internal for application AGI(dtmf.php) (Retry 1)
-- Executing [1234567890@from-internal:1] Macro("Local/1234567890@from-internal-b861;2", "user-callerid,LIMIT,") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/1234567890@from-internal-b861;2", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("Local/1234567890@from-internal-b861;2", "1?report") in new stack
-- Goto (macro-user-callerid,s,12)
-- Executing [s@macro-user-callerid:12] GotoIf("Local/1234567890@from-internal-b861;2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,25)
-- Executing [s@macro-user-callerid:25] Set("Local/1234567890@from-internal-b861;2", "CALLERID(number)=") in new stack
-- Executing [s@macro-user-callerid:26] Set("Local/1234567890@from-internal-b861;2", "CALLERID(name)=") in new stack
-- Executing [s@macro-user-callerid:27] Set("Local/1234567890@from-internal-b861;2", "CHANNEL(language)=en") in new stack
-- Executing [1234567890@from-internal:2] Set("Local/1234567890@from-internal-b861;2", "MOHCLASS=default") in new stack
-- Executing [1234567890@from-internal:3] Set("Local/1234567890@from-internal-b861;2", "_NODEST=") in new stack
-- Executing [1234567890@from-internal:4] Macro("Local/1234567890@from-internal-b861;2", "record-enable,,OUT,") in new stack
-- Executing [s@macro-record-enable:1] MacroExit("Local/1234567890@from-internal-b861;2", "") in new stack
-- Executing [1234567890@from-internal:5] Macro("Local/1234567890@from-internal-b861;2", "dialout-trunk,1,1234567890,") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("Local/1234567890@from-internal-b861;2", "DIAL_TRUNK=1") in new stack
-- Executing [s@macro-dialout-trunk:2] GosubIf("Local/1234567890@from-internal-b861;2", "0?sub-pincheck,s,1") in new stack
-- Executing [s@macro-dialout-trunk:3] GotoIf("Local/1234567890@from-internal-b861;2", "0?disabletrunk,1") in new stack
-- Executing [s@macro-dialout-trunk:4] Set("Local/1234567890@from-internal-b861;2", "DIAL_NUMBER=1234567890") in new stack
-- Executing [s@macro-dialout-trunk:5] Set("Local/1234567890@from-internal-b861;2", "DIAL_TRUNK_OPTIONS=trx") in new stack
-- Executing [s@macro-dialout-trunk:6] Set("Local/1234567890@from-internal-b861;2", "OUTBOUND_GROUP=OUT_1") in new stack
-- Executing [s@macro-dialout-trunk:7] GotoIf("Local/1234567890@from-internal-b861;2", "1?nomax") in new stack
-- Goto (macro-dialout-trunk,s,9)
-- Executing [s@macro-dialout-trunk:9] GotoIf("Local/1234567890@from-internal-b861;2", "0?skipoutcid") in new stack
-- Executing [s@macro-dialout-trunk:10] Set("Local/1234567890@from-internal-b861;2", "DIAL_TRUNK_OPTIONS=x") in new stack
-- Executing [s@macro-dialout-trunk:11] Macro("Local/1234567890@from-internal-b861;2", "outbound-callerid,1") in new stack
-- Executing [s@macro-outbound-callerid:1] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(CALLERPRES()=)") in new stack
-- Executing [s@macro-outbound-callerid:2] ExecIf("Local/1234567890@from-internal-b861;2", "1?Set(REALCALLERIDNUM=)") in new stack
-- Executing [s@macro-outbound-callerid:3] GotoIf("Local/1234567890@from-internal-b861;2", "1?normcid") in new stack
-- Goto (macro-outbound-callerid,s,6)
-- Executing [s@macro-outbound-callerid:6] Set("Local/1234567890@from-internal-b861;2", "USEROUTCID=") in new stack
-- Executing [s@macro-outbound-callerid:7] Set("Local/1234567890@from-internal-b861;2", "EMERGENCYCID=") in new stack
-- Executing [s@macro-outbound-callerid:8] Set("Local/1234567890@from-internal-b861;2", "TRUNKOUTCID=<9876543210>") in new stack
-- Executing [s@macro-outbound-callerid:9] GotoIf("Local/1234567890@from-internal-b861;2", "1?trunkcid") in new stack
-- Goto (macro-outbound-callerid,s,12)
-- Executing [s@macro-outbound-callerid:12] ExecIf("Local/1234567890@from-internal-b861;2", "1?Set(CALLERID(all)=<9876543210>)") in new stack
-- Executing [s@macro-outbound-callerid:13] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(CALLERID(all)=)") in new stack
-- Executing [s@macro-outbound-callerid:14] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(CALLERID(all)=)") in new stack
-- Executing [s@macro-outbound-callerid:15] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
-- Executing [s@macro-dialout-trunk:12] GosubIf("Local/1234567890@from-internal-b861;2", "1?sub-flp-1,s,1") in new stack
-- Executing [s@sub-flp-1:1] ExecIf("Local/1234567890@from-internal-b861;2", "1?Set(TARGET_FLP_1=1234567890)") in new stack
-- Executing [s@sub-flp-1:2] GotoIf("Local/1234567890@from-internal-b861;2", "1?match") in new stack
-- Goto (sub-flp-1,s,6)
-- Executing [s@sub-flp-1:6] Set("Local/1234567890@from-internal-b861;2", "DIAL_NUMBER=1234567890") in new stack
-- Executing [s@sub-flp-1:7] Return("Local/1234567890@from-internal-b861;2", "") in new stack
-- Executing [s@macro-dialout-trunk:13] Set("Local/1234567890@from-internal-b861;2", "OUTNUM=+1234567890") in new stack
-- Executing [s@macro-dialout-trunk:14] Set("Local/1234567890@from-internal-b861;2", "custom=SIP/BW-SIP-A") in new stack
-- Executing [s@macro-dialout-trunk:15] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)x)") in new stack
-- Executing [s@macro-dialout-trunk:16] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(DIAL_TRUNK_OPTIONS=xM(confirm))") in new stack
-- Executing [s@macro-dialout-trunk:17] Macro("Local/1234567890@from-internal-b861;2", "dialout-trunk-predial-hook,") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("Local/1234567890@from-internal-b861;2", "") in new stack
-- Executing [s@macro-dialout-trunk:18] GotoIf("Local/1234567890@from-internal-b861;2", "0?bypass,1") in new stack
-- Executing [s@macro-dialout-trunk:19] GotoIf("Local/1234567890@from-internal-b861;2", "0?customtrunk") in new stack
-- Executing [s@macro-dialout-trunk:20] Dial("Local/1234567890@from-internal-b861;2", "SIP/BW-SIP-A/+1234567890,300,x") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called BW-SIP-A/+1234567890
-- SIP/BW-SIP-A-0001f66b is making progress passing it to Local/1234567890@from-internal-b861;2
== Manager 'admin' logged on from 127.0.0.1
== Manager 'admin' logged off from 127.0.0.1
-- SIP/BW-SIP-A-0001f66a is making progress passing it to SIP/1814-0001f669
== Manager 'admin' logged on from 127.0.0.1
== Manager 'admin' logged off from 127.0.0.1
-- SIP/BW-SIP-A-0001f66b answered Local/1234567890@from-internal-b861;2
> Channel Local/1234567890@from-internal-b861;1 was answered.
> Launching AGI(dtmf.php) on Local/1234567890@from-internal-b861;1
-- Executing [h@macro-dialout-trunk:1] Macro("Local/1234567890@from-internal-b861;2", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("Local/1234567890@from-internal-b861;2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] Hangup("Local/1234567890@from-internal-b861;2", "") in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on 'Local/1234567890@from-internal-b861;2' in macro 'hangupcall'
== Spawn extension (macro-dialout-trunk, s, 20) exited non-zero on 'Local/1234567890@from-internal-b861;2' in macro 'dialout-trunk'
== Spawn extension (from-internal, 1234567890, 5) exited non-zero on 'Local/1234567890@from-internal-b861;2'
== Manager 'admin' logged on from 127.0.0.1
== Manager 'admin' logged off from 127.0.0.1
-- Remote UNIX connection
-- Remote UNIX connection disconnected
hostnameCLI>
Disconnected from Asterisk server
Executing last minute cleanups
Here's the CLI Output with AGI Debugging on.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just noticed the permissions on phpagi-asmanager.php and phpagi.php are -rwxrw-r- unlike everything else in the /var/lib/asterisk/agi-bin/ which are all -rwxr-xr- do you think that could be the problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to setup a test scenario that will run every 10 minutes and call from our asterisk server to one of our outside lines and play a series of dtmf tones to verify that we have good enough line quality for the dtmf tones to be made out.
I've been told that AGI is probably going to be the best way to do this, so I've been reading a bit and stumbled onto PHPAGI, I also downloaded the samples and found dtmf.php in there and thought I struck gold. I've created a batch file for one of our other tests and modified it a bit to have it try to run the dtmf.php AGI script.
The commented last 3 commented lines are for testing purposes only and just print whether the call was successful, failed, or expired. When I go to run this script the call is successful it calls 1234567890 but it immediately hangs up. I opened a second window and watched the asterisk CLI as I ran the script and notice that it's giving me this error and ending the call prematurely.
I thought maybe it was a permissions thing, ran chown asterisk:asterisk no luck, even tried chmod 777 /var/lib/asterisk/agi-bin/dtmf.php but no improvement, I just can't seem to figure out why it wont work and would greatly appreciate anyone who might have some advice on what else could possibly be causing the problem.
I had a similar issue. For some reason when I changed the extension to .agi, it worked.
Joseph
One more thing:
Make sure you have the
in the first line of the file, and make sure there's no whitespace between that and the opening <?php tag
http://forums.digium.com/viewtopic.php?f=1&t=75341&start=0
I changed it to dtmf.agi and now it looks like it's successful in that it's not giving me an error message, but it still immediately hangs up.
Can you post the contents of dtmf.agi?
Any errors? Is agi debug on? Can you copy the output from the CLI?
== Parsing '/etc/asterisk/asterisk.conf': == Found
Connected to Asterisk 1.8.4.3 currently running on allison2 (pid = 4479)
Verbosity is at least 19
-- Attempting call on Local/1234567890@from-internal for application AGI(hello-world.agi) (Retry 1)
-- Executing [1234567890@from-internal:1] Macro("Local/1234567890@from-internal-f638;2", "user-callerid,LIMIT,") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/1234567890@from-internal-f638;2", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("Local/1234567890@from-internal-f638;2", "1?report") in new stack
-- Goto (macro-user-callerid,s,12)
-- Executing [s@macro-user-callerid:12] GotoIf("Local/1234567890@from-internal-f638;2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,25)
-- Executing [s@macro-user-callerid:25] Set("Local/1234567890@from-internal-f638;2", "CALLERID(number)=") in new stack
-- Executing [s@macro-user-callerid:26] Set("Local/1234567890@from-internal-f638;2", "CALLERID(name)=") in new stack
-- Executing [s@macro-user-callerid:27] Set("Local/1234567890@from-internal-f638;2", "CHANNEL(language)=en") in new stack
-- Executing [1234567890@from-internal:2] Set("Local/1234567890@from-internal-f638;2", "MOHCLASS=default") in new stack
-- Executing [1234567890@from-internal:3] Set("Local/1234567890@from-internal-f638;2", "_NODEST=") in new stack
-- Executing [1234567890@from-internal:4] Macro("Local/1234567890@from-internal-f638;2", "record-enable,,OUT,") in new stack
-- Executing [s@macro-record-enable:1] MacroExit("Local/1234567890@from-internal-f638;2", "") in new stack
-- Executing [1234567890@from-internal:5] Macro("Local/1234567890@from-internal-f638;2", "dialout-trunk,1,1234567890,") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("Local/1234567890@from-internal-f638;2", "DIAL_TRUNK=1") in new stack
-- Executing [s@macro-dialout-trunk:2] GosubIf("Local/1234567890@from-internal-f638;2", "0?sub-pincheck,s,1") in new stack
-- Executing [s@macro-dialout-trunk:3] GotoIf("Local/1234567890@from-internal-f638;2", "0?disabletrunk,1") in new stack
-- Executing [s@macro-dialout-trunk:4] Set("Local/1234567890@from-internal-f638;2", "DIAL_NUMBER=1234567890") in new stack
-- Executing [s@macro-dialout-trunk:5] Set("Local/1234567890@from-internal-f638;2", "DIAL_TRUNK_OPTIONS=trx") in new stack
-- Executing [s@macro-dialout-trunk:6] Set("Local/1234567890@from-internal-f638;2", "OUTBOUND_GROUP=OUT_1") in new stack
-- Executing [s@macro-dialout-trunk:7] GotoIf("Local/1234567890@from-internal-f638;2", "1?nomax") in new stack
-- Goto (macro-dialout-trunk,s,9)
-- Executing [s@macro-dialout-trunk:9] GotoIf("Local/1234567890@from-internal-f638;2", "0?skipoutcid") in new stack
-- Executing [s@macro-dialout-trunk:10] Set("Local/1234567890@from-internal-f638;2", "DIAL_TRUNK_OPTIONS=x") in new stack
-- Executing [s@macro-dialout-trunk:11] Macro("Local/1234567890@from-internal-f638;2", "outbound-callerid,1") in new stack
-- Executing [s@macro-outbound-callerid:1] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(CALLERPRES()=)") in new stack
-- Executing [s@macro-outbound-callerid:2] ExecIf("Local/1234567890@from-internal-f638;2", "1?Set(REALCALLERIDNUM=)") in new stack
-- Executing [s@macro-outbound-callerid:3] GotoIf("Local/1234567890@from-internal-f638;2", "1?normcid") in new stack
-- Goto (macro-outbound-callerid,s,6)
-- Executing [s@macro-outbound-callerid:6] Set("Local/1234567890@from-internal-f638;2", "USEROUTCID=") in new stack
-- Executing [s@macro-outbound-callerid:7] Set("Local/1234567890@from-internal-f638;2", "EMERGENCYCID=") in new stack
-- Executing [s@macro-outbound-callerid:8] Set("Local/1234567890@from-internal-f638;2", "TRUNKOUTCID=<3102167575>") in new stack
-- Executing [s@macro-outbound-callerid:9] GotoIf("Local/1234567890@from-internal-f638;2", "1?trunkcid") in new stack
-- Goto (macro-outbound-callerid,s,12)
-- Executing [s@macro-outbound-callerid:12] ExecIf("Local/1234567890@from-internal-f638;2", "1?Set(CALLERID(all)=<3102167575>)") in new stack
-- Executing [s@macro-outbound-callerid:13] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(CALLERID(all)=)") in new stack
-- Executing [s@macro-outbound-callerid:14] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(CALLERID(all)=)") in new stack
-- Executing [s@macro-outbound-callerid:15] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
-- Executing [s@macro-dialout-trunk:12] GosubIf("Local/1234567890@from-internal-f638;2", "1?sub-flp-1,s,1") in new stack
-- Executing [s@sub-flp-1:1] ExecIf("Local/1234567890@from-internal-f638;2", "1?Set(TARGET_FLP_1=11234567890)") in new stack
-- Executing [s@sub-flp-1:2] GotoIf("Local/1234567890@from-internal-f638;2", "1?match") in new stack
-- Goto (sub-flp-1,s,6)
-- Executing [s@sub-flp-1:6] Set("Local/1234567890@from-internal-f638;2", "DIAL_NUMBER=11234567890") in new stack
-- Executing [s@sub-flp-1:7] Return("Local/1234567890@from-internal-f638;2", "") in new stack
-- Executing [s@macro-dialout-trunk:13] Set("Local/1234567890@from-internal-f638;2", "OUTNUM=+11234567890") in new stack
-- Executing [s@macro-dialout-trunk:14] Set("Local/1234567890@from-internal-f638;2", "custom=SIP/BW-SIP-A") in new stack
-- Executing [s@macro-dialout-trunk:15] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)x)") in new stack
-- Executing [s@macro-dialout-trunk:16] ExecIf("Local/1234567890@from-internal-f638;2", "0?Set(DIAL_TRUNK_OPTIONS=xM(confirm))") in new stack
-- Executing [s@macro-dialout-trunk:17] Macro("Local/1234567890@from-internal-f638;2", "dialout-trunk-predial-hook,") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("Local/1234567890@from-internal-f638;2", "") in new stack
-- Executing [s@macro-dialout-trunk:18] GotoIf("Local/1234567890@from-internal-f638;2", "0?bypass,1") in new stack
-- Executing [s@macro-dialout-trunk:19] GotoIf("Local/1234567890@from-internal-f638;2", "0?customtrunk") in new stack
-- Executing [s@macro-dialout-trunk:20] Dial("Local/1234567890@from-internal-f638;2", "SIP/BW-SIP-A/+11234567890,300,x") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called BW-SIP-A/+11234567890
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- SIP/BW-SIP-A-0001ed1c is making progress passing it to Local/1234567890@from-internal-f638;2
-- Remote UNIX connection
-- Remote UNIX connection disconnected
-- SIP/BW-SIP-A-0001ed1c answered Local/1234567890@from-internal-f638;2
> Channel Local/1234567890@from-internal-f638;1 was answered.
> Launching AGI(hello-world.agi) on Local/1234567890@from-internal-f638;1
-- Launched AGI Script /var/lib/asterisk/agi-bin/hello-world.agi
hello-world.agi: Failed to execute '/var/lib/asterisk/agi-bin/hello-world.agi': No such file or directory
-- Executing [h@macro-dialout-trunk:1] Macro("Local/1234567890@from-internal-f638;2", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("Local/1234567890@from-internal-f638;2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] Hangup("Local/1234567890@from-internal-f638;2", "") in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on 'Local/1234567890@from-internal-f638;2' in macro 'hangupcall'
== Spawn extension (macro-dialout-trunk, s, 20) exited non-zero on 'Local/1234567890@from-internal-f638;2' in macro 'dialout-trunk'
== Spawn extension (from-internal, 1234567890, 5) exited non-zero on 'Local/1234567890@from-internal-f638;2'
That's the output from the CLI and as for the AGI debug I'm not very familiar with it and will guess that it's probably not enabled, but if you could briefly outline it or point me in the right direction I'd appreciate it. In the meantime though I'll see what I can find on voip-info.org and a few other sites to figure out as much as I can.
Note sure why it stuck a line through all the code, seems odd to me.
Its calling hello-world.agi?
Turn on agi debugging: core set agi debug (I think) (btw tab autocomplete works in the cli )
I had another hello-world.agi that I tried as well, having the same problem with it.
core set a, ag, tab tab results in nothing
and core set agi debug
No such command 'core set agi debug' (type 'core show help core set agi debug' for other possible commands)
Sorry "agi set debug on"
[root@hostname ~]# asterisk -rvvvv
Asterisk 1.8.4.3, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
== Parsing '/etc/asterisk/asterisk.conf': == Found
Connected to Asterisk 1.8.4.3 currently running on hostname (pid = 4479)
Verbosity is at least 19
== Manager 'admin' logged off from 127.0.0.1
hostnameCLI> agi set debug on
AGI Debugging Enabled
-- Attempting call on Local/1234567890@from-internal for application AGI(dtmf.php) (Retry 1)
-- Executing [1234567890@from-internal:1] Macro("Local/1234567890@from-internal-b861;2", "user-callerid,LIMIT,") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/1234567890@from-internal-b861;2", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("Local/1234567890@from-internal-b861;2", "1?report") in new stack
-- Goto (macro-user-callerid,s,12)
-- Executing [s@macro-user-callerid:12] GotoIf("Local/1234567890@from-internal-b861;2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,25)
-- Executing [s@macro-user-callerid:25] Set("Local/1234567890@from-internal-b861;2", "CALLERID(number)=") in new stack
-- Executing [s@macro-user-callerid:26] Set("Local/1234567890@from-internal-b861;2", "CALLERID(name)=") in new stack
-- Executing [s@macro-user-callerid:27] Set("Local/1234567890@from-internal-b861;2", "CHANNEL(language)=en") in new stack
-- Executing [1234567890@from-internal:2] Set("Local/1234567890@from-internal-b861;2", "MOHCLASS=default") in new stack
-- Executing [1234567890@from-internal:3] Set("Local/1234567890@from-internal-b861;2", "_NODEST=") in new stack
-- Executing [1234567890@from-internal:4] Macro("Local/1234567890@from-internal-b861;2", "record-enable,,OUT,") in new stack
-- Executing [s@macro-record-enable:1] MacroExit("Local/1234567890@from-internal-b861;2", "") in new stack
-- Executing [1234567890@from-internal:5] Macro("Local/1234567890@from-internal-b861;2", "dialout-trunk,1,1234567890,") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("Local/1234567890@from-internal-b861;2", "DIAL_TRUNK=1") in new stack
-- Executing [s@macro-dialout-trunk:2] GosubIf("Local/1234567890@from-internal-b861;2", "0?sub-pincheck,s,1") in new stack
-- Executing [s@macro-dialout-trunk:3] GotoIf("Local/1234567890@from-internal-b861;2", "0?disabletrunk,1") in new stack
-- Executing [s@macro-dialout-trunk:4] Set("Local/1234567890@from-internal-b861;2", "DIAL_NUMBER=1234567890") in new stack
-- Executing [s@macro-dialout-trunk:5] Set("Local/1234567890@from-internal-b861;2", "DIAL_TRUNK_OPTIONS=trx") in new stack
-- Executing [s@macro-dialout-trunk:6] Set("Local/1234567890@from-internal-b861;2", "OUTBOUND_GROUP=OUT_1") in new stack
-- Executing [s@macro-dialout-trunk:7] GotoIf("Local/1234567890@from-internal-b861;2", "1?nomax") in new stack
-- Goto (macro-dialout-trunk,s,9)
-- Executing [s@macro-dialout-trunk:9] GotoIf("Local/1234567890@from-internal-b861;2", "0?skipoutcid") in new stack
-- Executing [s@macro-dialout-trunk:10] Set("Local/1234567890@from-internal-b861;2", "DIAL_TRUNK_OPTIONS=x") in new stack
-- Executing [s@macro-dialout-trunk:11] Macro("Local/1234567890@from-internal-b861;2", "outbound-callerid,1") in new stack
-- Executing [s@macro-outbound-callerid:1] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(CALLERPRES()=)") in new stack
-- Executing [s@macro-outbound-callerid:2] ExecIf("Local/1234567890@from-internal-b861;2", "1?Set(REALCALLERIDNUM=)") in new stack
-- Executing [s@macro-outbound-callerid:3] GotoIf("Local/1234567890@from-internal-b861;2", "1?normcid") in new stack
-- Goto (macro-outbound-callerid,s,6)
-- Executing [s@macro-outbound-callerid:6] Set("Local/1234567890@from-internal-b861;2", "USEROUTCID=") in new stack
-- Executing [s@macro-outbound-callerid:7] Set("Local/1234567890@from-internal-b861;2", "EMERGENCYCID=") in new stack
-- Executing [s@macro-outbound-callerid:8] Set("Local/1234567890@from-internal-b861;2", "TRUNKOUTCID=<9876543210>") in new stack
-- Executing [s@macro-outbound-callerid:9] GotoIf("Local/1234567890@from-internal-b861;2", "1?trunkcid") in new stack
-- Goto (macro-outbound-callerid,s,12)
-- Executing [s@macro-outbound-callerid:12] ExecIf("Local/1234567890@from-internal-b861;2", "1?Set(CALLERID(all)=<9876543210>)") in new stack
-- Executing [s@macro-outbound-callerid:13] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(CALLERID(all)=)") in new stack
-- Executing [s@macro-outbound-callerid:14] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(CALLERID(all)=)") in new stack
-- Executing [s@macro-outbound-callerid:15] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
-- Executing [s@macro-dialout-trunk:12] GosubIf("Local/1234567890@from-internal-b861;2", "1?sub-flp-1,s,1") in new stack
-- Executing [s@sub-flp-1:1] ExecIf("Local/1234567890@from-internal-b861;2", "1?Set(TARGET_FLP_1=1234567890)") in new stack
-- Executing [s@sub-flp-1:2] GotoIf("Local/1234567890@from-internal-b861;2", "1?match") in new stack
-- Goto (sub-flp-1,s,6)
-- Executing [s@sub-flp-1:6] Set("Local/1234567890@from-internal-b861;2", "DIAL_NUMBER=1234567890") in new stack
-- Executing [s@sub-flp-1:7] Return("Local/1234567890@from-internal-b861;2", "") in new stack
-- Executing [s@macro-dialout-trunk:13] Set("Local/1234567890@from-internal-b861;2", "OUTNUM=+1234567890") in new stack
-- Executing [s@macro-dialout-trunk:14] Set("Local/1234567890@from-internal-b861;2", "custom=SIP/BW-SIP-A") in new stack
-- Executing [s@macro-dialout-trunk:15] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)x)") in new stack
-- Executing [s@macro-dialout-trunk:16] ExecIf("Local/1234567890@from-internal-b861;2", "0?Set(DIAL_TRUNK_OPTIONS=xM(confirm))") in new stack
-- Executing [s@macro-dialout-trunk:17] Macro("Local/1234567890@from-internal-b861;2", "dialout-trunk-predial-hook,") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("Local/1234567890@from-internal-b861;2", "") in new stack
-- Executing [s@macro-dialout-trunk:18] GotoIf("Local/1234567890@from-internal-b861;2", "0?bypass,1") in new stack
-- Executing [s@macro-dialout-trunk:19] GotoIf("Local/1234567890@from-internal-b861;2", "0?customtrunk") in new stack
-- Executing [s@macro-dialout-trunk:20] Dial("Local/1234567890@from-internal-b861;2", "SIP/BW-SIP-A/+1234567890,300,x") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called BW-SIP-A/+1234567890
-- SIP/BW-SIP-A-0001f66b is making progress passing it to Local/1234567890@from-internal-b861;2
== Manager 'admin' logged on from 127.0.0.1
== Manager 'admin' logged off from 127.0.0.1
-- SIP/BW-SIP-A-0001f66a is making progress passing it to SIP/1814-0001f669
== Manager 'admin' logged on from 127.0.0.1
== Manager 'admin' logged off from 127.0.0.1
-- SIP/BW-SIP-A-0001f66b answered Local/1234567890@from-internal-b861;2
> Channel Local/1234567890@from-internal-b861;1 was answered.
> Launching AGI(dtmf.php) on Local/1234567890@from-internal-b861;1
-- Executing [h@macro-dialout-trunk:1] Macro("Local/1234567890@from-internal-b861;2", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("Local/1234567890@from-internal-b861;2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] Hangup("Local/1234567890@from-internal-b861;2", "") in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on 'Local/1234567890@from-internal-b861;2' in macro 'hangupcall'
== Spawn extension (macro-dialout-trunk, s, 20) exited non-zero on 'Local/1234567890@from-internal-b861;2' in macro 'dialout-trunk'
== Spawn extension (from-internal, 1234567890, 5) exited non-zero on 'Local/1234567890@from-internal-b861;2'
== Manager 'admin' logged on from 127.0.0.1
== Manager 'admin' logged off from 127.0.0.1
-- Remote UNIX connection
-- Remote UNIX connection disconnected
hostnameCLI>
Disconnected from Asterisk server
Executing last minute cleanups
Here's the CLI Output with AGI Debugging on.
I just noticed the permissions on phpagi-asmanager.php and phpagi.php are -rwxrw-r- unlike everything else in the /var/lib/asterisk/agi-bin/ which are all -rwxr-xr- do you think that could be the problem?