Hello,
courtesy of Glenn Marmon, Connecticut College Class of 2007, who
submitted the patch, OpenSER includes now support for SCTP (Stream
Control Transmission Protocol). It completes the list of the possible IP
transport layers that could be used with SIP in OpenSER.
You can find details about SCTP at: http://www.sctp.org/
Basically, it is a reliable transport protocol, like TCP, but provides a
number of functions that are critical for telephony signaling transport
(read more about the benefits: http://www.ietf.org/rfc/rfc3286.txt).
If you have the chance to own a SCTP-aware SIP phone and can test,
please provide us feedback on the mailing lists -- also, let us know the
name and type of any SIP phone with SCTP support that you know. Hope
SCTP will gain more and more space, as it seems to be the right protocol
for VoIP/IM&P signaling, where UDP cannot cope very well with huge
messages and TCP adds too much overhead.
Cheers,
Daniel
Hi, I've configured:
log_facility=LOG_LOCAL0
and added in "syslog.conf":
# don't log messages with LOG_LOCAL0 in /var/log/syslog anymore
*.*;auth,authpriv.none,local0.none -/var/log/syslog
#
# log messages with LOG_LOCAL0 in /var/log/ser.log
local0.* -/var/log/ser.log
as it appears in
http://docs.huihoo.com/openser/tutorials/ser-syslog/ar01s06.html
OpenSer then logs in /var/log/openser, true, but it still logs
in /var/log/syslog. ¿?¿ Obviously I don't want OpenSer logs appearing
in /var/log/syslog.
I use Debian Etch, any idea of what can be wrong? Thanks a lot.
--
Iñaki Baz Castillo
ibc(a)in.ilimit.es
Hi,
I am trying to rewrite a 5 digit number to a 11 digit number by
adding a prefix "121285". To achieve that I use the following:
avp_subst("$avp(s:fromuri)","/^(sip:)([134][0-9]{4}@.*)/\1+121285\2/");
in openser.log new fromuri = sip:+12128512345@host.columbia.edu
It works fine because of the "+" after \1
This avp_subst does not work properly if the "+" is taken out. How
can I use "\1" followed by another digit?
avp_subst("$avp(s:fromuri)","/^(sip:)([134][0-9]{4}@.*)/\1121285\2/");
in openser.log: new fromuri = J128512345(a)host.columbia.edu
What am i doing wrong?
Thanks in advance for your help.
--
Zahid
Running OpenSER v1.1.1 with internal ip for sip client connections
and ext ip to connect to sip providers. I am getting loops in my
calls sometimes... They stop after reaching the max hops trying to
send the BYE message to it self. I am wondering if it is the record-
route that I see that includes the internal IP. The 483 error is
U 2007/07/30 00:49:56.133157 192.168.18.22:5060 -> 192.168.18.22:5060
SIP/2.0 483 Too Many Hops.
From: <sip:15126461516@192.168.18.1:5060>;tag=nu-481d-6c62.
To: <sip:18065436468@192.168.18.22:5060>;tag=6738.
Call-ID: 421ac0c6-1dd2-11b2-8093-df998124da20(a)192.168.18.91.
CSeq: 11269143 BYE.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.7fe832a5.0.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.6fe832a5.0.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.5fe832a5.0.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.4fe832a5.0.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.3fe832a5.0.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.2fe832a5.0.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.1fe832a5.0.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.0fe832a5.0.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.fee832a5.0.
Via: SIP/2.0/UDP 192.168.18.22;rport=5060;branch=z9hG4bKe6ff.eee832a5.0.
Via: SIP/2.0/UDP 192.168.18.91:5060;rport=5060.
Server: OpenSer (1.1.1-notls (i386/linux)).
Content-Length: 0.
Any ideas?
Hello,
starting from the original patch submitted by Bastian Friedrich and
incorporating the code used in the core for past benchmarking, the devel
version has a new module "benchmark". It can be used to log the duration
of a configuration part execution, allowing in this way to detect slow
elements of routing script. I am sure is a important tool, at least in
preparing production systems, so development will continue to make more
flexible the printed statistics.
The readme file will give you more details:
http://www.openser.org/docs/modules/1.3.x/benchmark.html
The module exports an internal API, so developers can do benchmarking
inside the C code.
Feedback is appreciated.
Cheers,
Daniel
El Thursday 02 August 2007 17:31:23 escribió:
> Hi,
>
> $avp(s:dom) = $rd;
> avp_subst("$avp(s:dom)", "/\./_/g");
Great, didn't realize of that :)
Thanks a lot.
>
> Andreas
>
> Iñaki Baz Castillo wrote:
> > Hi, I just need to take the requested domain $rd and store in a variable
> > that domain but with . replaced by _:
> >
> > sip.domain.org -> sip_domain_org
> >
> > This is because I want tables in MySQL containing the domain name but
> > MySQL don't allow . in table name.
> >
> > So now, what should I do for that? I really thought "textops" could help
> > me but I don't see a function to replace text and store it in a variable.
> >
> > I see "replace()" and "subst()" but they seem to exist for replacing text
> > in the SIP message "on the fly", that is not that I'm looking for.
> >
> > Any suggestion? Thanks a lot.
--
ilimit...
*Iñaki Baz Castillo*
ibc(a)in.ilimit.es
ÀREA SISTEMES
0034 937 333 375
VOLTA 1, PIS 5
08224 TERRASSA.BCN
Aquest enviament és confidencial i està destinat únicament a la persona a qui
s'ha enviat.
Pot contenir informació privada sotmesa al secret professional, la distribució
de la qual està prohibida per la legislació vigent.
Hi, I just need to take the requested domain $rd and store in a variable that
domain but with . replaced by _:
sip.domain.org -> sip_domain_org
This is because I want tables in MySQL containing the domain name but MySQL
don't allow . in table name.
So now, what should I do for that? I really thought "textops" could help me
but I don't see a function to replace text and store it in a variable.
I see "replace()" and "subst()" but they seem to exist for replacing text in
the SIP message "on the fly", that is not that I'm looking for.
Any suggestion? Thanks a lot.
--
Iñaki Baz Castillo
ibc(a)in.ilimit.es
Hello everybody,
I haved installed a openseradmin. And I can have a page for login in
the http://localhost:3000. But when i loggined with:
login: openser
password:openserrw
I have got a page of error : SocketError in loginController # login
Do anybody know why? Thank you very much!
Yin
Hello evrybody, I need a piece of advice if you have time.... Thanks
I have some trouble with my configuration file, I'm trying to set a SIP network working through NAT using STUN.
REGISTRATION is working, INVITE are working, I can set a communication with 2 working phones
but sip pings an BYE messages are not forwared...
Any idea??
Thanks
#
U 88.191.45.91:5060 -> 82.127.0.79:1312
OPTIONS sip:82.127.0.79:1312 SIP/2.0.
Via: SIP/2.0/UDP 88.191.45.91:5060;branch=0.
From: sip:pinger@sip.leurent.eu;tag=804466c1.
To: sip:82.127.0.79:1312.
Call-ID: 23ce8297-c09c8eb7-a(a)88.191.45.91.
CSeq: 1 OPTIONS.
Content-Length: 0.
.
#
U 82.127.0.79:1312 -> 88.191.45.91:5060
SIP/2.0 481 CallLeg/Transaction Does Not Exist.
Via: SIP/2.0/UDP 88.191.45.91:5060;branch=0.
From: <sip:pinger@sip.leurent.eu>;tag=804466c1.
To: <sip:82.127.0.79:1312>;tag=c0a80101-4bf1d8.
Call-ID: 23ce8297-c09c8eb7-a(a)88.191.45.91.
CSeq: 1 OPTIONS.
Content-Length: 0.
.
#
U 82.127.0.79:1312 -> 88.191.45.91:5060
BYE sip:103@82.127.0.79:1027 SIP/2.0.
Via: SIP/2.0/UDP 82.127.0.79:1313;branch=z9hG4bK8030359792092547043.
From: "101"<sip:101@sip.leurent.eu:5060;user=phone>;tag=c0a80101-4c5eed.
To: <sip:103@sip.leurent.eu:5060;user=phone>;tag=c0a80101-1d0bb0d.
Call-ID: 66464a0-c0a80101-0-1f(a)192.168.95.4.
CSeq: 2 BYE.
Max-Forwards: 70.
Route: <sip:88.191.45.91:5060;lr=on;ftag=c0a80101-4c5eed>.
User-Agent: THOMSON ST2030 hw0 fw1.50 00-0E-50-4E-AF-AE.
Content-Length: 0.
.
#
# $Id: openser.cfg 1827 2007-03-12 15:22:53Z bogdan_iancu $
#
# simple quick-start config script
# Please refer to the Core CookBook at http://www.openser.org/dokuwiki/doku.php
# for a explanation of possible statements, functions and parameters.
#
# ----------- global configuration parameters ------------------------
debug=7 # debug level (cmd line: -dddddddddd)
fork=no
log_stderror=yes # (cmd line: -E)
children=4
#alias=sip.leurent.eu
port=5060
#server_signature=yes
#tos=IPTOS_LOWDELAY
avp_aliases="day=i:101;time=i:102;can_uri=i:800;s_ip=i:801;billing_party=i:802;from_header=i:803;sip_proxy_ip=i:804"
#;pstnuser=i:805;pstnpassword=i:806:pstnrealm=i:807"
# ------------------ module loading ----------------------------------
#set module path
mpath="/usr/lib/openser/modules/"
# Uncomment this if you want to use SQL database
loadmodule "mysql.so"
loadmodule "sl.so" # Stateless Module
loadmodule "tm.so" # Transaction Module
loadmodule "rr.so" # Record-Route and Route Module
loadmodule "maxfwd.so" # Max-Forward processor Module
loadmodule "usrloc.so" # User Location Implementation Module
loadmodule "registrar.so" # SIP Registrat Implementation Module (need usrloc)
loadmodule "textops.so" # Text Operation Module
loadmodule "mi_fifo.so" # FIFO transport layer implementation for Management Interface
loadmodule "acc.so" # Accounting Module
loadmodule "avpops.so" # AVP Operation Module (user preference)
loadmodule "uri.so" # Generic URI operation Module
loadmodule "auth.so" # Authentification Module
#loadmodule "auth_db.so" # Database-backend Authentication mMdule
loadmodule "auth_radius.so" # RADIUS-backend Authentication Module
loadmodule "group_radius.so" # User-groups Module with RADIUS-backend
#loadmodule "avp_radius.so" # RADIUS-backend for AVP loading Module
#loadmodule "presence.so" # Presence server Module
#loadmodule "pua.so" # Common API for presence user agent client
loadmodule "options.so" # OPTIONS server replier Module
loadmodule "xlog.so" # Advanced Logger Module
loadmodule "nathelper.so" # NAT Traversal Helper Module
#loadmodule "dispatcher.so" # Dispatcher (load-balancer) Module
loadmodule "uac.so" # User Agent Client
loadmodule "siptrace.so" # SipTrace module (storage of SIP requests)
#loadmodule "exec.so" # Allows to start an external command from a OpenSER script
# ----------------- setting module-specific parameters ---------------
# -- maxfwd params --
modparam("maxfwd", "max_limit", 10) # Default is 256 | 10 in the functions
# -- sl params --
#modparam("sl", "enable_stats", 1)
# -- mi_fifo params --
modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
# -- usrloc params --
# Uncomment this if you want to use SQL database
modparam("usrloc", "db_mode", 1) # Write instantaneously in the DB
modparam("usrloc", "db_url", "mysql://openser:test@127.0.0.1/openser")
modparam("usrloc", "timer_interval", 10)
modparam("usrloc", "nat_bflag" , 3)
# -- rr params --
modparam("rr", "enable_full_lr", 1) # add value to ;lr param to make some broken UAs happy
# -- siptrace params --
modparam("siptrace", "db_url", "mysql://openser:test@127.0.0.1/openser")
modparam("siptrace", "table", "sip_trace") # Default value "sip_trace"
modparam("siptrace", "trace_on", 1)
# -- registrar params --
modparam("registrar", "default_expires", 1800)
modparam("registrar", "received_avp", "$avp(i:42)")
# -- nathelper params --
modparam("nathelper", "rtpproxy_disable", 1)
modparam("nathelper", "sipping_bflag", 5)
modparam("nathelper", "natping_interval", 10)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_method", "OPTIONS")
modparam("nathelper", "received_avp", "$avp(i:42)") # Same Value as the registrar module
modparam("nathelper", "sipping_from", "sip:pinger@sip.leurent.eu")
# -- auth params --
#modparam("auth", "secret", "johndoessecretphrase") # Default is random => don't set it
#modparam("auth", "nonce_expire", 300) # Time before nounce expiration
modparam("auth_radius", "radius_config", "/etc/radiusclient-ng/radiusclient.conf")
# -- group_radius params --
modparam("group_radius", "radius_config", "/etc/radiusclient-ng/radiusclient.conf")
modparam("group_radius", "use_domain", 1) # username@domain will be used for lookup
# -- avp_radius parameter --
#modparam("avp_radius", "radius_config", "/etc/radiusclient-ng/radiusclient.conf")
# -- acc params (with radius )--
modparam("acc", "radius_config", "/etc/radiusclient-ng/radiusclient.conf")
modparam("acc", "radius_flag", 1)
modparam("acc", "radius_missed_flag", 2)
modparam("acc", "early_media", 1)
modparam("acc", "report_cancels", 1)
#modparam("acc", "report_ack", 0)
modparam("acc", "detect_direction", 1)
#modparam("acc", "log_flag", 1) # number of the flag which will be used to mark messages for accounting
#modparam("acc", "log_level", 1) # Set the reporting log level
#modparam("acc", "log_missed_flag", 2) #
#modparam("acc", "failed_transaction_flag", 2)
modparam("acc", "service_type", 15) # Radius service type used for accounting : 15 = (SIP)
#modparam("acc", "radius_extra", "Sip-Src-IP=$si;Sip-Src-Port=$sp")
# ATTENTION: DO NOT PUT ; at the end of the radius_extra attribute
modparam("acc", "radius_extra", "Sip-Src-IP=$si;
Sip-Src-Port=$sp;
Canonical-URI=$avp(can_uri);
Billing-Party=$avp(billing_party);
SIP-Proxy-IP=$avp(sip_proxy_ip);
User-Agent=$ua
")
#Billing-Party=$avp(billing_party)
#From-Header=$hdr(from);
#User-Name=$fU;
#From-Header=$avp(from_header);
#Digest-Realm=$fd
#Sip-From-Tag=$avp(from_header);
#SIP-Method=$rm;
# ------------------------- 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;
};
# NAT detection
route(2);
# 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");
if(is_method("BYE")) { # log it all the time
acc_rad_request("200 ok");
acc_log_request("200 ok");
}
route(1);
};
# Set the acc flags
if(is_method("INVITE") && !has_totag()) {
xlog("L_INFO", "I AM SETTING THE FLAGS FOR RADIUS \r\n");
$avp(can_uri) = $ru; # SIP Request's URI
$avp(billing_party) = $fu; # From URI
$avp(from_header) = $fU; # From URI username
$avp(sip_proxy_ip) = $Ri; # Received IP address
setflag(1); # radius_flag
setflag(2); # radius_missed_flag
};
# Functions when calling other domains
if (!uri==myself) {
# check if user is allowed to do voip calls to other domains
# if(is_method("INVITE|MESSAGE")) {
# if (radius_is_user_in("From", "voip")) {
# sl_send_reply("403", "Forbidden VoIP");
# exit;
# };
# };
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
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=="REGISTER") {
sip_trace();
xlog("L_INFO", "$fU IS TRYING TO REGISTER \r\n");
if (!radius_www_authorize("sip.leurent.eu")) {
www_challenge("sip.leurent.eu", "0"); # qop set to 1
xlog("L_INFO", "WWW_CHALLENGE of $si FAILED \r\n");
exit;
};
#if (isflagset(5)) {
if (isbflagset(3)) {
#setflag(6);
# if you want OPTIONS natpings uncomment next
# setflag(7); # Deprecated
setbflag(5); # Set Flag for SIP PINGING
};
save("location");
xlog("L_INFO", "SAVE LOCATION OF $si \r\n");
exit;
};
if (!lookup("location")) {
# log to acc as missed call
acc_rad_request("404 Not Found");
acc_log_request("404 Not Found");
xlog("L_DBG", "ACC RADIUS: 404 NOT FOUND FOR $si \r\n");
sl_send_reply("404", "Not Found");
exit;
};
append_hf("P-hint: usrloc applied\r\n");
};
route(1);
}
## Generic Forward
route[1] {
if (subst_uri('/(sip:.*);nat=yes/\1/')){
#setflag(6); # Deprecated, for version 1.1
setbflag(3);
};
#if (isflagset(5)||isflagset(6)) {
if (isbflagset(3)) {
route(3);
}
if (!t_relay()) {
sl_reply_error();
};
exit;
}
# NAT Detection
route[2]{
force_rport();
if (nat_uac_test("19")) {
xlog("!!!!!!!!! NAT UAC TEST 19 SUCEDEED \r\n");
if (method=="REGISTER") {
fix_nated_register();
} else {
fix_nated_contact();
};
#setflag(5); Deprecated
setbflag(3);
};
}
## Route for natted contact
route[3] {
if (is_method("BYE|CANCEL")) {
# Ajout Maison
acc_rad_request("200 ok");
acc_log_request("200 ok");
#unforce_rtp_proxy();
} else if (is_method("INVITE")){
#force_rtp_proxy();
t_on_failure("1");
};
#if (isflagset(5))
if (isbflagset(3)){
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
}
t_on_reply("1");
}
## Failure Route 1
failure_route[1] {
xlog("!!!!!!!!! ON FAILURE ROUTE \r\n");
#if (isflagset(6) || isflagset(5)) {
if (isbflagset(3)) {
#unforce_rtp_proxy();
}
}
## Reply route
onreply_route[1] {
xlog("!!!!!!!!! ON REPLY ROUTE \r\n");
#if ((isflagset(5) || isflagset(6)) && status=~"(183)|(2[0-9][0-9])") {
if (isbflagset(3) && status=~"(183)|(2[0-9][0-9])") {
#force_rtp_proxy();
}
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
#if (isflagset(6)) {
if (isbflagset(3)) {
xlog("!!!!!!!!! ON REPLY ROUTE / FIX NATED CONTACT \r\n");
fix_nated_contact();
}
exit;
}
Hi,
I am evaluating software to solve SIP+RTP+NAT problems in typical SOHO setups:
Scenarios:
Typical scenarios are (A)DSL "dial-up / dynamic IP" connections with one
public IP and a router doing NAT for some LANs.
1)
WAN multiple LANs
internet <-> NAT router <-> SIP phones
sip registrar SIP proxy <-> SIP phones
with NAT logic :
2)
WAN multiple LANs
internet <-> NAT router <-> SIP proxy with NAT logic, SIP phones
sip registrar <-> SIP phones
:
Notes:
- the SIP phones use the SIP proxy with NAT logic as outbound proxy
- the proxy is notified if the public IP changes
The closest match so far has been siproxd [1]. But I would prefer to use
openser+nathelper+rtpproxy. Now it seems nathelper is designed for
a different scenario (SIP provider):
WAN/internet
sip registrar <-> ser+nathelper <-> NAT router <-> multiple LANs with
SIP phones
and uses the packet source address in fix_nated_contact.
Now I stumbled across milkfish [2] and its patches [3] to openser
(nathelper).
It seems the patch allows to explicitly set the address used by
fix_nated_contact to rewrite the contact header (instead of using the
packet source address). Searching the mailing list archives I did not
find a better solution.
Closest match I found was the thread:
"[Devel] Extended nathelper" started by Walter Schober
http://www.mail-archive.com/devel@openser.org/msg01930.html
Ending in the suggestion to use add_rvc_param(). But add_rcv_param seems
to use the packet source address, too.
But also from this thread it seems one might use the mangle module to
rewrite the contact header field, but then I am not sure about the state
of this module: "This is a module to help with SDP mangling. Still in testing."
I am a bit surprised that there is no straight forward solution to such
a common setup. Am I missing something really obvious?
Thanks
Greetings
Jens Thiele
[1] siproxd <http://siproxd.sourceforge.net/>
[2] milkfish <http://wiki.milkfish.org>
[3] milkfish openser patches
<http://packages.milkfish.org/boozy/Milkfish_Sources_for_OpenWrt-SDK/OpenWrt…>