From leo@ltcjp.com Fri Apr 22 13:34:44 2005 From: Leo To: sr-users@lists.kamailio.org Subject: RE: [Serusers] Help Using SER FIFO "ser_fifo" Date: Fri, 22 Apr 2005 07:34:34 -0400 Message-ID: <20050422113443.BA87FFBEA@fox.iptel.org> In-Reply-To: <20050422013722.7B4291EF6@fox.iptel.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0865895651==" --===============0865895651== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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(a)iptel.org [mailto:serusers-bounces(a)lists.iptel.org= ] On Behalf Of Leo Sent: Thursday, April 21, 2005 9:37 PM To: marian.dumitru(a)voice-sistem.ro Cc: serusers(a)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(a)voice-sistem.ro]=20 Sent: Thursday, April 21, 2005 6:04 PM To: Leo Cc: serusers(a)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=20 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, >=20 > 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. >=20 > The examples in the admin guide are not helping me. Can anyone one help? >=20 >=20 > The test PHP code is below: >=20 > > > Browser SERCTL > > > function wrfifo() > { > $fifo_handle =3D fopen("/tmp/ser_fifo" , "w"); > if (!$fifo_handle) > { > echo "cannot open ser_fifo
"; > return 0; > } > if (fwrite($fifo_handle, ":ul_dump:/tmp/delthis.txt")=3D=3D-1) > { > echo "cannot write to fifo"; > fclose($fifo_handle); > return 0; > } > fclose($fifo_handle); > system("cat /tmp/delthis.txt"); > return 1; > } > echo "begin
"; > $success =3D wrfifo(); > if ($success) > { > echo "success
"; > } > else > { > echo "failure
"; > } > ?> >=20 >=20 >=20 > Leo Papadopoulos > leo(a)ltcjp.com >=20 >=20 --=20 Voice System http://www.voice-system.ro --=20 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 =20 --=20 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 =20 _______________________________________________ Serusers mailing list serusers(a)lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers --=20 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 =20 --=20 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 =20 --===============0865895651==--