Hi Donny,

you can actually get access to the body directly from script (no need to code) via the $rb variable (see http://www.opensips.org/Resources/DocsCoreVar17#toc63).

So you can do like:

if (is_method("MESSAGE") && has_body("text/plain") ) {
if ( $rb == "createRoom" ) {
/// do DB to create the room
}
}

For IM chatting via opensips, you may take a look also at IMC module (http://www.opensips.org/html/docs/modules/1.7.x/imc.html)

Regards,
Bogdan

On 11/19/2011 01:09 PM, ?????? wrote:
As we all known, Opensips is easy to extend.
Now I want to extend the Opensips with MESSAGE method like this:
I want to using the message body in the MESSAGE request method, the SIP message is such like below(just an half-baked example):
/*MESSAGE* SIP:[email protected] SIP/2.0
Via: SIP/2.0/UDP ....../
/Max-Forwards:70
From: ......;tag=49583
To: ....../
/Call-ID:...... /
*/CSeq: 1 MESSAGE
Content-Type:text/plain
Content-Length: 10 /*
*/createRoom/*
this sip message will be send to Opensips by a UAC.
What I want to ask for help is----
*How should I modify the source code of opensips* to extend my Opensips can process this message?
The process means when my Opensips received this message,
it can parser the sip message and get the message body "createRoom",
and then call the DB module to create a conference room in the local DB(such as mysql). any suggestions?(how and where to get the message body? where to parser the message body "createRoom"? and so on...)
many thanks & Best Regards,
donny


_______________________________________________
Devel mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and "know-how"

_______________________________________________
Devel mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

Reply via email to