[Serusers] Help Using SER FIFO "ser_fifo"

Leo leo at ltcjp.com
Fri Apr 22 13:34:34 CEST 2005


OK, I got it working. The problem was in the argument sent to the fifo.
Apparently the path to the reply fifo cannot have a path. So
":ul_dump:rfifo\n" <---works
":ul_dump:/tmp/rfifo\n" <---does not work because SER does not like the
path.

I wonder what makes SER know to use the 'rfifo' in the /tmp directory?

-----Original Message-----
From: serusers-bounces at iptel.org [mailto:serusers-bounces at lists.iptel.org] On
Behalf Of Leo
Sent: Thursday, April 21, 2005 9:37 PM
To: marian.dumitru at voice-sistem.ro
Cc: serusers at lists.iptel.org
Subject: RE: [Serusers] Help Using SER FIFO "ser_fifo"

Marian,

Thank you for the fast response and advice, but I am still stuck. I made
fifo by doing an 'mkfifo rfifo' in the /tmp directory to create a fifo
called 'rfifo'. Then I changed the permissions to "666".

Then from the command line I did a 'cat rfifo' which waits for something to
be written to 'rfifo'.

Then I modified the PHP script in this e-mail string to reply to 'rfifo'
instead of 'delthis.txt'. However, the cat on rfifo never returns. I see
nothing the in SER log about why. If I open up another command window and
send something to rfifo, it does return. So I know rfifo is working, it is
just that SER does not seem to be writing to 'rfifo'.

I am stuck.

Sincerely,

Leo

-----Original Message-----
From: Marian Dumitru [mailto:marian.dumitru at voice-sistem.ro] 
Sent: Thursday, April 21, 2005 6:04 PM
To: Leo
Cc: serusers at lists.iptel.org
Subject: Re: [Serusers] Help Using SER FIFO "ser_fifo"

Leo,

the reply file must be also a FIFO file already existing and must be 
some process reading from it for SER to be able to write something.
Try to monitor SER logs to trace your problem.

Best regards,
Marian

Leo wrote:
> Dear serusers,
> 
> I have spent the past several nights trying to figure out how to use the
> ser_fifo to send commands and get info back from SER using PHP.
> My understanding of using the fifo in SER is to send it
> :fifo_command:result_filename. In the example below I am sending the
> "ul_dump" command to the fifo and telling to return the result to a file
> called "delthis.txt". The file "delthis.txt" never gets created and it
> doesn't look like this fifo thing is working at all.
> 
> The examples in the admin guide are not helping me. Can anyone one help?
> 
> 
> The test PHP code is below:
> 
> <html>
> <head>
> <title>Browser SERCTL </title>
> </head>
> <body>
> <?php
> function wrfifo()
> {
> $fifo_handle = fopen("/tmp/ser_fifo" , "w");
> if (!$fifo_handle)
> 	{
> 	echo "cannot open ser_fifo<br>";
> 	return 0;
> 	}
> if (fwrite($fifo_handle, ":ul_dump:/tmp/delthis.txt")==-1)
> 	{
> 	echo "cannot write to fifo";
> 	fclose($fifo_handle);
> 	return 0;
> 	}
> fclose($fifo_handle);
> system("cat /tmp/delthis.txt");
> return 1;
> }
> echo "begin<br>";
> $success = wrfifo();
> if ($success)
> 	{
> 	echo "success<br>";
> 	}
> else
> 	{
> 	echo "failure<br>";
> 	}
> ?>
> 
> 
> 
> Leo Papadopoulos
> leo at ltcjp.com
> 
> 

-- 
Voice System
http://www.voice-system.ro

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005
 

_______________________________________________
Serusers mailing list
serusers at lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005
 




More information about the sr-users mailing list