Hi,
A new feature is available in openser, devel version : NAPTR lookup.
Overview
=========
OpenSER is now RFC3263 (Locating SIP Server) compliant. See
http://www.ietf.org/rfc/rfc3263.txt
NAPTR queries are used to discovered the transport protocols for SIP
that are supported (and a preference order) by a SIP server. Combining
the protocols that are supported by the remote server and the protocols
that re locally implemented, the local server will choose the protocol
to be used (if an explicit one is not provided). One the protocol is
selected, SRV queries are used to discover the port to be used; after
that A record query is made to get the IP address.
This will make possible for a proxy to advertise its preferred
protocols. Like : if supported, use TLS, otherwise try TCP and if not
UDP. Establishing relationships/connections via TLS will be much simpler
to configure and it would be dynamically done - if both proxies supports
TLS they will use TLS, but this will not exclude UDP and TCP to be used
as alternatives....
How it works
============
If NAPTR / SRV lookup is used depends if the proto and port are known.
Here is a small diagram:
if port specify
then -> do just A record lookup and use defaults protos (UDP for
SIP and TLS for SIPS) if not specified; done
# no port
if no proto
then -> do NAPTR to get proto; if no results, use defaults
protos (UDP for SIP and TLS for SIPS); continue
# we have proto now
do SRV to get port; if no results, use defaults ports (5060 for SIP
and 5061 for SIPS); continue
# we have proto and port
do A record lookup to get IP
The resolver will sequentially try all NAPTR and SRV results until it
successfully gets an IP address. NAPTR / SRV records which cannot be
completely followed (resolved) will be skipped.
If the TLS / TCP support is compiled and enabled, the proxy will
consider this protos to use; otherwise it will skip them.
How to use
==========
NAPTR will be used only if proto is not specify neither via the relaying
function nor via the RURI. Ex:
t_relay("openser.org"); # send to openser.org and use NAPTR and SRV
to resolve the address
t_relay(); # RURI=sip:user@domain.org
forward(uri:host,uri:port); # RURI=sip:user@domain.org
NOTE: these will not use NAPTR
t_relay("tcp:openser.org");
t_relay(); # RURI=sip:user@domain.org;transport=udp
NOTE: these will not use NAPTR/SRV
t_relay("openser.org:5060");
t_relay(); # RURI=sip:user@domain.org:5060
Still under discussion
======================
According to the RFC, for a SIPS uri, the only protocol to be used is
TLS. My question is : if SIPS is found force TLS as proto and do SRV
lookup or perform NAPTR lookup and look for TLS entries.
The difference may be: one extra query (from NAPTR) versus the fact that
the NAPTR query may lead to a SRV into another domain.
Ex: for sips:user@domainA
If forcing TLS -> do SRV for "_sips._tcp.domainA." -> port
server1.domainA:5061
If using first NAPTR -> do NAPTR on "domainA" and get
"_sips._tcp.domainB." which will lead somewhere else than using directly
SRV. According the RFC this is possible.
What I'm not sure about is if this cross domain NAPTR records are
allowed for TLS: see chapter 4.1 :
For NAPTR records with SIPS protocol fields, (if the server is using
a site certificate), the domain name in the query and the domain name
in the replacement field MUST both be valid based on the site
certificate handed out by the server in the TLS exchange. Similarly,
the domain name in the SRV query and the domain name in the target in
the SRV record MUST both be valid based on the same site certificate.
Otherwise, an attacker could modify the DNS records to contain
replacement values in a different domain, and the client could not
validate that this was the desired behavior or the result of an
attack.
for the moment, NAPTR and SRV are used for SIPS....but any other
opinions on this TLS matter are welcomed...
regards,
Bogdan
PS: feedback is welcomed :D
Hello,
I followed with great interest the discussion about the use of the
Dispatcher module that occured in the last few days. Yet, I have another
question. For design issues, I wish to balance the incoming SIP messages
according to the method they hold : for instance, I want to treat the
REGISTER, SUBSCRBE and NOTIFY messages on some machines, and the INVITE,
BYE, CANCEL on another set of machines. I know this may seem strange first,
but I wonder if any mecanism allow to do that.
Thank you in advance for your answers.
Antoine Fressancourt
Hi,
I'm trying to use avpops module, but I'm facing the following error:
0(8178) PG[367] submit_query query 'insert into usr_preferences
(uuid,attribute,value,type,username,domain ) values
('test','avpname','test',0,'','')', result 'ERROR: duplicate key
violates unique constraint "usr_preferences_pkey"
It seems to be caused by the username and domain parameters being
empty strings, since the usr_preferences table has this PK constraint:
"usr_preferences_pkey" primary key, btree (attribute, username,
"domain")
The avpops module is configured like this:
modparam("avpops", "avp_url", "postgres://xpto:xpto@127.0.0.1/xpto")
modparam("avpops", "avp_table", "usr_preferences")
modparam("avpops","use_domain",1)
modparam("avpops", "avp_aliases", "avpalias=s:avpname")
And I'm simply doing:
avp_printf("s:avpname", "test");
avp_db_store("$avpalias/uuid", "s:avpname");
What may be missing? Maybe the usr_preferences table should not have
this PK when using UUID-based AVP identification...
JF
hello list,
i am searching for a way to limit the cps-rate with ser.
our class-iv (cisco pgw) behind der ser has problems with too
many sip-calls per second and will going to crash.
is there any way to limit the cps to a rate i can define?
there are no hints in the ser documentation i know.
thanks for helping.
regards
thomas
--
thomas balsfulland tbals(a)ctrl-c.de
Hi,
How to download/checkout the experimental tls module? I plan to use it with the latest presence server snapshot (ser-0.10.99-dev30-tm-timers-pa-3]). Thanks,
- ming
Hello openser users,
I am trying to connect windows messenger 5.1 with openser in TLS mode.
OpenSER uses the custom created certificate and predictably windows
msngr returns
--------------
There was a problem in verfiying the certificate from the server.
Please contact your network administrator.
--------------
I do have my own client certificate and ca-list created with openser
scripts and I would like to add it to windows messenger to verify the
server certificate. Is it possible to add a ca-list to windows
messenger so that it can verify the server certificate. If yes, kindly
point me how ?
thanks and regards,
Pjothi
Hi,
i have a db_extra accounting rule like:
modparam("acc", "db_extra", "customer_code=$avp(i:102)")
The avp value is 12 and i checked it with avp_print() .
DEBUG:avpops:print_avp: p=0x2a97a866e8, flags=0
DEBUG: id=<102>
DEBUG: val_int=<12>
When it is accounted in the table the value become 11 !!!!!
the field in the table is type int(10) .
How is it possible??
Thanks,
Bye,
MArcello
Hi,
I am trying to get an OpenSER instance running with the dispatcher
module spreading load amongst several other OpenSER servers. I'm having
trouble understanding from the docs and practical application exactly
what the dispatcher module does and how to make it do what I want.
I want to accept requests and use the dispatcher module to send requests
to one of a number of other servers. (I want this setup to scale so I
don't want to use the tm module.) Each subsequent request with the same
CallId should go back to the same server. Therefore using the hash over
the CallId algorithm in the dispatcher module seems like the best choice.
I'm running OpenSER 1.0.0 and working off of the configuration in the
modules documentation:
http://openser.org/docs/modules/1.0.x/dispatcher.html
I fixed up a few things that didn't seem to work out of the box such as
replacing forward( ) with forward( uri:host, uri:port ).
I have several questions.
1. What exactly does ds_select_dst("1", "0") do? I understand the
parameters but the module documentation says it "selects a destination
from addresses set". OK, so does it return it somehow? How do I get my
hands on what it picks? What is an example of a situation where this
function would be useful?
2. What exactly ds_select_domain("1", "0") do? I gather it rewrites the
host and port with what it gets from the addresses set (which seems
more useful than ds_select_dst), but when I run this in practice, _if_
it rewrites the host / port, it always seems to pick the same
destination. (in my tests I only get an outgoing INVITE about 10% of the
time) It does seem like I want to be using ds_select_domain() though.
Can someone point out where my misunderstanding is? I have my
configuration copied below.
Thanks.
-Anders
---------------------------------------------------------------------------------------
What I'm expecting:
When the first INVITE comes from 10.1.50.30 (Asterisk) to 10.1.50.31,
(OpenSER with dispatcher) I want to see an outgoing INVITE from
10.1.50.31 to one of the listed addresses. (10.1.50.[34-37])
What I'm seeing:
A tcpdump shows that most of the time all I see is the incoming INVITE.
Seemingly random INVITES produce an outgoing INVITE, even when calling
the same number. Presumably the only substantive difference is the CallID.
openser.cfg:
-----------------------------------------------------------------------------
#debug=4
fork=yes
log_stderror=no
children=4
check_via=no
dns=off
rev_dns=off
port=5060
mpath="/usr/local/lib/openser/modules"
loadmodule "maxfwd.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "dispatcher.so"
modparam( "dispatcher", "list_file",
"/usr/local/etc/openser/dispatcher.list" )
route {
if ( ! mf_process_maxfwd_header( "10" ) ) {
sl_send_reply( "483", "To Many Hops" );
drop( );
};
ds_select_domain( "1", "0" );
forward( uri:host, uri:port );
}
-----------------------------------------------------------------------
dispatcher.list:
-----------------------------------------------------------------------
# gateways
1 sip:10.1.50.34:5060
1 sip:10.1.50.35:5060
1 sip:10.1.50.36:5060
1 sip:10.1.50.37:5060
-----------------------------------------------------------------------
tcpdump shows:
-----------------------------------------------------------------------
07:43:37.216888 IP 10.1.50.30.5060 > 10.1.50.31.5060: UDP, length: 685
.@.@...
.2.
.2.........INVITE sip:+18666775910@10.1.50.31 SIP/2.0
Via: SIP/2.0/UDP 10.1.50.30:5060;branch=z9hG4bK434da07b
From: "+19195551212" <sip:+19195551212@10.1.50.30>;tag=as3a379ead
To: <sip:+18666775910@10.1.50.31>
Contact: <sip:+19195551212@10.1.50.30>
Call-ID: 7dd7978262a876832fc69a4364f89f22(a)10.1.50.30
CSeq: 102 INVITE
User-Agent: BandwidthVoice
Date: Fri, 03 Feb 2006 12:41:35 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Type: application/sdp
Content-Length: 202
v=0
o=root 11014 11014 IN IP4 10.1.50.30
s=session
c=IN IP4 10.1.50.30
t=0 0
m=audio 8360 RTP/AVP 0 3 8
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -
-----------------------------------------------------------------------
with no outgoing INVITE. Things seem to be dead. Then I try the same
call a few seconds later and I get the outgoing INVITE:
-----------------------------------------------------------------------
07:43:48.695958 IP 10.1.50.30.5060 > 10.1.50.31.5060: UDP, length: 686
.@.@...
.2.
.2.........INVITE sip:+18666775910@10.1.50.31 SIP/2.0
Via: SIP/2.0/UDP 10.1.50.30:5060;branch=z9hG4bK15490a4e
From: "+19195551212" <sip:+19195551212@10.1.50.30>;tag=as302ac772
To: <sip:+18666775910@10.1.50.31>
Contact: <sip:+19195551212@10.1.50.30>
Call-ID: 531db3695f15035620baae890d555216(a)10.1.50.30
CSeq: 102 INVITE
User-Agent: BandwidthVoice
Date: Fri, 03 Feb 2006 12:41:46 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Type: application/sdp
Content-Length: 203
v=0
o=root 11015 11015 IN IP4 10.1.50.30
s=session
c=IN IP4 10.1.50.30
t=0 0
m=audio 28484 RTP/AVP 0 3 8
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -
07:43:48.696191 IP 10.1.50.31.5060 > 10.1.50.36.5060: UDP, length: 747
E....*@.@..g
.2.
.2$......S.INVITE sip:+18666775910@10.1.50.36:5060 SIP/2.0
Max-Forwards: 10
Via: SIP/2.0/UDP 10.1.50.31;branch=0
Via: SIP/2.0/UDP 10.1.50.30:5060;branch=z9hG4bK15490a4e
From: "+19195551212" <sip:+19195551212@10.1.50.30>;tag=as302ac772
To: <sip:+18666775910@10.1.50.31>
Contact: <sip:+19195551212@10.1.50.30>
Call-ID: 531db3695f15035620baae890d555216(a)10.1.50.30
CSeq: 102 INVITE
User-Agent: BandwidthVoice
Date: Fri, 03 Feb 2006 12:41:46 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Type: application/sdp
Content-Length: 203
v=0
o=root 11015 11015 IN IP4 10.1.50.30
s=session
c=IN IP4 10.1.50.30
t=0 0
m=audio 28484 RTP/AVP 0 3 8
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -
-----------------------------------------------------------------------
any help greatly appreciated.