Table of Contents
db_url
(string)jaddress
(string)jport
(integer)jdomain
(string)aliases
(string)proxy
(string)registrar
(string)workers
(integer)max_jobs
(integer)cache_time
(integer)delay_time
(integer)sleep_time
(integer)check_time
(integer)priority
(str)List of Tables
List of Examples
db_url
parameterjaddress
parameterjport
parameterjdomain
parameterjdomain
parameterproxy
parameterregistrar
parameterworkers
parametermax_jobs
parametercache_time
parameterdelay_time
parametersleep_time
parametercheck_time
parameterpriority
parameterjab_send_message()
usagejab_join_jconf()
usagejab_exit_jconf()
usagejab_go_online()
usagejab_go_offline()
usageThis is new version of Jabber module that integrates XODE XML parser for parsing Jabber messages. That introduces a new module dependency: expat library.
Expat is a common XML library and is the fastest available for Linux/Unix, the second over all, after msxml library. It is integrated in most of well known Linux distributions.
Presence support (see doc/xxjab.cfg for a sample cfg file) (January 2003).
SIP to Jabber conference support (December 2003).
Possibility to manage all kinds of Jabber messages (message/presence/iq) (December 2003).
Aliases -- Possibility to set host aliases for addresses (see parameter's desc.) (December 2003).
Send received SIP MESSAGE messages to different IM networks (Jabber, ICQ,MSN, AIM, Yahoo) using a Jabber server (December 2003).
Send incoming Jabber instant messages as SIP MESSAGE messages.
Gateways detection -- Ability to see whether an IM gateway is up or down.
A more complete guide about SIMPLE2Jabber gateway can be found at https://opensips.org/. The part below will be removed soon, only the manual from web will be updated.
The Jabber server setup is not a subject of this guide. Check http://www.jabber.org for that.
Useful scripts, for creating Jabber Gateway database, or for managing the Jabber accounts form web are located in 'doc' subdirectory of the module.
Main steps of using the Jabber gateway:
Create the MySQL database.
Setup the local Jabber server.
Set the module parameter values in cfg file of OpenSIPS, load the dependent modules, set up the routing rules for Jabber gateway.
Run OpenSIPS.
The administrator of OpenSIPS/Jabber gateway must inform the users what are the aliases for Jabber/Other IM networks. Other IMs could be AIM, ICQ, MSN, Yahoo, and so on.
These aliases depend on the server hostname where runs OpenSIPS and how local Jabber server is setup.
Next is presented a use case. Prologue:
OpenSIPS is running on “server.org”.
Local Jabber server is running on “jabsrv.server.org”.
Jabber network alias (first part of “jdomain”) is “jabber.server.org”
The aliases for other IM networks must be the same as JID set in Jabber configuration file for each IM transport.
The JIDs of Jabber transports must start with the name of the network. For AIM, JID must start with “aim.”, for ICQ with “icq” (that because I use icqv7-t), for MSN with “msn.” and for Yahoo with “yahoo.”. The gateway needs these to find out what transport is working and which not. For our use case these could be like “aim.server.org”, “icq.server.org”, “msn.server.org”, “yahoo.server.org”.
It is indicated to have these aliases in DNS, thus the client application can resolve the DNS name. Otherwise there must be set the outbound proxy to OpenSIPS server.
*** Routing rules for Jabber gateway First step is to configure OpenSIPS to recognize messages for Jabber gateway. Look at “doc/xjab.cfg” to see a sample. The idea is to look in messages for destination address and if it contains Jabber alias or other IM alias, that means the message is for Jabber gateway.
Next step is to find out what means that message for Jabber gateway. It could be a special message what triggers the gateway to take an action or is a simple message which should be delivered to Jabber network (using the method “jab_send_message”).
The special messages are for:
Registering to Jabber server (go online in Jabber network)--here must be called “jab_go_online” method.
Leaving the Jabber network (go offline in Jabber network)--here must be called “jab_go_offline” method.
Joining a Jabber conference room--here must be called “jab_join_jconf”.
Leaving a Jabber conference room--here must be called “jab_exit_jconf”.
The destination address must follow the following patterns:
For Jabber network: “username<delim>jabber_server@jabber_alias”.
For Jabber conference: “nickname<delim>room<delim>conference_server@jabber_alias”.
For AIM network: “aim_username@aim_alias”.
For ICQ network: “icq_number@icq_alias”.
For MSN network: “msn_username<delim>msn_server@msn_alias”. msn_server can be “msn.com” or “hotmail.com”.
For YAHOO network: “yahoo_username@yahoo_alias”.
“jabber_alias” is the first part of “jdomain”.
The user must activate his Jabber account associated with his SIP id. For each other IM network on which he wants to send messages, he must set an account for that IM network. The gateway is not able to create new account in foreign networks, excepting local Jabber server.
When you want to send a message to someone in other IM network, you must set the destination of the message according with the pattern corresponding to that IM network (see last part of “Admin guide” chapter).
Sending a message to user@jabber.xxx.org which is in Jabber network, the destination must be: user<delim>jabber.xxx.org@jabber_alias.
For someone who is in Yahoo network the destination must be: user@yahoo_alias
The OpenSIPS administrator have to set the Jabber transports for each IM network in order to be able to send messages to those networks. The alias of each IM network can be found out from OpenSIPS admin.
You cannot send messages from your SIP client to your associated Jabber account--is something like sending messages to yourself.
The following modules must be loaded before this module:
A database module.
pa (Optionally) - Presence Agent.
tm - Transaction Manager.
SQL URL of database.
Default value is “mysql://root@127.0.0.1/sip_jab”.
Example 1.1. Set db_url
parameter
... modparam("jabber", "db_url", "mysql://username:password@host/sip_jab") ...
IP or hostname of Jabber server -- it must be the same as the value from <host> tag of Jabber server config file.
Default value is “127.0.0.1”.
Port number of Jabber server.
Default value is “5222”.
Format: jabber.sipserver.com=<delim>. If the destination is for Jabber network the URI should be like: username<delim>jabber_server@jdomain or nickname<delim>roomname<delim>conference_server@jdomain
<delim> must be a un-reserved character. By default this character is * . The destination will be transformed to username@jabber_server or roomname@conference_server/nickname before the message is sent to Jabber server.
Default value is none.
Aliases for IM networks.
Format: “N;alias1=<delim1>;...;aliasN=<delimN>;” Destinations like '*@aliasX' could have other format than those specified for Jabber network. All <delim> from user part of the destination address will be changed to <delimX> if the destination address contains <aliasX>.
(Ex: jdomain is 'jabber.x.com=*' and msn_alias is 'msn.x.com=%'. The destination address forM MSN Network, on SIP side, is like 'username*hotmail.com@msn.x.com'. The destination address will be transformed to 'username%hotmail.com@msn.x.com'. 'msn.x.com' must be the same as the JID associated with MSN transport in Jabber configuration file (usually is 'jabberd.xml'))
Default value is none.
Outbound proxy address.
Format: ip_address:port hostname:port
All SIP messages generated by gateway will be sent to that address. If is missing, the message will be delivered to the hostname of the destination address
Default value is none.
Example 1.6. Set proxy
parameter
... modparam("jabber", "proxy", "10.0.0.1:5060 sipserver.com:5060") ...
The address in whose behalf the INFO and ERROR messages are sent.
Default value is “jabber_gateway@127.0.0.1”.
Example 1.7. Set registrar
parameter
... modparam("jabber", "registrar", "jabber_gateway@127.0.0.1") ...
Number of workers.
Default value is 2.
Maximum jobs per worker.
Default value is 10.
Cache time of a Jabber connection.
Default value is 600.
Time to keep a SIP message (in seconds).
Default value is 90 seconds.
Time between expired Jabber connections checking (in seconds).
Default value is 20 seconds.
Time between checking the status of JabberGW workers (in seconds).
Default value is 20 seconds.
Converts SIP MESSAGE message to a Jabber message and sends it to Jabber server.
This function can be used from REQUEST_ROUTE.
Join a Jabber conference--the nickname, room name and conference server address should be included in To header as: nickname%roomname%conference_server@jdomain . If the nickname is missing, then the SIP username is used.
This function can be used from REQUEST_ROUTE.
Leave a Jabber conference--the nickname, room name and conference server address should be included in To header as: nickname%roomname%conference_server@jdomain .
This function can be used from REQUEST_ROUTE.
Register to the Jabber server with associated Jabber ID of the SIP user.
This function can be used from REQUEST_ROUTE.
Table 2.1. Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
Name | DevScore | Commits | Lines ++ | Lines -- | |
---|---|---|---|---|---|
1. | Daniel-Constantin Mierla (@miconda) | 378 | 80 | 19649 | 8172 |
2. | Bogdan-Andrei Iancu (@bogdan-iancu) | 55 | 33 | 1383 | 558 |
3. | Jan Janak (@janakj) | 33 | 15 | 1007 | 498 |
4. | Razvan Crainea (@razvancrainea) | 23 | 21 | 71 | 51 |
5. | Andrei Pelinescu-Onciul | 19 | 12 | 101 | 336 |
6. | Liviu Chircu (@liviuchircu) | 15 | 11 | 72 | 136 |
7. | Vlad Patrascu (@rvlad-patrascu) | 6 | 4 | 35 | 12 |
8. | Jiri Kuthan (@jiriatipteldotorg) | 6 | 3 | 313 | 0 |
9. | Maksym Sobolyev (@sobomax) | 5 | 3 | 6 | 6 |
10. | Peter Lemenkov (@lemenkov) | 4 | 2 | 33 | 8 |
All remaining contributors: Henning Westerholt (@henningw), Alexandra Titoc, Elena-Ramona Modroiu, Jamey Hicks, Konstantin Bokarius, John Riordan, Vlad Paiu (@vladpaiu), Julián Moreno Patiño, Klaus Darilion, Zero King (@l2dy), Edson Gellert Schubert.
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits. Regarding imported patches/code, we do our best to count the work on behalf of the proper owner, as per the "fix_authors" and "mod_renames" arrays in opensips/doc/build-contrib.sh. If you identify any patches/commits which do not get properly attributed to you, please submit a pull request which extends "fix_authors" and/or "mod_renames".
(3) ignoring whitespace edits, renamed files and auto-generated files
Table 2.2. Most recently active contributors(1) to this module
Name | Commit Activity | |
---|---|---|
1. | Razvan Crainea (@razvancrainea) | Aug 2015 - Sep 2024 |
2. | Alexandra Titoc | Sep 2024 - Sep 2024 |
3. | Liviu Chircu (@liviuchircu) | Mar 2014 - May 2024 |
4. | Vlad Patrascu (@rvlad-patrascu) | May 2017 - May 2023 |
5. | Maksym Sobolyev (@sobomax) | Oct 2022 - Feb 2023 |
6. | Bogdan-Andrei Iancu (@bogdan-iancu) | Jun 2002 - Apr 2020 |
7. | Zero King (@l2dy) | Mar 2020 - Mar 2020 |
8. | Peter Lemenkov (@lemenkov) | May 2007 - Jun 2018 |
9. | Julián Moreno Patiño | Feb 2016 - Feb 2016 |
10. | Vlad Paiu (@vladpaiu) | Feb 2012 - Feb 2012 |
All remaining contributors: John Riordan, Klaus Darilion, Henning Westerholt (@henningw), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Elena-Ramona Modroiu, Jan Janak (@janakj), Andrei Pelinescu-Onciul, Jamey Hicks, Jiri Kuthan (@jiriatipteldotorg).
(1) including any documentation-related commits, excluding merge commits
Last edited by: Liviu Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu), Bogdan-Andrei Iancu (@bogdan-iancu), Peter Lemenkov (@lemenkov), Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Elena-Ramona Modroiu, Jan Janak (@janakj).
Documentation Copyrights:
Copyright © 2003 FhG FOKUS