<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hello Brett,<br>
<br>
A well formed MI command should end with two '\n\n' characters. When
you do<br>
echo -e ":address_dump:my_fifo\n\n"<br>
<br>
,your MI command ends with three '\n', because echo adds an extra \n at
the end, unless you use the -n parameter.<br>
<br>
So what happens is that OpenSIPS successfully processes your
address_dump MI command, and then reads the third \n.<br>
It treats it as an empty MI command, and attempts to block and read the
second \n signaling the end of the MI command, and there it gets stuck.<br>
<br>
<br>
Regards,<br>
<pre class="moz-signature" cols="72">--
Vlad Paiu
OpenSIPS Developer</pre>
<br>
<br>
<br>
On 05/09/2011 07:40 PM, Brett Nemeroff wrote:
<blockquote
cite="mid:BANLkTikXUdNErS5SXusOiX8uTabuihwELA@mail.gmail.com"
type="cite">Hello List,
<div>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:</div>
<div><br>
</div>
<div>mkfifo /tmp/my_fifo</div>
<div>cat /tmp/my_fifo&</div>
<div>echo -e ":address_dump:my_fifo\n\n" > /tmp/opensips_fifo</div>
<div>
<div>*returns*</div>
<div>200 OK</div>
<div> 48 <1.2.3.4,2, 0, 0, NULL, NULL></div>
</div>
<div>** cat process ends</div>
<div>cat /tmp/my_fifo&</div>
<div>
<meta charset="utf-8">
<div>echo -e ":address_dump:my_fifo\n\n" > /tmp/opensips_fifo</div>
<div>** nothing</div>
<div><br>
</div>
<div>At this point, I can't make the fifo work again until I restart
opensips. If I detach from the fifo (kill the cat, so to speak), and
reattach it doesn't work. Nothing seems to make it responsive again. At
first I though something was horribly broken, but then I removed one of
my \n from the fifo command and now it works "as expected". Two
new-lines shouldn't break the fifo, right?</div>
<div><br>
</div>
<div>Thanks!</div>
<div>-Brett</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>