Kamailio-开源SIP软交换平台

中国第一个专注Kamailio SIP 软交换技术分享平台

用户工具

站点工具


pua_xmpp_xmpp_extension_for_pua_simple-xmpp_presence_gateway_released

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

pua_xmpp_xmpp_extension_for_pua_simple-xmpp_presence_gateway_released [2017/09/11 16:17] (当前版本)
james_zhu 创建
行 1: 行 1:
 +====== Presence User Agent for XMPP (Presence gateway between SIP and XMPP) ======
  
 +==== Anca-Maria Vamanu ====
 +
 +Voice Sistem SRL\\ 
 +
 +=== Edited by ===
 +
 +==== Anca-Maria Vamanu ====
 +
 +Copyright © 2007 Voice Sistem SRL
 +
 +----
 +
 +**Table of Contents**
 +
 +  * **1. Admin Guide** ​
 +    * **1. Overview** ​
 +    * **2. Dependencies** ​
 +      * **2.1. Kamailio Modules** ​
 +      * **2.2. External Libraries or Applications** ​
 +    * **3. Parameters** ​
 +      * **3.1. server_address(str)** ​
 +    * **4. Functions** ​
 +      * **4.1. pua_xmpp_notify()** ​
 +      * **4.2. pua_xmpp_req_winfo(request_uri,​ expires)** ​
 +    * **5. Filtering** ​
 +  * **2. Developer Guide** ​
 +
 +**List of Examples**
 +
 +  * **1.1. Set server_address parameter** ​
 +  * **1.2. pua_xmpp_notify usage** ​
 +  * **1.3. xmpp_send_winfo usage** ​
 +
 +====== Chapter 1. Admin Guide ======
 +
 +**Table of Contents**
 +
 +  * **1. Overview** ​
 +  * **2. Dependencies** ​
 +    * **2.1. Kamailio Modules** ​
 +    * **2.2. External Libraries or Applications** ​
 +  * **3. Parameters** ​
 +    * **3.1. server_address(str)** ​
 +  * **4. Functions** ​
 +    * **4.1. pua_xmpp_notify()** ​
 +    * **4.2. pua_xmpp_req_winfo(request_uri,​ expires)** ​
 +  * **5. Filtering** ​
 +
 +===== 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.
 +
 +===== 2. Dependencies =====
 +
 +==== 2.1. Kamailio Modules ====
 +
 +The following modules must be loaded before this module:
 +
 +  * presence. ​
 +  * pua. 
 +  * xmpp. 
 +
 +==== 2.2. External Libraries or Applications ====
 +
 +The following libraries or applications must be installed before running Kamailio with this module loaded:
 +
 +  * libxml. ​
 +
 +===== 3. Parameters =====
 +
 +==== 3.1. server_address(str) ====
 +
 +The SIP URI specifying the address of the SIP server.
 +
 +**Example 1.1. Set ''​server_address''​ parameter**
 +
 +<​code>​
 +...
 +modparam("​pua_xmpp",​ "​server_address",​ "​sip:​160.23.23.10"​)
 +...
 +</​code>​
 +
 +\\ ===== 4. Functions =====
 +
 +Functions exported to be used in configuration file.
 +
 +==== 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. ''​pua_xmpp_notify''​ usage**
 +
 +<​code>​
 +...
 +        if( is_method("​NOTIFY"​) && uri=~"​sip:​.+@sip-xmpp.kamailio.org"​)
 +        {
 +                if(pua_xmpp_notify())
 +                        t_reply("​200",​ "​OK"​);​
 +                exit;
 +        }
 +...
 +</​code>​
 +
 +\\ ==== 4.2. pua_xmpp_req_winfo(request_uri,​ 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**
 +
 +<​code>​
 +...
 +        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();​
 +        }
 +
 +...
 +</​code>​
 +
 +\\ ===== 5. 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 Guide ======
 +
 +The module provides no function to be used in other Kamailio modules.
pua_xmpp_xmpp_extension_for_pua_simple-xmpp_presence_gateway_released.txt · 最后更改: 2017/09/11 16:17 由 james_zhu