[OpenSIPS-Users] Send SIP MESSAGE

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Dec 20 06:53:17 CET 2012


Hi,

The problem is that your opensips runs as UNIX user 'foo' (let's say) 
which has no write permissions over the fifo reply file which is create 
by your php script (under user 'bar').

So, what you need to do is to be sure, from file permissions 
perspective, that opensips can write into the fifo created by your script.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 12/20/2012 12:30 AM, Dragomir Haralambiev wrote:
> Hi Bogdan,
> I rewrite send_im.php in Perl but I receive follow message:
>
> ERROR:mi_fifo:get_reply_filename: forbidden filename: webfifo_0.347865528267906
> ERROR:mi_fifo:mi_fifo_server: trimming filename
> DBG:mi_fifo:mi_fifo_server: entered consume
> DBG:mi_fifo:mi_fifo_server: **** done consume
>
> Here is Perl script:
>
> #!/usr/bin/perl
>
> $web_contact="sip:daemon at mydomain.net";
> $fifo="/tmp/opensips_fifo";
> $signature="web_im_0.1.0";
>
> #/* open reply fifo */
> $myfilename="webfifo_".rand();
> $mypath="/tmp/".$myfilename;
> $outbound_proxy=".";
>
> $sip_address = "555888";
> $instant_message = "Hello opensips";
>
> system("mkfifo -m 666 ".$mypath );
>
> #/* construct FIFO command */
>
> $fifo_cmd=":t_uac_dlg:".$myfilename."\n".
>      "MESSAGE\n".
>      $sip_address."\n".
> 	$outbound_proxy."\n".
>      ".\n".
>      "\"From: ".$web_contact."\r\n".
> 	"To: ".$sip_address."\r\n".
> 	"p-version: ".$signature."\r\n".
>      "Contact: ".$web_contact."\r\n".
>      "Content-Type: text/plain; charset=UTF-8\r\n".
>      "\"\n".
>      "\"".$instant_message."\"".
>    	"\n\n";
>
> #/* create fifo for replies */
>
> open (FIFO, ">  $fifo");
>
> print FIFO $fifo_cmd;
> close FIFO;
> unlink($mypath);
>
>
>
>
> 2012/12/19 Bogdan-Andrei Iancu<bogdan at opensips.org>
>> Hi Dragomir,
>>
>> Use the MI command t_uac_dlg - http://www.opensips.org/html/docs/modules/1.8.x/tm.html#id294568
>>
>> In the sources tree, there is an example in php : examples/web_im/send_im.php
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developer
>> http://www.opensips-solutions.com
>>
>>
>> On 12/19/2012 04:25 PM, Dragomir Haralambiev wrote:
>>
>> Hello,
>>
>> I need to send SIP MESSAGE to new registered user.
>>
>> How to do that using opensips 1.8.2?
>>
>> Best regards,
>> PlayMen
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list