<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi M.Ionut and Liviu.</p>
<p><br>
</p>
<p>No problem M.Iount.<br>
</p>
<p><br>
</p>
<p>Thank you very much! The answers was very clarifying!</p>
<p><br>
</p>
<p>OpenSIPS has been a super useful tool in my project and people in this discussion list has been very clever about questions that rise here.</p>
<p><br>
</p>
<p>Hopefully, OpenSIPS will succeed many years in Telecom market.<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Best regards.</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b> users-bounces@lists.opensips.org &lt;users-bounces@lists.opensips.org&gt; em nome de Ionut Muntean &lt;ionutm22@gmail.com&gt;<br>
<b>Enviado:</b> quarta-feira, 2 de dezembro de 2015 15:09<br>
<b>Para:</b> users@lists.opensips.org<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How can I write down the MI commands into the FIFO file, using an editor.</font>
<div>&nbsp;</div>
</div>
<div>
<div class="moz-cite-prefix">Rodrigo,<br>
<br>
First of all, sorry for my last response. I was out of line. Appologies.<br>
<br>
A FIFO file is a pipe, not a regular file. You cannot edit it like a normal text file with vi, for instance. A FIFO is a special inode that transports data between a live process and the standart input. You can paste with &quot;echo&quot; lots of data into the FIFO file
 and the data will get to the running process in the FIFO way, first data in - first data out (to the process).<br>
<br>
If the process creating the FIFO file is run by root, you must be root that is sending the data to the file. If the process that is creating the FIFO file is not running, the file should not be left in the filesystem. So, if you try to edit (sic!) the file,
 while the creating process is not running, you will get something like &quot;file not found&quot;, or if you are trying to send data into the file as user rodrigo while the process is running as user root, you will get an error.<br>
<br>
I made an PHP script for my purpose, that is sending commands to my Opensips FIFO file and reading the result of that. The script is run by the same user as Opensips. If I try to run the script while Opensips is not running, the error always could be as &quot;file
 not found&quot;.<br>
<br>
If you are writing an C progam to send commands to the opensips FIFO file, first of all make sure you are running your program as the sam user as the Opensips. Second, make sure that Opensips is running. Then write and read results from that file in your C
 program.<br>
<br>
All the best,<br>
M.Ionut<br>
<br>
On 02/12/2015 18:47, Liviu Chircu wrote:<br>
</div>
<blockquote type="cite"><tt>Hi Rodrigo,<br>
<br>
Most likely you're starting opensips as root user, however you're attempting to write to the FIFO file on behalf of an unprivileged user.<br>
<br>
So either do &quot;sudo echo_to_file_command&quot; or just start OpenSIPS in unprivileged mode.<br>
<br>
Here's my FIFO file, I can write to it:<br>
<br>
</tt><tt>[liviu ◄ Rivendell ~]$ ls -la /tmp/opensips_fifo </tt><tt><br>
</tt><tt>prw------- 1 liviu liviu 0 dec&nbsp; 2 11:02 /tmp/opensips_fifo</tt><br>
<tt>
<meta name="qrichtext" content="1">
<br>
<br>
BR,<br>
</tt>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a id="LPlnk895187" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div style="margin-top: 20px; margin-bottom: 20px; overflow: auto; width: 100%;" id="LPBorder_GT_14490776502860.7225023811312591">
<table style="border-top: 1px solid rgb(204, 204, 204); border-bottom: 1px solid rgb(204, 204, 204); width: 80%; background-color: rgb(255, 255, 255); position: relative; overflow: auto;" id="LPContainer_14490776502830.6491129669627972">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td colspan="1" style="width: 250px; position: relative; display: table-cell; padding-right: 20px;" id="ImageCell_14490776502840.19783778667671603">
<div style="margin-top: 12px; background-color: rgb(255, 255, 255); height: 42px; width: 140px; position: relative; padding: 0px; display: table;" id="LPImageContainer_14490776502840.34940940390472164">
<a target="_blank" href="http://www.opensips-solutions.com/" style="display: table-cell; text-align: center;" id="LPImageAnchor_14490776502850.12645295543917778"><img aria-label="Imagem de visualização com link selecionado. Toque duas vezes para abrir o link." style="display: inline-block; margin-left: auto; margin-right: auto; max-width: 250px; max-height: 250px; height: 38px; width: 116px; border-width: 0px;" width="116" height="38" src="http://www.opensips-solutions.com/imgs/opensips-solutions-logo.gif"></a></div>
</td>
<td>
<div style="top: 0px; margin-top: 8px; font-size: 21px; font-family: &quot;wf_segoe-ui_semilight&quot;,&quot;Segoe UI Semilight&quot;,&quot;Segoe WP Semilight&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif; color: rgb(51, 51, 51); margin-left: 14px; margin-right: 14px;" id="LPTitle_14490776502860.5109765853601548">
Home — OpenSIPS Solutions</div>
<div style="margin-top: 8px; font-size: 13px; font-family: &quot;wf_segoe-ui_normal&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif; color: rgb(102, 102, 102); margin-left: 14px; margin-right: 14px;" id="LPDescription_14490776502860.5511807301841859">
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS is more than a SIP proxy/router as it includes application-level functionalities.</div>
<div style="margin: 8px 14px 10px; height: 18px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;" id="LPUrlContainer_14490776502860.18065194139505825">
<a target="_blank" href="http://www.opensips-solutions.com/" style="font-size: 11px; font-family: &quot;wf_segoe-ui_normal&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif; text-decoration: none;" id="LPUrlAnchor_14490776502860.3660986554287533">Leia mais...</a></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="moz-cite-prefix">On 02.12.2015 12:53, Rodrigo Pimenta Carvalho wrote:<br>
</div>
<blockquote type="cite">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Ok. thanks.</p>
<p><br>
</p>
<p>I will search about it in operational system context. I used to think that such fifo file was 100% supported by OpenSIPS. I didn't realize that it could be something of unix.</p>
<p><br>
</p>
<p>I'm kind of a beginner in unix or linux.</p>
<p><br>
</p>
<p>Regards.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri,
                sans-serif" color="#000000"><b>De:</b>
