Discussion:
[Asterisk-Users] Placing call files in/var/spool/asterisk/outgoing/ does not work
Michael Collins
2006-05-24 15:48:58 UTC
Permalink
you should mv the file (and in the same filesystem, so 'rename' is
used)
You might want to chmod or even chown the file first as well. I wrote a
little script that does all of this before the .call file is mv'd into
the outgoing directory:

cp /tmp/test3.call /tmp/test1.call
chmod 666 /tmp/test1.call
chgrp asterisk /tmp/test1.call
chown asterisk /tmp/test1.call
mv /tmp/test1.call /var/spool/asterisk/outgoing/

I've been doing a lot of test calls to work on other aspects of .call
files, so this script is quite handy for making the same call over and
over again.

HtH

-MC
Maxim Vexler
2006-05-25 20:44:34 UTC
Permalink
Post by Michael Collins
you should mv the file (and in the same filesystem, so 'rename' is
used)
You might want to chmod or even chown the file first as well. I wrote a
little script that does all of this before the .call file is mv'd into
cp /tmp/test3.call /tmp/test1.call
chmod 666 /tmp/test1.call
chgrp asterisk /tmp/test1.call
chown asterisk /tmp/test1.call
mv /tmp/test1.call /var/spool/asterisk/outgoing/
I've been doing a lot of test calls to work on other aspects of .call
files, so this script is quite handy for making the same call over and
over again.
HtH
-MC
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
http://lists.digium.com/mailman/listinfo/asterisk-users
Thank you both, Tzafrir and Michael.
I ended up using the script from
http://www.voip-info.org/wiki-Asterisk+tips+callback

It looks like this:
<<<
#!/bin/bash

if [ "x$1" != "x" ];then phone_number="$1"; else return 1; fi

#note use of '-' in '-EOF1' - Escapes tab at beginning of lines
CALLFILE=$(cat <<-EOF1
Channel: Zap/g0/$phone_number
MaxRetries: 2
# Retry in 5 min
RetryTime: 300
WaitTime: 45

Context: ext-local
Extension: 211
Priority: 1

EOF1
)
echo "$CALLFILE" >> "/var/spool/asterisk/outgoing/max.call"
# echo "$CALLFILE" >> "/tmp/calltomake.txt"
I call it by doing a simple ./makecall.sh SOMEPHONE

The only problem I'm having now is that I must run the script as user
asterisk, otherwise I get the same asterisk error as before.

Is there any way to fix this ?


Thank you.
--
Cheers,
Maxim
Jimmy Smith
2006-05-25 23:16:56 UTC
Permalink
make sure that the shell location is right...

#!/bin/bash
not equal to
#!//ust/local/bin

common mistake..
Post by Maxim Vexler
Post by Michael Collins
you should mv the file (and in the same filesystem, so 'rename' is
used)
You might want to chmod or even chown the file first as well. I wrote a
little script that does all of this before the .call file is mv'd into
cp /tmp/test3.call /tmp/test1.call
chmod 666 /tmp/test1.call
chgrp asterisk /tmp/test1.call
chown asterisk /tmp/test1.call
mv /tmp/test1.call /var/spool/asterisk/outgoing/
I've been doing a lot of test calls to work on other aspects of .call
files, so this script is quite handy for making the same call over and
over again.
HtH
-MC
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
http://lists.digium.com/mailman/listinfo/asterisk-users
Thank you both, Tzafrir and Michael.
I ended up using the script from
http://www.voip-info.org/wiki-Asterisk+tips+callback
<<<
#!/bin/bash
if [ "x$1" != "x" ];then phone_number="$1"; else return 1; fi
#note use of '-' in '-EOF1' - Escapes tab at beginning of lines
CALLFILE=$(cat <<-EOF1
Channel: Zap/g0/$phone_number
MaxRetries: 2
# Retry in 5 min
RetryTime: 300
WaitTime: 45
Context: ext-local
Extension: 211
Priority: 1
EOF1
)
echo "$CALLFILE" >> "/var/spool/asterisk/outgoing/max.call"
# echo "$CALLFILE" >> "/tmp/calltomake.txt"
I call it by doing a simple ./makecall.sh SOMEPHONE
The only problem I'm having now is that I must run the script as user
asterisk, otherwise I get the same asterisk error as before.
Is there any way to fix this ?
Thank you.
--
Cheers,
Maxim Vexler
"Free as in Freedom" - Do u GNU ?
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
http://lists.digium.com/mailman/listinfo/asterisk-users
Loading...