help: SIGALRM on OS X

2006-01-10 Thread Chris
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 




Perl web server

2006-01-10 Thread Lou Rosinski
I can execute a Perl script in the terminal (MacOSX) but cannot get that
same Perl script to execute on a browser (ie Safari).  I can upload that
same script to my virtual Unix server and it executes just fine there.

I suspect the problem is the Apache config on my Mac but have researched and
made changes but to no avail.



Re: Perl web server

2006-01-10 Thread John Delacour

At 4:39 pm -0800 10/1/06, Lou Rosinski wrote:


I can execute a Perl script in the terminal (MacOSX) but cannot get that
same Perl script to execute on a browser (ie Safari).  I can upload that
same script to my virtual Unix server and it executes just fine there.

I suspect the problem is the Apache config on my Mac but have researched and
made changes but to no avail.



I installed Apache 2 at the weekend and had to work out how to get 
things configured.  Here's what I ended up with in httpd.conf 
(/usr/local/apache2/conf/httpd.conf).  You'll need to read the whole 
file carefully, but even with my strong disinclination to prolonged 
concentration I didn't find it too difficult once I'd set my mind to 
it.


You need to stop and restard the server after every change, of course.


# /usr/local/apache2/cgi-bin should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
#Directory /usr/local/apache2/cgi-bin
Directory /users/jd/sites/cgi-bin
AllowOverride None
Options None
Order allow,deny
Allow from all
/Directory
Directory /users/jd/sites/.../.../.../cgi-bin
AllowOverride None
Options None ExecCGI
Order allow,deny
Allow from all
/Directory


Re: Perl web server

2006-01-10 Thread John Horner
I suspect the problem is the Apache config on my Mac but have 
researched and

made changes but to no avail.


We're going to need more details!

Is the web server running?

Where is the script you're trying to run located?

How are you trying to get it to run in a browser, i.e. what URL are you 
browsing?


What are its permissions?

What are its line-breaks?

What happens when you browse it?



Re: Perl web server

2006-01-10 Thread Joel Rees


On 2006.1.11, at 10:30 AM, John Delacour wrote:

# /usr/local/apache2/cgi-bin should be changed to whatever your 
ScriptAliased

# CGI directory exists, if you have that configured.
#
#Directory /usr/local/apache2/cgi-bin
Directory /users/jd/sites/cgi-bin


This one I think I understand. (I assume your file system is not set up 
case sensitive?)


Except


AllowOverride None
Options None


This


Order allow,deny
Allow from all


and this look kind of weird together, in reference to the directory 
name. Am I missing something?



/Directory
Directory /users/jd/sites/.../.../.../cgi-bin


That path looks kind of unusual. I don't often see directories named 
 Is it something Apache does that I've either never seen before 
or forgotten?



AllowOverride None
Options None ExecCGI
Order allow,deny
Allow from all
/Directory