<a class="moz-txt-link-abbreviated" href="mailto:users-bounces@lists.opensips.org">
users-bounces@lists.opensips.org</a> <a class="moz-txt-link-rfc2396E" href="mailto:users-bounces@lists.opensips.org">
&lt;users-bounces@lists.opensips.org&gt;</a> em nome de Ionut Muntean <a class="moz-txt-link-rfc2396E" href="mailto:ionutm22@gmail.com">
&lt;ionutm22@gmail.com&gt;</a><br>
<b>Enviado:</b> terça-feira, 1 de dezembro de 2015 17:19<br>
<b>Para:</b> <a class="moz-txt-link-abbreviated" href="mailto:users@lists.opensips.org">
users@lists.opensips.org</a><br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How can I write down the MI commands into the FIFO file, using an editor.</font>
<div>&nbsp;</div>
</div>
<div>
<div class="moz-cite-prefix">Come on, read about FIFO in Linux, lot's of info on the net! Sorry, but you lack some basic Linux OS knowledge ... The FIFO is active and RW if the creating process is active and if you have the permissions to do this.<br>
<br>
On 01/12/2015 21:13, Rodrigo Pimenta Carvalho wrote:<br>
</div>
<blockquote type="cite">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Ok. Thanks.</p>
<p><br>
</p>
<p>But, if I cann't edit the file, how could a program (let's say a C program) write into such file?</p>
<p><br>
</p>
<p>I will create a executable that will have to write down MI commands into the FIFO file.</p>
<p><br>
</p>
<p>Any hint will be very helpful!</p>
<p>Thanks a lot!<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b>
<a class="moz-txt-link-abbreviated" href="mailto:users-bounces@lists.opensips.org">
</a><a class="moz-txt-link-abbreviated" href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>
<a class="moz-txt-link-rfc2396E" href="mailto:users-bounces@lists.opensips.org"></a><a class="moz-txt-link-rfc2396E" href="mailto:users-bounces@lists.opensips.org">&lt;users-bounces@lists.opensips.org&gt;</a> em nome de Brian ::
<a class="moz-txt-link-rfc2396E" href="mailto:bc@iptel.co">&lt;bc@iptel.co&gt;</a><br>
<b>Enviado:</b> terça-feira, 1 de dezembro de 2015 16:38<br>
<b>Para:</b> OpenSIPS users mailling list<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How can I write down the MI commands into the FIFO file, using an editor.</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">This is not the correct way to go about what you are trying to achieve.
<div><br>
</div>
<div>You *cant* edit the fifo file. You use (correctly configured) opensipsctl fifo to send commands in realtime</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Dec 1, 2015 at 5:04 PM, Rodrigo Pimenta Carvalho
<span dir="ltr">&lt;<a href="mailto:pimenta@inatel.br" target="_blank">pimenta@inatel.br</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px
                            #ccc solid; padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear OpenSIPS-users,</p>
<p><br>
</p>
<p>I my opensips.cfg I have:</p>
<p><br>
</p>
<p>---------------------------------------------------------</p>
<p><br>
</p>
<p>##### FIFO Management Interface<br>
loadmodule &quot;mi_fifo.so&quot;<br>
modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/FifoCommands.txt&quot;)&nbsp;&nbsp;&nbsp; # arquivo para ler comandos solicitados por aplicações externas.<br>
modparam(&quot;mi_fifo&quot;, &quot;reply_dir&quot;, &quot;/tmp&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # diretório onde serão escritas as respostas do OpenSIPS, que serão lidas pelas aplicações externas.<br>
modparam(&quot;mi_fifo&quot;, &quot;fifo_mode&quot;, 0777)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # permissão de scrita e leitura.<br>
modparam(&quot;mi_fifo&quot;, &quot;fifo_group&quot;, &quot;root&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # grupo de usuários para o arquivo.<br>
modparam(&quot;mi_fifo&quot;, &quot;fifo_user&quot;, &quot;root&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # usuário do arquivo.</p>
<p><br>
</p>
<p>----------------------------------------------------------</p>
<p><br>
</p>
<p><br>
</p>
<p>When OpenSIPS is not running, I can edit the file FifoCommands.txt using emacs or vi, for example.</p>
<p><br>
</p>
<p>However, when OpenSIPS is running I can not.&nbsp; The editor tells me that the file is read only Why? How to solve this? Any configuration?</p>
<p><br>
</p>
<p>Any hint will be very helpful!</p>
<p><br>
</p>
<p>Thanks a lot.</p>
<span class="HOEnZb"><font color="#888888">
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div>
<div name="divtagdefaultwrapper">
<div><font size="2">
<div>RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: <a href="tel:%2B55%2035%203471%209200" value="&#43;553534719200" target="_blank">
&#43;55 35 3471 9200</a> RAMAL 979<br>
</div>
</font></div>
</div>
</div>
</font></span></div>
</div>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
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>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
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>
</div>
</div>
</div>
</body>
</html>