[Serusers] How to send instant message programmatically

Evan Borgström evan.borgstrom at ca.mci.com
Wed Jul 19 22:44:17 CEST 2006


	Also check out the fifo interface to the TM module, it allows you to 
generate a message and inject it for processing from the command line by 
writing to the fifo ser opens. And I quote:

1.4.18. External Usage of TM 
 
 

 
 
 

    There are applications which would like to generate SIP 
 
 

    transactions without too big involvement in SIP stack, 
 
 

    transaction management, etc. An example of such an application 
 
 

    is sending instant messages from a website. To address needs 
 
 

    of such apps, SER accepts requests for new transactions via 
 
 

    fifo pipes too. If you want to enable this feature, start FIFO 
 
 

    server with configuration option. 
 
 

 
 
 

    fifo="/tmp/ser_fifo" 
 
 

 
 
 

    Then, an application can easily launch a new transaction by 
 
 

    writing a transaction request to this named pipe. The request 
 
 

    must follow very simple format, which is 
 
 

  :t_uac_from:[<file_name>]\n 
 
 

  <method>\n 
 
 

  <sender's uri>\n 
 
 

  <dst uri>\n 
 
 

  <CR_separated_headers>\n 
 
 

  <body>\n 
 
 

  .\n 
 
 

  \n 
 
 

 
 
 

    (Filename is to where a report will be dumped. ser assumes 
 
 

    /tmp as file's directory.) 
 
 

 
 
 

    Note the the request write must be atomic, otherwise it might 
 
 

    get intermixed with writes from other writers. You can easily 
 
 

    use it via Unix command-line tools, see the following example: 
 
 

[jiri at bat jiri]$ cat > /tmp/ser_fifo 
 
 

:t_uac_from:xxx 
 
 

MESSAGE 
 
 

sip:sender at iptel.org 
 
 

sip:mrx at iptel.org 
 
 

header:value 
 
 

foo:bar 
 
 

bznk:hjhjk 
 
 

p_header: p_value 
 
 

 
 
 

body body body 
 
 

yet body 
 
 

end of body 
 
 

. 
 
 

 
 
 

    or cat test/transaction.fifo > /tmp/ser_fifo


-Evan

Greger V. Teigre wrote:
> You are better off generating the message outside SER. SER is not a UAS. 
> Have a look at sipsak or sipp (both found at sourceforge, I think).
> g-)
> 
> srinivas.sriram at wipro.com wrote:
>>
>> Hello,
>>
>>  
>>
>> I am using SER-0.9.6.  How to send instant message programmatically, 
>> how to build sip message and which function can by used(like t_uac, 
>> t_request).
>>
>> Can you help where and which to be changed in ser code.
>>
>>  
>>
>> Thank you,
>>
>>                                                                       
>>  
>>
>>  
>>
>> Regards,
>>
>> Sriram Srinivas.
>>
>>
>> The information contained in this electronic message and any 
>> attachments to this message are intended for the exclusive use of the 
>> addressee(s) and may contain proprietary, confidential or privileged 
>> information. If you are not the intended recipient, you should not 
>> disseminate, distribute or copy this e-mail. Please notify the sender 
>> immediately and destroy all copies of this message and any attachments.
>>
>> WARNING: Computer viruses can be transmitted via email. The recipient 
>> should check this email and any attachments for the presence of 
>> viruses. The company accepts no liability for any damage caused by any 
>> virus transmitted by this email.
>>
>> www.wipro.com
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Serusers mailing list
>> Serusers at lists.iptel.org
>> http://lists.iptel.org/mailman/listinfo/serusers
>>   
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Serusers mailing list
> Serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers



More information about the sr-users mailing list