NEW SIP-to-XMPP (Google Talk/Jabber) gateway
|
| Author |
Message |
openser
Joined: Jun 17, 2005
Posts: 274
Status: Offline
|
| Posted:
Sep 26, 2006 - 11:55 AM |
|
Thanks to Andrea Spirea, a new SIP-to-XMPP gateway was included in OpenSER. There is a new module, XMPP, which enables SIP users to chat with any XMPP user (Google Talk, Jabber) user in the world.
The design permits flexibility in configuration and deployments, the new module can at alone as a XMPP server or can work in tandem with a standalone XMPP server (for more complex communication scenarios like TLS ...). Also, the module can be plugged in your main SIP server or can be deployed alone, enabling in a easy manner geographic distribution and redundancy.
There is no need of mapping SIP addresses to XMPP addresses, no need to store translation profiles, everything is done in the fly. The conversation will survive to restarts, the session being recovered form the messages. As a result, there is no need of a persistent storage, the footprint is very small, embedding the gateway in small devices should be straightforward.
The news is posted here:
http://www.openser.org/index.php?option ... p;Itemid=9
Module's documentation:
http://www.openser.org/docs/modules/1.2.x/xmpp.html
Feedback will be very appreciated, the next steps are to enhance the standalone-xmpp-server version of the module with other features of a xmpp server and to add support for presence and voice. Testing and reports are always welcome. |
|
|
|
 |
gaqian
Joined: Apr 16, 2008
Posts: 8
Status: Offline
|
| Posted:
Apr 16, 2008 - 02:53 PM |
|
|
I have setup the openser server with the very basic default configuration. Now I have to configure my openser server to connect with a xmpp envoironment on another host with a purpose of piloting the SIP SIMPLE - XMPP IOP.
Could you please provide me some example of how to configure openser to connect with a external XMPP environment?
Thanks in advance. |
|
|
|
 |
x-console
Site Admin
Joined: Aug 01, 2006
Posts: 1134
Location: Leeds UK
Status: Offline
|
| Posted:
Apr 16, 2008 - 05:39 PM |
|
there are example snippets and a full explanation in the module docs linked (these are actually out of date now.. current stable is here) |
|
|
|
 |
gaqian
Joined: Apr 16, 2008
Posts: 8
Status: Offline
|
| Posted:
Apr 16, 2008 - 10:08 PM |
|
|
Thank you for your hints. I have read through this document. But still I have some queries about the module:
1. As I have a standalone XMPP running in some other environment than my openser server, I need to choose the component mode. Why do I need a gateway and a xmpp component, as I understand they are the same thing. What is the XMPP component mean here? Isn't there only three parts needed in this mode:
Main openser sip server + gateway(another openser instance) + standalone XMPP server
2. In the configuration example, if I understand right, this is for configure another Openser instance as a gateway in different port on the same host with the main openser sip server. But how do I configure the main sip server send only the adequate sip messages to XMPP GW as commented in the conf file.
3. What do I need to configure the XMPP server to be connected with the gateway or the main openser sip server?
Thanks in advance. |
|
|
|
 |
x-console
Site Admin
Joined: Aug 01, 2006
Posts: 1134
Location: Leeds UK
Status: Offline
|
| Posted:
Apr 17, 2008 - 09:35 AM |
|
| Quote: | | Why do I need a gateway and a xmpp component, as I understand they are the same thing |
They are separate services within the same application. the reference to the gateway is to the openser instance that sends/receives SIP. the component is the xmpp module that translates sip<->xmpp.
| Quote: | | In the configuration example, if I understand right, this is for configure another Openser instance as a gateway in different port on the same host with the main openser sip server. |
As I read it, its an example of a standalone gateway (server mode.. so no xmpp gateway required) for translating SIP MESSAGE requests. If you have a separate xmpp server, you need to have the modparam statements set accordingly.
| Quote: | | What do I need to configure the XMPP server to be connected with the gateway or the main openser sip server? |
It depends on your xmpp server |
|
|
|
 |
