Re: [OpenSIPS-Users] FIFO very fragile

2011-05-11 Thread Vlad Paiu
Hello, Yes, there is no need to restart. The fifo engine attempts to flush any extra bogus characters whenever an error occurs, but it blocking attempts to clear them until it encounters a carriage return. Just push an extra carriage return to the fifo and that should clear out the previous

Re: [OpenSIPS-Users] FIFO very fragile

2011-05-11 Thread Brett Nemeroff
On Wed, May 11, 2011 at 8:51 AM, Vlad Paiu wrote: > Hello Brett, > > A well formed MI command should end with two '\n\n' characters. When you do > > echo -e ":address_dump:my_fifo\n\n" > > ,your MI command ends with three '\n', because echo adds an extra \n at the > end, unless you use the -

Re: [OpenSIPS-Users] FIFO very fragile

2011-05-11 Thread Vlad Paiu
Hello Brett, A well formed MI command should end with two '\n\n' characters. When you do echo -e ":address_dump:my_fifo\n\n" ,your MI command ends with three '\n', because echo adds an extra \n at the end, unless you use the -n parameter. So what happens is that OpenSIPS successfully proc

Re: [OpenSIPS-Users] FIFO very fragile

2011-05-09 Thread Brett Nemeroff
On Mon, May 9, 2011 at 7:28 PM, Dave Singer wrote: > Brett, > > In your perl app are you starting and forking/threading the read before >print FIFO ":uptime:reply_fifo\n"; > ? Dave, I tried all sorts of ways. I'm pretty sure my problem comes down to some failicy in how I'm performing my open

Re: [OpenSIPS-Users] FIFO very fragile

2011-05-09 Thread Dave Singer
Brett, In your perl app are you starting and forking/threading the read before    print FIFO ":uptime:reply_fifo\n"; ? I seem to remember starting the read process first to be very important. My speculation is the reply fifo is not truely active until it has a process actively attached and reading

Re: [OpenSIPS-Users] FIFO very fragile

2011-05-09 Thread Brett Nemeroff
Dave, Yeah, I do actually get a reply. Works reliably too as long as I'm careful about what I'm asking for. I'm trying to do all of this directly from perl. For some reason I can't write to the fifo with a simple: open(FIFO,">/tmp/opensips_fifo"); print FIFO ":uptime:reply_fifo\n"; The fifo never

Re: [OpenSIPS-Users] FIFO very fragile

2011-05-09 Thread Dave Singer
Are you actually able to get results out of the reply fifo? It's been a long time since I created my bash fifo script so I don't remember all the particulars of what I ran into. It can be important to start the read fifo before sending the command Hear is a snippet from a bash fifo I did. trap "\

Re: [OpenSIPS-Users] FIFO very fragile

2011-05-09 Thread Brett Nemeroff
Dave, I don't think those are the issues. First of all, if I supply the full path to the reply fifo, I get an error message that the filename is invalid. More importantly, it doesn't work. :) without the full path, it does work. Secondly, I don't think it's SELinux issue because it *does work* rep

Re: [OpenSIPS-Users] FIFO very fragile

2011-05-09 Thread Dave Singer
Brett, I believe you need the full path to the reply fifo. Try: echo -e ":address_dump:/tmp/my_fifo\n\n" > /tmp/opensips_fifo you may also have a permissions ( chmod a+w /tmp/my_fifo ) and/or SELinux issue (very likely if SELinux is enabled, I posted a howto for SELinux in the list a number of mon

[OpenSIPS-Users] FIFO very fragile

2011-05-09 Thread Brett Nemeroff
Hello List, So I've been doing some testing with the mi_fifo and found that it appears to be really fragile. Here's what I've done: mkfifo /tmp/my_fifo cat /tmp/my_fifo& echo -e ":address_dump:my_fifo\n\n" > /tmp/opensips_fifo *returns* 200 OK 48 <1.2.3.4,2, 0, 0, NULL, NULL> ** cat process ends