Hello,
I'm pretty much a newbie when it comes to Mac OS X so go easy on me.  I have 
a Perl applicaton that communicates with the Asterisk VoIP phone system 
through AGI (Asterisk Gateway Interface) very similar to CGI.  Asterisk 
starts my perl application and the two communicate over STDIN and STDOUT 
file handles.   When the user on the phone presses the # key my AGI perl 
application is suppose to start recording what the users says until they 
press # again.  The way this works, is the perl applications writes the 
RECORD command to STDOUT and Asterisk starts to record and then the perl 
program waits on STDIN for the response which would be the # key when the 
user presses it.  I call the "alarm(3)" perl command (having set $SIG{ALRM} 
= \&handleAlarm; earlier) before issuing the RECORD command to have perl 
call my handleAlarm() routine to perform some tasks three seconds after the 
recording starts (like check that the file actually has some sound and to 
notify others that a messages is currently being recorded).

We've been using this application on a Linux machine for over a year and 
recently I tried to port the whole thing to a Macmini with OS X 10.3. 
Almost everything works great except, when the alarm goes off the wait on 
STDIN stops prematurly before Asterisk has actually stopped recording.  If I 
comment out the alarm command the wait on STDIN works fine.

I've posted this already in the Asterisk and AstMasters mailing list but I 
think it may be more perl related then Asterisk related and having something 
to do wtih the whole alarm subsystem on Mac OS X vs Linux.  Asterisk is 
writen in straight C so perhaps they are both using the same alarm timer. 
Any thoughts or suggestions would be greatly appreciated because I'm 
stumped.

Thanks,
Chris 


Reply via email to