Presence User Agent for XMPP (Presence gateway between SIP and XMPP) Anca-Maria Vamanu voice-system.ro Edited by Anca-Maria Vamanu Copyright © 2007 voice-system.ro __________________________________________________________ Table of Contents 1. User's Guide 1.1. Overview 1.2. Dependencies 1.2.1. OpenSER Modules 1.2.2. External Libraries or Applications 1.3. Exported Parameters 1.3.1. server_address(str) 1.4. Exported Functions 1.4.1. pua_xmpp_notify() 1.4.2. pua_xmpp_req_winfo(char* request_uri, char* expires) 1.4.3. Filtering 2. Developer's Guide 3. Frequently Asked Questions List of Examples 1-1. Set server_address parameter 1-2. Notify2Xmpp usage 1-3. xmpp_send_winfo usage __________________________________________________________ Chapter 1. User's Guide 1.1. Overview 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. __________________________________________________________ 1.2. Dependencies 1.2.1. OpenSER Modules The following modules must be loaded before this module: * presence. * pua. * xmpp. __________________________________________________________ 1.2.2. External Libraries or Applications The following libraries or applications must be installed before running OpenSER with this module loaded: * libxml. __________________________________________________________ 1.3. Exported Parameters 1.3.1. server_address(str) The IP address of the server. Example 1-1. Set server_address parameter ... modparam("pua_xmpp", "server_address", "160.23.23.10") ... __________________________________________________________ 1.4. Exported Functions Functions exported to be used in configuration file. __________________________________________________________ 1.4.1. pua_xmpp_notify() 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. Notify2Xmpp usage ... if( is_method("NOTIFY") && uri=~"sip:.+@sip-xmpp.siphub.ro") { if(Notify2Xmpp()) t_reply("200", "OK"); exit; } ... __________________________________________________________ 1.4.2. pua_xmpp_req_winfo(char* request_uri, char* expires) 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)== "p resence") { pua_xmpp_req_winfo("$ruri", "$hdr(Expires)"); } t_release(); } ... __________________________________________________________ 1.4.3. Filtering Instead of "sip-xmpp.siphub.ro" in the example you should use the value set for the xmpp module parameter named 'gateway_domain'. __________________________________________________________ Chapter 2. Developer's Guide The module provides no function to be used in other OpenSER modules. __________________________________________________________ Chapter 3. Frequently Asked Questions 3.1. Where can I find more about OpenSER? 3.2. Where can I post a question about this module? 3.3. How can I report a bug? 3.1. Where can I find more about OpenSER? Take a look at http://www.openser.org/. 3.2. Where can I post a question about this module? First at all check if your question was already answered on one of our mailing lists: * User Mailing List - http://lists.openser.org/cgi-bin/mailman/listinfo/users * Developer Mailing List - http://lists.openser.org/cgi-bin/mailman/listinfo/devel E-mails regarding any stable OpenSER release should be sent to <users@lists.openser.org> and e-mails regarding development versions should be sent to <devel@lists.openser.org>. If you want to keep the mail private, send it to <team@lists.openser.org>. 3.3. How can I report a bug? Please follow the guidelines provided at: http://sourceforge.net/tracker/?group_id=139143.