Hello all,
i'll do two presentations about OpenSER at the Chaos Communication Congress
[1], December 27th-30th, 2007 in Berlin and the Open Source Meets Business
congress [2], January 22th–24th, 2008 in Nuremberg.
If some people there are interested in a meeting for discussions around
OpenSER and other related (or unrelated..) topics, please drop me a private
email.
Regards,
Henning
[1] http://events.ccc.de/congress/2007/Main_Page
[2] http://www.heise.de/events/2008/open_source_meets_business/en/
Hello!
I am interested in using SER to convert TCP SIP traffic from OCS to UDP
SIP traffic that I can use with an external PSTN gateway provider. Has
anyone successfully managed this? Basically, the configuration would
look like
OCS -> Mediation Server -> SER -> External Provider
Would the Mediation Server still need an external (non-NAT'd) IP? It
seems like it would, unless I use mediaproxy or RTPproxy, which would
add an additional layer of complexity.
I guess I am looking for some validation that what I am trying to do
will work. My next question, which I can't seem to find an answer to,
is how I take the TCP SIP traffic from OCS, convert it to UDP SIP, and
also authenticate with that external provider. Any ideas on how to use
t_relay_to_udp with authentication?
Thank you!
Nolan
Hello all,
I have a small problem with avp_db_query() and avp_pushto() that I could
use some help with.
The manual select statement returns the expected values:
mysql> select username,attribute,value from usr_preferences where username='55555';
+----------+-----------+------------+
| username | attribute | value |
+----------+-----------+------------+
| 55555 | 1 | 2035552222 |
| 55555 | 2 | 2035551111 |
+----------+-----------+------------+
2 rows in set (0.00 sec)
The problem I have is that, when I run the configuration segment below only
the first instance of avp_pushto in the loop produces the correct value.
avp_delete("*");
$var(idx) = 0;
if (avp_db_query("SELECT attribute, value
FROM usr_preferences
WHERE username='$rU'
ORDER BY attribute")) {
while($var(idx) < 5) {
if ($(avp(i:1)[$var(idx)]) != NULL) {
xlog("L_NOTICE", "avp(i:1)[$var(idx)]=$(avp(i:1)[$var(idx)]) avp(i:2)[$var(idx)]=$(avp(i:2)[$var(idx)])\n");
avp_pushto("$ru/username", "$(avp(i:2)[$var(idx)])");
rewritehostport("10.10.10.10:5060");
xlog("L_NOTICE", "$ru\n");
} else {
xlog("L_NOTICE", "avp(i:1)[$var(idx)] == NULL\n");
}
$var(idx) = $var(idx) + 1;
}
} else {
xlog("L_NOTICE", "avp_db_query() returned no records\n");
};
So, the avp_db_query() works exactly as expected. The problem is that
the second avp_pushto() doesn't change the value in the ruri username.
avp(i:1)[0]=1 avp(i:2)[0]=2035552222
sip:2035552222@10.10.10.10:5060;user=phone
avp(i:1)[1]=2 avp(i:2)[1]=2035551111 <-- This is the mismatch
sip:2035552222@10.10.10.10:5060;user=phone <-- This is the mismatch
avp(i:1)[2] == NULL
avp(i:1)[3] == NULL
avp(i:1)[4] == NULL
As always, thanks for any help.
- Jeremy
Hi
I am running the simple configuration in which SER 0.9.7-pre1 serves
as Proxy (at port 5060) and SER-SEMS is the media server (at port
5070). At port 5070, the SER version is 0.9.6-pre1 and SEMS version is
0.10.0-rc2. I have placed log commands in the config files just to
record the process flow.
Using SIPSAK, I am sending an INVITE (for SER-SEMS at :5070) through
the proxy. My sipsak message is this:
C:>sipsak -f invite.txt -s sip:200@192.168.3.208:5060 -vvv
The request enters the proxy ser.cfg file and is redirected to the
SER-SEMS (see the log messages below). The user name (200@...) is used
by if statement to invoke the announcement application. However, I
don't see any response from the unix socket (no announcement played)
nor do I see any error message, and the connection finally times out.
Can anyone please tell me how I can check whether the unix sockets are
doing their job or not? Why does the process not return any error and
why does it just time out?
Thanks in advance for your help.
Frq
PS: Here are the (somewhat condensed) versions of SER and SEMS outputs
(log messages mostly), SIPSAK responses, and the relevant config
files. I apologise for sending a huge email.
-------------------------------------------------------------------------------------------
SER output
[root@xxx ~]# ser
Listening on
udp: 192.168.3.208 [192.168.3.208]:5060
tcp: 192.168.3.208 [192.168.3.208]:5060
aliases...
WARNING: no fork mode
stateless - initializing
0(0) Maxfwd module- initializing
0(0) INFO: udp_init: SO_RCVBUF is initially 107520
0(0) INFO: udp_init: SO_RCVBUF is finally 262142
2(0) INFO: fifo process starting: 5058
2(0) SER: open_uac_fifo: fifo server up at /tmp/ser_fifo...
2(0) WARNING: no fifo_db_url given - fifo DB commands disabled!
0(5056) Inside the main route....
0(5056) just passed the sanity checks...
0(5056) inside method-register...
0(5056) inside uri-myself...
0(5056) Inside route1...
0(5056) Inside the main route....
0(5056) just passed the sanity checks...
0(5056) inside method-register...
0(5056) inside uri-myself...
0(5056) Inside route1...
-------------------------------------------------------------------------------------------
SER-SEMS output
[root@xxx ~]# /opt/ser-sems/sbin/ser -f /opt/ser-sems/etc/ser/ser.cfg
Listening on
udp: 192.168.3.208 [192.168.3.208]:5070
tcp: 192.168.3.208 [192.168.3.208]:5070
aliases ....
WARNING: no fork mode
stateless - initializing
0(0) Maxfwd module- initializing
textops - initializing
0(0) INFO: udp_init: SO_RCVBUF is initially 107520
0(0) INFO: udp_init: SO_RCVBUF is finally 262142
2(0) INFO: fifo process starting: 5061
2(0) SER: open_uac_fifo: fifo server up at /tmp/ser_fifo...
2(0) WARNING: no fifo_db_url given - fifo DB commands disabled!
0(5059) Inside route block....
0(5059) Inside if-invite...
0(5059) Inside if-uri-200...
0(5059) Inside route block....
-------------------------------------------------------------------------------------------
INVITE message used by SIPSAK (invite.txt ) is this:
INVITE sip:200@192.168.3.208:5070 SIPi/2.0
From: sip:rsf@192.168.3.77
To: sip:200@192.168.3.208:5070
Contact: sip:rsf@192.168.3.77
CSeq: 100 INVITE
Call-ID: 9787963-3319555348-76751(a)192.168.3.77
Max-Forwards: 400
Content-Length: 0
-------------------------------------------------------------------------------------------
SIPSAK responses:
fqdnhostname: 192.168.3.77
our Via-Line: Via: SIP/2.0/UDP 192.168.3.77:2646;branch=z9hG4bK.7271c2b5;rport;a
lias
New message with Via-Line:
INVITE sip:200@192.168.3.208:5070 SIPi/2.0
Via: SIP/2.0/UDP 192.168.3.77:2646;branch=z9hG4bK.7271c2b5;rport;alias
From: sip:rsf@192.168.3.77
To: sip:200@192.168.3.208:5070
Contact: sip:rsf@192.168.3.77
CSeq: 100 INVITE
Call-ID: 9787963-3319555348-76751(a)192.168.3.77
Max-Forwards: 400
Content-Length: 0
request:
INVITE sip:200@192.168.3.208:5070 SIPi/2.0
Via: SIP/2.0/UDP 192.168.3.77:2646;branch=z9hG4bK.7271c2b5;rport;alias
From: sip:rsf@192.168.3.77
To: sip:200@192.168.3.208:5070
Contact: sip:rsf@192.168.3.77
CSeq: 100 INVITE
Call-ID: 9787963-3319555348-76751(a)192.168.3.77
Max-Forwards: 400
Content-Length: 0
send to: UDP:192.168.3.208:5060
message received
received from: UDP:192.168.3.208:5060
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP 192.168.3.77:2646;branch=z9hG4bK.7271c2b5;rport=2647;alias
From: sip:rsf@192.168.3.77
To: sip:200@192.168.3.208:5070
CSeq: 100 INVITE
Call-ID: 9787963-3319555348-76751(a)192.168.3.77
Server: Sip EXpress router (0.9.7-pre1 (i386/linux))
Content-Length: 0
Warning: 392 192.168.3.208:5060 "Noisy feedback tells: pid=5056 req_src_ip=192.
168.3.77 req_src_port=2647 in_uri=sip:200@192.168.3.208:5070 out_uri=sip:200@192
.168.3.208:5070 via_cnt==1"
** reply received after 0.000 ms **
SIP/2.0 100 trying -- your call is important to us
provisional received; still waiting for a final response
message received
received from: UDP:192.168.3.208:5060
SIP/2.0 101 Trying - just wait a minute!
Via: SIP/2.0/UDP 192.168.3.77:2646;branch=z9hG4bK.7271c2b5;rport=2647;alias
From: sip:rsf@192.168.3.77
To: sip:200@192.168.3.208:5070
CSeq: 100 INVITE
Call-ID: 9787963-3319555348-76751(a)192.168.3.77
Server: Sip EXpress router (0.9.6-sems (i386/linux))
Content-Length: 0
Warning: 392 192.168.3.208:5070 "Noisy feedback tells: pid=5059 req_src_ip=192.
168.3.208 req_src_port=5060 in_uri=sip:200@192.168.3.208:5070 out_uri=sip:200@19
2.168.3.208:5070 via_cnt==2"
** reply received after 16.000 ms **
SIP/2.0 101 Trying - just wait a minute!
provisional received; still waiting for a final response
message received
received from: UDP:192.168.3.208:5060
Content-Length set to 0
New message with changed Content-Length:
ACK sip:200@192.168.3.208:5070 SIPi/2.0
Via: SIP/2.0/UDP 192.168.3.77:2646;branch=z9hG4bK.7271c2b5;rport;alias
From: sip:rsf@192.168.3.77
To: sip:200@192.168.3.208:5070
Contact: sip:rsf@192.168.3.77
CSeq: 100 ACK
Call-ID: 9787963-3319555348-76751(a)192.168.3.77
Max-Forwards: 400
Content-Length: 0
reply with copyed To:
ACK sip:200@192.168.3.208:5070 SIPi/2.0
Via: SIP/2.0/UDP 192.168.3.77:2646;branch=z9hG4bK.7271c2b5;rport;alias
From: sip:rsf@192.168.3.77
To: sip:200@192.168.3.208:5070;tag=cc619c805c36ff52db55353ff7c0aad3-be50
Contact: sip:rsf@192.168.3.77
CSeq: 100 ACK
Call-ID: 9787963-3319555348-76751(a)192.168.3.77
Max-Forwards: 400
Content-Length: 0
request:
ACK sip:200@192.168.3.208:5070 SIPi/2.0
Via: SIP/2.0/UDP 192.168.3.77:2646;branch=z9hG4bK.7271c2b5;rport;alias
From: sip:rsf@192.168.3.77
To: sip:200@192.168.3.208:5070;tag=cc619c805c36ff52db55353ff7c0aad3-be50
Contact: sip:rsf@192.168.3.77
CSeq: 100 ACK
Call-ID: 9787963-3319555348-76751(a)192.168.3.77
Max-Forwards: 400
Content-Length: 0
send to: UDP:192.168.3.208:5060
SIP/2.0 408 Request Timeout
Via: SIP/2.0/UDP 192.168.3.77:2646;branch=z9hG4bK.7271c2b5;rport=2647;alias
From: sip:rsf@192.168.3.77
To: sip:200@192.168.3.208:5070;tag=cc619c805c36ff52db55353ff7c0aad3-be50
CSeq: 100 INVITE
Call-ID: 9787963-3319555348-76751(a)192.168.3.77
Server: Sip EXpress router (0.9.6-sems (i386/linux))
Content-Length: 0
Warning: 392 192.168.3.208:5070 "Noisy feedback tells: pid=5060 req_src_ip=192.
168.3.208 req_src_port=5060 in_uri=sip:200@192.168.3.208:5070 out_uri=sip:200@19
2.168.3.208:5070 via_cnt==0"
** reply received 29235.000 ms after first send
and -15.000 ms after last send **
SIP/2.0 408 Request Timeout
final received
-------------------------------------------------------------------------------------------
Ser.cfg (for proxy server at :5060)
debug=3
fork=no
log_stderror=yes
listen=192.168.3.208 #2.13 # put your server IP address here
port=5060
children=4
dns=no
rev_dns=no
fifo="/tmp/ser_fifo"
loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/lib/ser/modules/registrar.so"
modparam("usrloc", "db_mode", 0)
modparam("rr", "enable_full_lr", 1)
route {
log(1, "Inside the main route....\n");
# ------------------------------------------------------------------------
# Sanity Check Section
# ------------------------------------------------------------------------
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483", "Too Many Hops");
break;
};
if (msg:len > max_len) {
sl_send_reply("513", "Message Overflow");
break;
};
log(3, "just passed the sanity checks...\n");
# ------------------------------------------------------------------------
# Record Route Section
# ------------------------------------------------------------------------
if (method!="REGISTER") {
record_route();
log(3, "inside method-register...\n");
};
# ------------------------------------------------------------------------
# Loose Route Section
# ------------------------------------------------------------------------
if (loose_route()) {
log(3, "inside loose route...\n");
route(1);
break;
};
# ------------------------------------------------------------------------
# Call Type Processing Section
# ------------------------------------------------------------------------
if (uri!=myself) {
log(3, "inside uri-myself...\n");
route(1);
break;
};
.
.
.
route(1);
}
route[1] {
# ------------------------------------------------------------------------
# Default Message Handler
# ------------------------------------------------------------------------
log(3, "Inside route1...\n");
if (!t_relay()) {
sl_reply_error();
};
}
.
.
-----------------------------------------------------------------------------------------
SER (Stack for SEMS at :5070) config file is this:
#
# $Id: ser.cfg,v 1.25.2.1 2005/02/18 14:30:44 andrei Exp $
#
# simple quick-start config script
#
# ----------- global configuration parameters ------------------------
debug=3 # debug level (cmd line: -dddddddddd)
#/* 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)
listen=192.168.3.208
port=5070
fifo="/tmp/ser_fifo"
unix_sock="/tmp/ser_sock"
# ------------------ module loading ----------------------------------
loadmodule "/opt/ser-sems/lib/ser/modules/sl.so"
loadmodule "/opt/ser-sems/lib/ser/modules/tm.so"
loadmodule "/opt/ser-sems/lib/ser/modules/rr.so"
loadmodule "/opt/ser-sems/lib/ser/modules/maxfwd.so"
loadmodule "/opt/ser-sems/lib/ser/modules/usrloc.so"
loadmodule "/opt/ser-sems/lib/ser/modules/registrar.so"
loadmodule "/opt/ser-sems/lib/ser/modules/textops.so"
# ----------------- setting module-specific parameters ---------------
modparam("usrloc", "db_mode", 0)
modparam("rr", "enable_full_lr", 1)
modparam("tm", "pass_provisional_replies", 1)
# ------------------------- request routing logic -------------------
route{
log(1, "Inside route block....\n");
# 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");
break;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
break;
};
# -----------------------------------------------------------------------
# Redirection-related processing
# ----------------------------------------------------------------------
if (method == "ACK" || method == "INVITE" || method == "BYE" ||
method == "CANCEL"){
# switch to stateful mode
if (!t_newtran()){
sl_send_reply("500", "Could not create transaction");
break;
};
# prevent timeout on the other side
t_reply("101", "Trying - just wait a minute!");
if (method == "INVITE"){
log(2, "Inside if-invite...\n");
# Redirect the call to the 'conference' plugin
# in case the URI begins with 100
if (uri =~"sip:100*@"){
# assumes that SMES configuration parameter
# 'socket_name=' has been set to
'/tmp/sems_sock'
log(3, "Inside if-uri-100...\n");
if (!t_write_unix("/tmp/sems_sock","conference")){
t_reply("500","Error
contacting SEMS 1");
};
break;
};
# Redirect the call to the 'announcement' plugin in case
# the URI begins with 200
if (uri =~"sip:200*@"){
log(3, "Inside if-uri-200...\n");
if (!t_write_unix("/tmp/sems_sock","announcement")){
t_reply("500","Error contacting SEMS 2");
log(3, "just past 200-unixsocket...\n");
};
break;
};
# No service number, redirect to voicemail
# Load email address into AVP so that voicemail gets the
# callee's email address (see below for avpops
modparams)
#avp_db_load("$uri", "$email/$email_scheme");
#if(!t_write_unix("/tmp/sems_sock","voicemail")){
# t_reply("500","Error contacting SEMS");
#};
break;
}
.
.
}
route[1]
{
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (!t_relay()) {
sl_reply_error();
};
}
-----------------------------------------------------------------------------------------
Finally, the relevant parts of sems.conf file are these:
# $Id: sems.conf.sample 265 2007-03-07 21:31:54Z sayer $
#
# sems.conf.sample
#
# Sip Express Media Server (sems)
#
# sample configuration file
#
.
.
socket_name=/tmp/sems_sock
reply_socket_name=/tmp/sems_rsp_sock
ser_socket_name=/tmp/ser_sock
listen=192.168.3.208
sip_port=5070
.
.
.