Diaing our from PHP AGI script

I’d like to originate a call from my PHP script.

Is there any Dial command for that purpose? I don’t see any such command in the list of AGI commands.

I know that the it very easy to call out using the Dial App from the dial plan, can I do the same in an AGI script - PHP?

OK! I found the EXEC command that could serve the purpose.

However, I am unable to execute my AGI script. Here is the CLI output

AGI Tx >> agi_request: test.php
AGI Tx >> agi_channel: SIP/
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1308418873.614
AGI Tx >> agi_callerid: 18479873465
AGI Tx >> agi_calleridname: unknown
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 18479049212
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: from-trunk
AGI Tx >> agi_extension: 18479049212
AGI Tx >> agi_priority: 7
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI Rx << verbose “Failed to execute ‘/var/lib/asterisk/agi-bin/test.php’: Exec format error” 2
== test.php: Failed to execute ‘/var/lib/asterisk/agi-bin/test.php’: Exec format error
AGI Tx >> 200 result=1
== Auto fallthrough, channel ‘SIP/’ status is ‘UNKNOWN’
– Executing [h@from-trunk:1] Hangup(“SIP/”, “”) in new stack
== Spawn extension (from-trunk, h, 1) exited non-zero on ‘SIP/’

What version of asterisk are you using and more important what does your PHP code look like?

You might want to move this to the Support section instead. This is General