[OpenSIPS-Devel] How to extend opensips
Bogdan-Andrei Iancu
bogdan at opensips.org
Thu Jan 5 13:29:42 CET 2012
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:user1 at domain.com 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
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and "know-how"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20120105/c179b59d/attachment-0001.htm>
More information about the Devel
mailing list