[asterisk-users] how to pass a variable in extensions.conf to AGI file
Zen Kato
zenkato at zm.commufa.jp
Fri Sep 12 00:07:11 CDT 2008
I would like to pass global variable(i.e., ${CALLERID(num)}) in
extensions.conf to the variable in an AGI file
(/var/lib/asterisk/agi-bin/some-agi-file).
Can someone help me to implement the following?
extensions.conf
--------------
exten => 9911,1,Answer
exten => 9911,2,Wait(1)
exten => 9911,3,Set(CALLER=${CALLERID(num)})
exten => 9911,4,AGI(callall-9911-1)
exten => 9911,5,AGI(callall-9911-2)
exten => 9911,8,AGI(callall-9911-3)
/var/lib/asterisk/agi-bin/callall-9911-1
-----------------------------------------
#!/bin/sh
cp /var/lib/asterisk/agi-bin/demo1/call-all/telno/9911/* /var/tmp/call-all/9911
/var/lib/asterisk/agi-bin/callall-9911-2
-----------------------------------------
#!/usr/bin/perl
use strict;
use Shell qw(rm);
rm "/var/tmp/call-all/9911/".$CALLER;
/var/lib/asterisk/agi-bin/callall-9911-3
-----------------------------------------
#!/bin/sh
mv /var/tmp/call-all/9911/* /var/spool/asterisk/outgoing
There are 0103,0203,0303,0403,.,1003 files under /var/tmp/call-all/9911/.
If I dial 9911 from username=0103, I would like to delete 0103 file,
because 0103 is caller and callee.
The perl script :
rm "/var/tmp/call-all/9911/".$CALLER;
does not work.
Regards,
Zen
More information about the asterisk-users
mailing list