How to add custom script

lol24h

Joined
Jul 16, 2010
Messages
12
Likes
0
Points
0
#1
I have no clue how to add custom script when taking a call.
I assume, everything is configure, I just want to add one action , like running custom per script . I added that to extension_custom.conf, bu it doesn't work, nothing is shown in logs related to that script like "Launched AGI" etc.

This was added to extension_custom.conf

[from-internal-additional-custom]
exten => 111,2,AGI(/home/mastier/call-notify.pl|${CALLERID(name)}|${CALLERID(number)})
 

saugortgarcia

Joined
Sep 11, 2009
Messages
9
Likes
0
Points
0
#2
Hi,

Did you include your context? Check the 10 first lines of extensions_custom.conf, so you can see what I mean.

Also, I not sure if you need to do some changes to your file:
exten => 111,2,AGI(/home/mastier/call-notify.pl|${CALLERID(name)}|${CALLERID(number)})

should be:
exten => 111,2,AGI(call-notify.pl,${CALLERID(name)},${CALLERID(number)})

because in /var/lib/asterisk/agi-bin is where asterisk look the scripts, also you will to give execution permisions to your script, chmod 755
 

lol24h

Joined
Jul 16, 2010
Messages
12
Likes
0
Points
0
#3
I fixed that but it doesn't seem to work

My simple script:
Code:
#!/usr/bin/perl
use Asterisk::AGI;

print "It WOOORXXX","\n";

open FILE,'>>', "/root/test.txt" or die "Can't open file: $!";
print FILE $ARGV[1];
print FILE "\n";
close FILE;
root@kalmar /root 0# ls -la /var/lib/asterisk/agi-bin/call-notify.pl
-rwxr-xr-x 1 asterisk asterisk 177 pa? 6 13:06 /var/lib/asterisk/agi-bin/call-notify.pl

root@kalmar /root 0# ls -la /root/test.txt
-rw-rw-rw- 1 asterisk asterisk 22 pa? 6 12:59 /root/test.txt
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,887
Members
17,565
Latest member
omarmenichetti
Top