gaqian
Joined: Apr 16, 2008
Posts: 8
Status: Offline
|
| Posted:
Apr 17, 2008 - 11:39 AM |
|
|
Thank you for your response.
So in case I have a separate XMPP server, I will need to module(XMPP) install a 1.3 version of openser and configure xmpp module working in component mode then.
But the problem now is, I setup a main operational openser server(1.1.0 notls i386/linux) on my fc 5 host. But XMPP module is only living in 1.2 and above. So is that possible if I keep the 1.1.0 openser running as a main sip server, and install another 1.2/1.3 openser with XMPP module on the same host, and configure it to be a gateway and xmpp component to transfer and translate sip messages?
Could you look at my conf to point me if it is correct?
gateway openser 1.3 xmpp:
openser.cfg
debug=9 # debug level (cmd line: -dddddddddd)
fork=no
log_stderror=yes # (cmd line: -E)
/* Uncomment these lines to enter debugging mode
fork=no
log_stderror=yes
*/
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
children=4
listen=udp:193.210.148.245:5076
alias=193.210.148.245
# ------------------ module loading ----------------------------------
mpath="/usr/local/openser-1.1.0-xmpp/lib/openser/modules/"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
# XMPP
loadmodule "xmpp.so"
modparam("xmpp", "domain_separator", "*")
modparam("xmpp", "gateway_domain", "193.210.148.245")
modparam("xmpp", "xmpp_domain", "193.210.148.245")
modparam("xmpp", "xmpp_host", "myxmpp.org")
# modparam("xmpp", "backend", "server")
modparam("xmpp", "backend", "component")
# ----------------- setting module-specific parameters ---------------
# -- mi_fifo params --
modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo_xmpp")
# -- usrloc params --
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
# ------------------------- request routing logic -------------------
# main routing logic
route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
exit;
};
### absorb retransmissions ###
if (!t_newtran()) {
sl_reply_error();
return;
}
if (method == "MESSAGE") {
log("*** xmpp-handled MESSAGE message.\n");
if (xmpp_send_message()) {
t_reply("200", "Accepted");
} else {
t_reply("404", "Not found");
}
return;
}
log("*** xmpp: unhandled message type\n");
t_reply("503", "Service unavailable");
return;
}
And here it is my main openser 1.1.0 notls conf.
debug=7 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no # (cmd line: -E)
log_facility=LOG_LOCAL7
/*
Uncomment these lines to enter debugging mode
fork=no
log_stderror=yes
*/
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/openser_fifo"
#
# uncomment the following lines for TLS support
#disable_tls = 0
#listen = tls:your_IP:5061
#tls_verify = 1
#tls_require_certificate = 0
#tls_method = TLSv1
#tls_certificate = "/usr/local/etc/openser/tls/user/user-cert.pem"
#tls_private_key = "/usr/local/etc/openser/tls/user/user-privkey.pem"
#tls_ca_list = "/usr/local/etc/openser/tls/user/user-calist.pem"
# ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database
loadmodule "/usr/lib/openser/modules/mysql.so"
loadmodule "/usr/local/lib/openser/modules/sl.so"
loadmodule "/usr/local/lib/openser/modules/tm.so"
loadmodule "/usr/local/lib/openser/modules/rr.so"
loadmodule "/usr/local/lib/openser/modules/maxfwd.so"
loadmodule "/usr/local/lib/openser/modules/usrloc.so"
loadmodule "/usr/local/lib/openser/modules/registrar.so"
loadmodule "/usr/local/lib/openser/modules/textops.so"
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/local/lib/openser/modules/auth.so"
loadmodule "/usr/local/lib/openser/modules/auth_db.so"
loadmodule "/usr/local/lib/openser/modules/uri_db.so"
modparam("usrloc", "db_mode", 2)
modparam("auth_db", "db_url", "mysql://openserro:openserro@localhost/openser")
# -- auth params --
# Uncomment if you are using auth module
#
modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
modparam("auth_db", "password_column", "password")
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
# ------------------------- request routing logic -------------------
# main routing logic
route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
exit;
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
if (!method=="REGISTER")
record_route();
# subsequent messages withing a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
};
if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
# if you have some interdomain connections via TLS
#if(uri=~"@tls_domain1.net") {
# t_relay("tls:domain1.net");
# exit;
#} else if(uri=~"@tls_domain2.net") {
# t_relay("tls:domain2.net");
# exit;
#}
route(1);
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="ACK") {
route(1);
exit;
} if (method=="INVITE") {
route(3);11
exit;
}
else if (method=="REGISTER") {
# Uncomment this if you want to use digest authentication
if (!www_authorize("193.210.148.244", "subscriber")) {
www_challenge("193.210.148.245", "0");
exit;
};
save("location");
exit;
};
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
append_hf("P-hint: usrloc applied\r\n");
};
route(1);
}
route[1] {
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (!t_relay()) {
sl_reply_error();
};
exit;
}
route[3] {
# -----------------------------------------------------------------
# INVITE Message Handler
# -----------------------------------------------------------------
if (!proxy_authorize("/*your domain name*/","subscriber")) {
proxy_challenge("/*your domain name*/ ","0");
exit;
} else if (!check_from()) {
sl_send_reply("403", "Use From=ID");
break;
};
consume_credentials();
lookup("aliases");
if (uri!=myself) {
route(1);
exit;
};
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
exit;
};
route(1);
}
How do I need to change configuration of the main openser sip server to send the adequate SIP message to XMPP GW?
Thanks a lot again. |
|
|
|
 |
