[asterisk-users] missing argument on AGI
Steve Edwards
asterisk.org at sedwards.com
Fri Feb 25 09:49:37 CST 2011
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Ron
>
> actually the ${OUTBOUND} is generated by the php... but based on what
> will be received on ${ARG1}. unfortunately i am not getting the value
> from the argument. not sure why. thanks again.
On Fri, 25 Feb 2011, Danny Nicholas wrote:
> This probably seems too elementary, but a "standard practice" I use with
> my PERL AGI scripts is to run each of them from bash before I put them
> into the dialplan so I have an idea how they will react.
>
> In your particular case, you should be able to do this from bash:
>
> $ php getchannel.php 100 (change 100 to what you are sending in the
> dialplan)
> The program should print back out
> "Set OUTBOUND=xxxx"
>
> Until you get this output, you are wasting everyone's time.
A 'better' way to 'desk check' an AGI would be to feed it a somewhat
static AGI environment using a script like:
agi-environment.sh
==================
# output a fake AGI environment
echo "agi_accountcode: "
echo "agi_callerid: 1234567890"
echo "agi_calleridname: example"
echo "agi_callingani2: 0"
echo "agi_callingpres: 0"
echo "agi_callingtns: 0"
echo "agi_callington: 0"
echo "agi_channel: SIP/example"
echo "agi_context: example"
echo "agi_dnid: *"
echo "agi_enhanced: 0.0"
echo "agi_extension: *"
echo "agi_language: en"
echo "agi_priority: 1"
echo "agi_rdnis: unknown"
echo "agi_request: example"
echo "agi_type: SIP"
echo "agi_uniqueid: 1234567890.12"
echo ""
# respond to requests
echo "200 result=0"
echo "200 result=0"
echo "200 result=0"
echo "200 result=0"
# (end of agi-environment.sh)
And then:
./agi-environment.sh | /var/lib/asterisk/agi-bin/getchannel.php 100
--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
More information about the asterisk-users
mailing list