[Asterisk-Users] Monitor application and e-mailing attachment

Doug Lytle support at drdos.info
Sun Jun 4 11:11:03 MST 2006


Attilla De Groot wrote:
>
> On Jun 4, 2006, at 5:29 PM, Doug Lytle wrote:
>> I pass variables to my scripts all the time.
>>
>> When I first started using scripts with variables, I was having 
>> issues with the scripts running, but producing no results. Echoing 
>> the variables to a log, I was able to track down why they weren't 
>> working.  You may want to do the same.
>>
>> Doug
>
> Can you show me an example from you ?
> Because if I echo everything works fine, but it just won't work.
>
>

Okay,

I decided that I would give it a try, I ended up having the same issues 
as you.  I got it figured out though.

When using the monitor application, it splits the wave files into 
incoming and outgoing legs.  Once the call has been completed, it mixes 
them into the final file.  The problem is, it doesn't consider the h 
extension as the call completed.  It waits until the h extension has 
terminated before merging.  I proved this point by adding a sleep 20 in 
my script and the incoming/outgoing waves sat there for 20 seconds.  My 
fix was to ad an ampersand at the end of the System script entry.  As so:

exten => h,1,System(/usr/local/bin/monitor.sh ${CALLFILENAME} &)

This will cause the script to detach from the current shell.

Doug


-- Ben Franklin quote: "Those who would give up Essential Liberty to 
purchase a little Temporary Safety, deserve neither Liberty nor Safety."




More information about the asterisk-users mailing list