<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=x-gbk" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Donny,<br>
    <br>
    you can actually get access to the body directly from script (no
    need to code) via the $rb variable (see
    <a class="moz-txt-link-freetext" href="http://www.opensips.org/Resources/DocsCoreVar17#toc63">http://www.opensips.org/Resources/DocsCoreVar17#toc63</a>).<br>
    <br>
    So you can do like:<br>
    <br>
    if (is_method("MESSAGE") &amp;&amp; has_body("text/plain") ) {<br>
    &nbsp;&nbsp;&nbsp;&nbsp; if ( $rb == "createRoom" ) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// do DB to create the room<br>
    &nbsp;&nbsp;&nbsp; }<br>
    }<br>
    <br>
    For IM chatting via opensips, you may take a look also at IMC module
    (<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.7.x/imc.html">http://www.opensips.org/html/docs/modules/1.7.x/imc.html</a>)<br>
    <br>
    Regards,<br>
    Bogdan<br>
    <br>
    On 11/19/2011 01:09 PM, ½¯¶«Ã÷ wrote:
    <blockquote cite="mid:tencent_51F6609847AD088603C91532@qq.com"
      type="cite">
      <div>As&nbsp;we all&nbsp;known, Opensips is easy to extend. </div>
      <div>Now I want to extend the Opensips with MESSAGE method like
        this:</div>
      <div>&nbsp;&nbsp;&nbsp;&nbsp; I want to using the message body&nbsp;in the&nbsp;MESSAGE request
        method, the&nbsp;SIP message is &nbsp;such like below(just an half-baked
        example):</div>
      <div>&nbsp;</div>
      <div><em><strong>MESSAGE</strong> <a class="moz-txt-link-abbreviated" href="mailto:SIP:user1@domain.com">SIP:user1@domain.com</a> SIP/2.0<br>
          Via: SIP/2.0/UDP ......</em></div>
      <div><em>Max-Forwards:70<br>
          From: ......;tag=49583<br>
          To: ......</em></div>
      <div><em>Call-ID:...... </em></div>
      <div><strong><em>CSeq: 1 MESSAGE<br>
            Content-Type:text/plain<br>
            Content-Length:&nbsp;10&nbsp; </em></strong></div>
      <div><strong><em>createRoom</em></strong></div>
      <div>&nbsp;</div>
      <div>this sip message will be send to Opensips by a UAC. </div>
      <div>What I want to ask for help is----</div>
      <div><strong>How should I modify the source code of opensips</strong>&nbsp;to
        extend my Opensips can process this&nbsp;message?</div>
      <div>The process means when my Opensips received this message,&nbsp;</div>
      <div>it can parser the sip message and&nbsp;get the message body
        "createRoom",</div>
      <div>and then call the DB module to create a conference room in
        the local DB(such as mysql).</div>
      <div>&nbsp;</div>
      <div>any suggestions?(how and where to get the message body? where
        to parser the message body "createRoom"? and so on...)</div>
      <div>&nbsp;</div>
      <div>many thanks &amp; Best Regards,</div>
      <div>donny</div>
      <div>&nbsp;</div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and "know-how"</pre>
  </body>
</html>