x-console
Site Admin
Joined: Aug 01, 2006
Posts: 1134
Location: Leeds UK
Status: Offline
|
| Posted:
Apr 17, 2008 - 12:55 PM |
|
| Quote: | | So is that possible if I keep the 1.1.0 openser running as a main sip server, and install another 1.2/1.3 openser with XMPP module on the same host, and configure it to be a gateway and xmpp component to transfer and translate sip messages? |
Yes its possible, but it'd be easier to just upgrade to the current stable branch. 1.1.X is not supported any more, so any security or bug fixes that are made will not be backported to the branch you are using. |
|
|
|
 |
gaqian
Joined: Apr 16, 2008
Posts: 8
Status: Offline
|
| Posted:
Apr 17, 2008 - 02:13 PM |
|
Yeah, I know there is such
Migrating OpenSER v1.1.x to v1.2.x
http://www.openser.org/dokuwiki/doku.ph ... x-to-1.2.x
But it looks so many things need to be changed and not so friendly to upgrade, so is there some other way to upgrade to v 1.2.x version with keeping my current openser user data in the database? |
|
|
|
 |
x-console
Site Admin
Joined: Aug 01, 2006
Posts: 1134
Location: Leeds UK
Status: Offline
|
| Posted:
Apr 17, 2008 - 02:26 PM |
|
|
nope you need to make the changes. there are not that many, and they are not complex. There are scripts in the newer releases to help you migrate your data. |
|
|
|
 |
gaqian
Joined: Apr 16, 2008
Posts: 8
Status: Offline
|
| Posted:
Apr 17, 2008 - 02:57 PM |
|
|
Ok, I will try to migrate them.
But I am still wondering how many openser should I install here.
Is it enough I just install one openser 1.3 version along with xmpp module. So I have this openser1.3 as my main sip server and the xmpp module as the gateway as well the xmpp components? |
|
|
|
 |
x-console
Site Admin
Joined: Aug 01, 2006
Posts: 1134
Location: Leeds UK
Status: Offline
|
| Posted:
Apr 17, 2008 - 03:07 PM |
|
|
I think it depends on the volume and type of traffic you are looking to manage. If you are looking for something to manage a large amount of diverse SIP and XMPP traffic, then I would certainly use a separate xmpp server rather than the one within OpenSER. If you use seomthing like ejabberd all your scaling issues (for xmpp) vanish thanks to Erlang. |
|
|
|
 |
gaqian
Joined: Apr 16, 2008
Posts: 8
Status: Offline
|
| Posted:
Apr 21, 2008 - 08:40 AM |
|
|
Actually it is only for testing purpose. Not so much traffic it would manage.
So could you please still tell me what would be the minimum combination for the component mode of the xmpp module?
Suppose I have already one Ejabberd xmpp server running somewhere. What minimum would be needed to setup and configured as a gateway and sip message translator and transmitor?
Is it enough if I setup a 1.3.x version of openser along with its xmpp module, and of course configure it as the component mode?
Do I really need two openser sip servers instance here, one act as a main sip server, the other only configure as a xmpp module?
Thanks again. |
|
|
|
 |
x-console
Site Admin
Joined: Aug 01, 2006
Posts: 1134
Location: Leeds UK
Status: Offline
|
| Posted:
Apr 21, 2008 - 11:42 AM |
|
| Quote: | | So could you please still tell me what would be the minimum combination for the component mode of the xmpp module? |
I'm not going to do the configuration for you. You need to play around with it yourself to find out how it works, and if you have any specific questions, then ask them here.
| Quote: | | Is it enough if I setup a 1.3.x version of openser along with its xmpp module, and of course configure it as the component mode? |
Is it enough for testing? sure.
| Quote: | | Do I really need two openser sip servers instance here, one act as a main sip server, the other only configure as a xmpp module? |
No. |
|
|
|
 |
|
| Forum Rules and Guidelines |
About VoIP User |
Privacy Policy
|
All logos and trademarks in this site are property of their respective owner. Comments and posts are property of the poster, all the rest (c) 2003-2006 VoIP User.
No part of this site may be reproduced without our prior consent.
|
|