<!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") && has_body("text/plain") ) {<br>
if ( $rb == "createRoom" ) {<br>
/// do DB to create the room<br>
}<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 we all known, Opensips is easy to extend. </div>
<div>Now I want to extend the Opensips with MESSAGE method like
this:</div>
<div> I want to using the message body in the MESSAGE request
method, the SIP message is such like below(just an half-baked
example):</div>
<div> </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: 10 </em></strong></div>
<div><strong><em>createRoom</em></strong></div>
<div> </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> to
extend my Opensips can process this message?</div>
<div>The process means when my Opensips received this message, </div>
<div>it can parser the sip message and 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> </div>
<div>any suggestions?(how and where to get the message body? where
to parser the message body "createRoom"? and so on...)</div>
<div> </div>
<div>many thanks & Best Regards,</div>
<div>donny</div>
<div> </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>