Copyright © 2007 voice-system.ro
Revision History | |
---|---|
Revision $Revision: 1499 $ | $Date: 2007-03-12 14:05:57 +0200 (Fri, 12 Jan 2007) $ |
Table of Contents
List of Examples
This module is a gateway for presence between SIP and XMPP.
It translates one format into another and uses xmpp, pua and presence modules to manage the transmition of presence state information.
The following modules must be loaded before this module:
presence.
pua.
xmpp.
Functions exported to be used in configuration file.
Function that handles Notify messages addressed to a user from an xmpp domain. It requires filtering after method and domain in configuration file. If the function is successful, a 2xx reply must be sent.
This function can be used from REQUEST_ROUTE.
Example 1.2. pua_xmpp_notify
usage
... if( is_method("NOTIFY") && uri=~"sip:.+@sip-xmpp.kamailio.org") { if(pua_xmpp_notify()) t_reply("200", "OK"); exit; } ...
Function called when a Subscribe addressed to a user from a xmpp domain is received. It calls sending a Subscribe for winfo for the user, and the following Notify with dialog-info is translated into a subscription in xmpp. It also requires filtering in configuration file, after method, domain and event(only for presence).
It takes 2 parameters: request_uri and the value of Expires header field in received Subscribe.
This function can be used from REQUEST_ROUTE.
Example 1.3. xmpp_send_winfo
usage
... if( is_method("SUBSCRIBE")) { handle_subscribe(); if(uri=~"sip:.+@sip-xmpp.siphub.ro" && $hdr(Event)== "presence") { pua_xmpp_req_winfo("$ruri", "$hdr(Expires)"); } t_release(); } ...