There is no difference between signals in Linux and signals in OSX, they
behave the same. However, the way the processes setup may differ. There
is an OSX asterisk version that should have this sorted out for you.
There is a lot of help here:
http://www.voip-info.org/tiki-index.php?page=Asterisk%20MacOSX%20Support
> Hello,
> I'm pretty much a newbie when it comes to Mac OS X so go easy on me. I have
[quoted text clipped - 11 lines]
> recording starts (like check that the file actually has some sound and to
> notify others that a messages is currently being recorded).
There are several ways to fork a child process and the way Linux and BSD
do this has minor variations. The way that it is forked determines
whether the parent intercepts a signal or passes it to the child. The
wait mask likewise varies between the OS's. Reading the manual pages
over and over and experimentation is the only way I've ever gotten these
things to work. In principal, the wait returns an integer, by masking
the proper bits one can determine what broke the wait, then decide to
continue waiting or exit.
> 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.
[quoted text clipped - 11 lines]
> Thanks,
> Chris
Chris - 10 Jan 2006 23:07 GMT
Hello Danny,
Wow, thank you for the speedy reply and the suggestions. I've been searching
the Asterisk Mac community (including the voip-info wiki and astmasters.org)
for some time and have been reading the man pages on "alarm" and how
STDIN/OUT are handled both on linux and mac and couldn't come up with any
reason that the code should behave differently.
I was thinking of trying a fork instead of the alarm but figured at a lower
level the alarm was essentially doing the same thing.
Although very simplified, the perl code essentially looks like this:
alarm(3);
$fhO = \*STDOUT if (!$fhO);
select ((select ($fhO), $| = 1)[0]);
print $fhO "$command\n";
$fhI = \*STDIN if (!$fhI);
$response = <$fhI> || '200 result=-1 (noresponse)';
chomp($response);
$timeleft = alarm(0);
On linux the handleAlarm routine runs and finishes without a problem and
when the user finishes recording and presses the # key, then the line
$response = <$fhI> continues. On the Mac, as soon as the alarm goes off
$response gets '200 result=-1 (noresponse)'. If I comment out the alarm(3),
then it works. It's so simple on the Perl side that I now think the problem
must be in the Asterisk C code.
Thanks again,
Chris
> There is no difference between signals in Linux and signals in OSX, they
> behave the same. However, the way the processes setup may differ. There
[quoted text clipped - 49 lines]
>> Thanks,
>> Chris