TRY THIS Call Files

TheMole

Guru
Joined
Aug 28, 2008
Messages
96
Reaction score
9
Hello all. I'm using a dated version of PIAF but things work for me.

I have a external process that will get a URL (http://IP.ADDRESS/cgi-bin/FrontDoor2.pl) . That URL will trigger a call file to be created. The process has worked _flawlessly_ for me for many months. Until now. I cannot determine what has changed.

The Apache logs confirm the external process correctly calls the URL, but the call file seems not to be created. Asterisk logs show no call is placed. additionallyl the FD2.txt file's timestamp is updated, so i know it's running.

FrontDoor2.pl contains the following:

Code:
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Front Door Alert Handler"
echo "</title></head><body>"
echo "<h1>Message Received.  Alert Sent. Thank you.</h1>"
echo "<pre> $(echo 1 > /tmp/FD2.txt)</pre>"
echo "<pre> $(echo "Channel: Local/881999@ext-paging" > /tmp/newcall.call)</pre>"
echo "<pre> $(echo "WaitTime: 5" >> /tmp/newcall.call)</pre>"
echo "<pre> $(echo "Context: ext-paging" >> /tmp/newcall.call)</pre>"
echo "<pre> $(echo "CallerID: \"ALERT Front Door\" <2229>" >> /tmp/newcall.call)</pre>"
echo "<pre> $(echo "Extension: 2229" >> /tmp/newcall.call)</pre>"
echo "<pre> $(echo "Priority: 1" >> /tmp/newcall.call)</pre>"
echo "<pre> $(chmod 666 /tmp/newcall.call)</pre>"
echo "<pre> $(mv /tmp/newcall.call /var/spool/asterisk/outgoing/newcall.call)</pre>"
echo "</body></html>"

when run manually from a bash shell, this works fine.

can someone take a look a that the above and confirm for me i'm not doing anything grossly incorrect? i just need to eliminate a gross error in the above to continue my investigation.
 
If it work, and now it does not all of a sudden, I would start by checking to make sure that one or the other of the two directories involved is not full..

df or check /var/log/messages for errors.
 
Thanks for the idea. I just checked and the disk space is only at 18% capacity.

i think that the calling program might have an issue - the apache logs show that when called from a regular browser the size of the content returns is larger than when it is requested from the calling program. the calling program was recently updated and i think it might have a bug.
 
excellent thought.

looks like for some reason the command does not get completed when running from the 3rd party software -- while running from a command line, web-broswer, or the 3rd party software's own "test" function all work!

the call file doesn't completely write :

Code:
root@pbx2:/tmp $ cat /tmp/newcall.call
Channel: Local/881999@ext-paging

So, what i did is wrote a perl wrapper around the bash script. the perl wrapper is this:

Code:
#!/usr/bin/perl
system("/bin/bash ./FrontDoor2.pl");

kludgy, but works !!!!!!!!

thanks for the help !!

[[[ there is no secret here -- the 3rd party software is blue iris. i have a motion trigger even that calls the URL described above and pages all my phones to alert me of motion. the was an update to the software on tuesday night and this was broken. ]]]
 

Members online

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top