<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<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 "echo" 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
"file not found", 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 "file
not found".<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 cite="mid:565F2093.5060907@opensips.org" type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<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 "sudo echo_to_file_command" 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 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 moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 02.12.2015 12:53, Rodrigo Pimenta
Carvalho wrote:<br>
</div>
<blockquote
cite="mid:BY2PR02MB1655DF012A0DD54AB115E06DB50E0@BY2PR02MB1655.namprd02.prod.outlook.com"
type="cite">
<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>
<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: +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" color="#000000" face="Calibri,
sans-serif"><b>De:</b> <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>
<a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:users-bounces@lists.opensips.org"><users-bounces@lists.opensips.org></a>
em nome de Ionut Muntean <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="mailto:ionutm22@gmail.com"><ionutm22@gmail.com></a><br>
<b>Enviado:</b> terça-feira, 1 de dezembro de 2015 17:19<br>
<b>Para:</b> <a moz-do-not-send="true"
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> </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: +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" color="#000000"
face="Calibri, sans-serif"><b>De:</b> <a
moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:users-bounces@lists.opensips.org">
<a class="moz-txt-link-abbreviated" href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a></a> <a
moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="mailto:users-bounces@lists.opensips.org">
</a><a moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="mailto:users-bounces@lists.opensips.org"><users-bounces@lists.opensips.org></a>
em nome de Brian :: <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="mailto:bc@iptel.co"> <bc@iptel.co></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> </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"><<a moz-do-not-send="true"
href="mailto:pimenta@inatel.br"
target="_blank">pimenta@inatel.br</a>></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 "mi_fifo.so"<br>
modparam("mi_fifo", "fifo_name",
"/tmp/FifoCommands.txt") # arquivo
para ler comandos solicitados por
aplicações externas.<br>
modparam("mi_fifo", "reply_dir",
"/tmp") #
diretório onde serão escritas as
respostas do OpenSIPS, que serão lidas
pelas aplicações externas.<br>
modparam("mi_fifo", "fifo_mode",
0777) #
permissão de scrita e leitura.<br>
modparam("mi_fifo", "fifo_group",
"root") # grupo de
usuários para o arquivo.<br>
modparam("mi_fifo", "fifo_user",
"root") # 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. 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
moz-do-not-send="true"
href="tel:%2B55%2035%203471%209200"
value="+553534719200"
target="_blank"> +55 35
3471 9200</a> RAMAL 979<br>
</div>
</font></div>
</div>
</div>
</font></span></div>
</div>
<br>
_______________________________________________<br>
Users mailing list<br>
<a moz-do-not-send="true"
href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a moz-do-not-send="true"
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 moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" 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 wrap="">_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" 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 wrap="">_______________________________________________
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>