Hi guys,
I'm having a problem with an OpenSER acting as registrar server and
load balancer for many Asterisk servers.
In a few words: "users are registering on openser and, when they want
to make a call, OpenSER proxies the request to an Asterisk server
with the dispatcher module"
Here is the intended data flow (SIP goes through OpenSER and media
goes directly to Asterisk)
User <-- SIP --> OpenSER <-- SIP --> Asterisk
User <-- RTP --> Asterisk
Both, OpenSER and Asterisks have public IPs
I already have a working setup of that and everything seems working correctly.
I'm trying to replicate that setup on another site, same
configurations of the boxes, same versions of OpenSER and Asterisk,
etc... but I'm having monodirectional Audio.
Having a look with tethereal I see that OpenSER, when the
communication is answered, sends a SIP packet (200 OK) to the user
indicating itself as media endpoint instead of the Asterisks.
From that moment I see RTP packets flowing from the client to OpenSER
This seems really strange to me because I just copied the same
configurations file from a working setup to the new installation.
Tnx in advance for help.
Regards
P.S.: Here is my openser.cfg
## $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 andrei Exp $
## simple quick-start config script
#
# ----------- global configuration parameters ------------------------
#debug=3 # debug level (cmd line: -dddddddddd)
fork=yes
#log_stderror=no # (cmd line: -E)
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
#children=4
#port=5060
fifo="/tmp/ser_fifo"
#uid=nobody
#gid=nobody
# ------------------ module loading ----------------------------------
loadmodule "/usr/lib/openser/modules/sl.so"
loadmodule "/usr/lib/openser/modules/tm.so"
loadmodule "/usr/lib/openser/modules/rr.so"
loadmodule "/usr/lib/openser/modules/maxfwd.so"
loadmodule "/usr/lib/openser/modules/usrloc.so"
loadmodule "/usr/lib/openser/modules/registrar.so"
loadmodule "/usr/lib/openser/modules/nathelper.so"
loadmodule "/usr/lib/openser/modules/textops.so"
loadmodule "/usr/lib/openser/modules/exec.so"
loadmodule "/usr/lib/openser/modules/uri.so"
loadmodule "/usr/lib/openser/modules/uri_db.so"
loadmodule "/usr/lib/openser/modules/dispatcher.so"
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/lib/openser/modules/mysql.so"
loadmodule "/usr/lib/openser/modules/auth.so"
loadmodule "/usr/lib/openser/modules/auth_db.so"
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "db_url", "mysql://xxx:xxx@xxx.xxx.xxx.xxx/openser")
modparam("usrloc", "timer_interval", 120)
modparam("auth_db", "calculate_ha1", 0)
modparam("auth_db", "db_url", "mysql://xxx:xxx@xxx.xxx.xxx.xxx/voip")
modparam("uri_db", "db_url", "mysql://xxx:xxx@xxx.xxx.xxx.xxx/openser")
modparam("rr", "enable_full_lr", 1)
modparam("registrar", "nat_flag", 6)
modparam("registrar", "max_expires", 3600)
modparam("registrar", "min_expires", 60)
modparam("registrar", "append_branches", 0)
modparam("registrar", "desc_time_order", 1)
modparam("nathelper", "natping_interval", 20) # Ping interval 20 s
modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT
modparam("dispatcher", "force_dst", 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 > max_len ) {
sl_send_reply("513", "Message too big");
exit;
};
if ( (method=="OPTIONS") || (method=="SUBSCRIBE") || (method=="NOTIFY") ) {
sl_send_reply("405", "Method Not Allowed");
exit;
}
if (!method=="REGISTER") {
record_route();
};
if ((src_ip==xxx.xxx.xxx.xxx) || (src_ip==xxx.xxx.xxx.xxx)) { # IP of Asterisks
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
# forward to current uri now; use stateful forwarding; that
# works reliably even if we forward from TCP to UDP
if (!t_relay()) {
sl_reply_error();
};
exit;
};
if (nat_uac_test("3")) {
if ((method=="REGISTER") || (method=="INVITE") || (method=="OPTIONS")) {
fix_nated_contact();
force_rport();
setflag(6); # Mark as NATed
}
}
# 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 (method=="REGISTER") {
if (!proxy_authorize("domain", "openser_view")) {
proxy_challenge("domain", "0");
exit;
}
if (!check_to()) {
sl_send_reply("403", "Digest username and URI username do NOT match!
Stay away!");
exit;
}
save("location");
exit;
};
if (method=="INVITE") {
if (!proxy_authorize("domain", "openser_view")) {
proxy_challenge("domain", "0");
exit;
}
if (!check_from()) {
sl_send_reply("403", "Digest username and URI username do NOT match!
Stay away!");
exit;
}
}
# loose-route processing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
exit;
};
if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
route(1);
exit;
};
append_hf("P-hint: usrloc applied\r\n");
route(1);
}
route[1]
{
# ! Nathelper
if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&
!search("^Route:")){
sl_send_reply("479", "We don't forward to private IP addresses");
exit;
};
# NAT processing of replies; apply to all transactions (for example,
# re-INVITEs from public to private UA are hard to identify as
# NATed at the moment of request processing); look at replies
t_on_reply("1");
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if ((src_ip!=xxx.xxx.xxx.xxx) && (src_ip!=xxx.xxx.xxx.xxx)) { # IP of Asterisks
ds_select_dst("2", "0");
}
if (!t_relay()) {
sl_reply_error();
};
}
# ! Nathelper
onreply_route[1] {
# NATed transaction ?
if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {
fix_nated_contact();
# otherwise, is it a transaction behind a NAT and we did not
# know at time of request processing ? (RFC1918 contacts)
} else if (nat_uac_test("1")) {
fix_nated_contact();
};
}
Hi !
A have a small technical question:)
It considers serving of multiple domain.
I would like to make sure that I understand things right.
After I read the user doc and README from domain module I came to the
following state of art:)
1)one has to create the seperate location and subscriber table for each
domain
*so if i have for instance two domains : dom1.com and dom2.com then my
ser has to have
the according dns records in the dns server?
2) after creating the tables i need to add domains record in the
database to the domain table
*I dont know why but when ever i try to add or show domains o get the
following error
500 command 'domain_dump' not available - why is that so?
any way instead of an error the serctl command adds the domain record to
the database
3) modify the ser.cfg file - add appropriate modparam commands
4) modify the ser.cfg file by adding a regular expression analizys to
invoke the
save, www_chalenge, proxy_chalenge and lookup correctly with the right
domain?
Please tell me is my thinking here right?
or maybe there is another way
As allway thank u for your time.
Bests
tomek
if you happen to have a PCAP file with the incident, let me please know.
-jiri
p.s. even if you didn't tweak timers, the results may be suboptimal because
the software version you are using is having rather indeterministic timer subsystem.
For example, the recent measurements (http://www.iptel.org/ser/doc/performance)
show quite scattered server responsiveness under high load. (Note though that
the measurement results were achieved in a best-effort manner based on the tester
knowledge and understanding of openser and that the result are not officially confirmed
by the OpenSER project.) Whether it is indeed the cause is not certain though
-- this looks really like a stealth bug.
At 15:58 15/12/2006, Max Gregorian wrote:
>Thanks very much for all the replies. I shall try and post a config and traces as soon as I can get them from the office.
>
>Some more information, if it helps:
>
>Server specs:
>- HP ProLiant DL360 G4 (1U rack servers)
>- 3 GHz processors (800 MHz FSB)
>- 1 GB RAM
>- 10K rpm SCSI HDs (in a RAID 1+0 Mirror)
>
># Servers are running OpenSER 1.0.1 (no-TLS).
># Servers are listening on 3 ports (both tcp and udp for each port), so in openserctl ps I am seeing 4 child processes for each port.
># Servers running CentOS Linux 4.3
># MySQL installed when CentOS was installed but not running and not currently being used with Openser.
>
>
>Things I have pretty much managed to eliminate are:
>1. It's doesn't seem to be hardware. The specs for the servers are more than sufficient I think.
>2. It doesn't seem to be traffic/load related as I see these problems on 2 brand new servers I have just installed with no traffic on them. However, it does seem to get worse with more traffic.
>3. I don't think it's database related as I have deliberately not configured mysql on any of the servers in case of database performance.
>4. I haven't played with the timers at all so far.
>5. I haven't configured nscd yet, but as far as I can tell it's not caching DNS.
>6. Though openser is listening on tcp ports as well, currently only the udp ports are being used as most of our customers use hardware phones. In any case, I haven't as yet seen as requests on tcp.
>7. I am not sure it is DNS as in the tests I ran I sent requests directly to the external IP of the server and not to the domain name it is responsible for. Also the test servers are now only responsible for one domain, but in future will have more than one.
>8. Also TTL on the domain name is really short. Ping from the server itself TTL=64 and ping times are low as you would expect (< 1ms when pinging from the server itself). Ping from outside the network (from the internet - for me - tp the domain was) 12ms (average), no packet loss, TTL = 53.
>9. I have not setup any internal DNS entries for the domain. Servers are resolving domain from entries in /etc/hosts.
>
>Like I said, it doesn't happen all the time - just maybe once or twice every hour on the servers with more traffic.
>
>I ran SIPp pointing at one of the new servers last week and at around 100CPS I was seeing about 2,000 out of approx. 10,000 calls were failing. Setup was UAC -> openser -> UAS (Both UAC and UAS were running on the same machine, but different ports). Again there is no traffic on these servers now so I have no idea why so many failed calls.
>
>I am not sure if any of this information helps, but I am certainly open to suggestions on things to try.
>
>Thanks in advance.
>
>
>
>On 12/14/06, samuel <<mailto:samu60@gmail.com>samu60(a)gmail.com> wrote:
>It might be due to a DNS query....whenver a request has to be
>forwarded to a domain, openSER makes a DNS query to resolv the IP.
>During this operation, the child processing the request will not
>answer to further incoming messages.
>
>it also can be happening due to a spiral loop that stays on the server.
>
>Without further information (confg,logs) it's hard to tell which is
>the reason...
>
>hope it helps,
>Samuel.
>
>without more information
>
>2006/12/14, Max Gregorian <<mailto:gregorian442@googlemail.com>gregorian442(a)googlemail.com>:
>> Hi all,
>>
>> Just wondering if anyone else has had this problem. I have noticed while
>> tracing on my OpenSER server, that every now and then the server receives a
>> packet which it does to respond to immediately, resulting in a string of
>> packets being sent to the server and then the server responding a few
>> seconds later. This does not happen all the time, just say maybe once or
>> twice every hour. The rest of the time the signaling is correct and
>> responses follow request packets in the correct order.
>>
>> What I am trying to figure out is whether this is a load traffic issue (i.e.
>> can the server not handle too much load), and if so is it OpenSER or the
>> network or the server in general? I have run diagnostics on the servers and
>> there is nothing wrong with the hardware.
>>
>> On the other hand Could this be related to any timer issues? I remember
>> there was mention of timers in SER but are there any default timer settings
>> that can be tweaked?
>>
>> Thanks in advance for any response.
>>
>>
>> _______________________________________________
>> Users mailing list
>> <mailto:Users@openser.org>Users(a)openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>
>
>_______________________________________________
>Users mailing list
>Users(a)openser.org
>http://openser.org/cgi-bin/mailman/listinfo/users
--
Jiri Kuthan http://iptel.org/~jiri/
Hi
I try to check the username in the URI, this is, if the username do not have ten digits then send a message, I made:
avp_write("^[0-9]{10}","$avp(s:fm_avp)");
if(avp_check("$fU","fm/$avp(s:fm_avp)/g")) {
insert_hf("To-username: -$fU- \r\n", "Call-ID");
} else {
sl_send_reply("400", "Bad Request");
exit;
};
but I ever obtain 400 message.
I try too with:
if(avp_check("$fU","re/[0-9]{10}$/g")) {
insert_hf("To-username: -$fU- \r\n", "Call-ID");
else{
sl_send_reply("400", "Bad request");
exit;
}
But I obtain the same message. Any idea?
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.yahoo.com.mx/
SER is identifying call even W/O branch parameter and i have not used
forward(). My only question was to make sure that RTC/1.2 should generate
branch parameter.
>From: Martin Hoffmann <hn(a)nvnc.de>
>To: Jiri Kuthan <jiri(a)iptel.org>
>CC: Kapil Dhawan <digitaltuffy(a)hotmail.com>, serusers(a)lists.iptel.org
>Subject: Re: [Serusers] branch parameter
>Date: Mon, 18 Dec 2006 16:58:00 +0100
>
>Jiri Kuthan wrote:
> > At 17:05 17/12/2006, Kapil Dhawan wrote:
> >
> > > I am using RTC/1.2 library and its not generating branch parameter.
> >
> > too bad, most implementation can deal with it in backw2ards
>compatibility mode
> > but clients should no longer generate such branch. I would be looking
>for
> > a more up-to-date stack if I was you.
>
><evil>
>Ever used forward() in SER?
></evil>
>
>Regards,
>Martin
_________________________________________________________________
Christmas is drawing near and the excitement is in the air! Check out this
cool photofeature on Christmas celebrations the world over
http://www.msnspecials.in/photogallery/photogallery.asp?id=a200611814137906
Howard Tang wrote:
> Hi klaus,
>
> I am new to the VOIP / Voice world. Thank you for your reply. I just
> want openser to generate CDR. Do i need radius to do that?
>
> Regards,
> Howard
>
> Klaus Darilion wrote:
>> Howard Tang wrote:
>>> Hi,
>>>
>>> Can someone give me some idea of how i can obtain CDR from Openser
>>> please?
>>>
>>> I saw a open source software called cdrtools, however, i don't want
>>> to install apache on my machine.
>>
>> cdrtools does not generate CDRs. It just analyzes the CDRs.
>>
>> Thus, what do you want?
>> Creating CDRs or analyzing?
>>
>> openser can create CDRs for DB, Radius or syslog using the acc module
>> (see module documentation on openser.org)
no, you do not need radius. you can alos use syslog accounting or
database accounting.
http://www.openser.org/docs/modules/1.1.x/acc.html
btw: please cc the mailing list
regards
klaus
>>
>> regards
>> klaus
>>
>>>
>>> Any other CDR software will work with openser
>>
>>>
>>> Regards,
>>> Howard
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users(a)openser.org
>>> http://openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>
--
Klaus Darilion
nic.at
When I make a call to someone, a call which is correctly connected, for
example via PSTN gateway, I can watch INVITEs, ACKs, OKs and BYEs being
relayed from my station the my openser to the gateway, and back..
However if the phone rings, and I decide to terminate the call (before
the other person responds), I see the CANCEL going from my station to
the sipserver, but I don't see it being sent to the PSTN gateway..
Is this something I have to specifically route for?
The CANCEL is part of the same call sequence, is there a reason it
wouldn't be relayed, other than a mistake in my routing, obviously..
Nick
I'm sorry for the delay, but we had to do a deliverable in this date, and it was imposible to answer before.
>Could you try again after runing:
>ulimit -c unlimited # you need bash for this
>ser -f ser.cfg -w /tmp/
The parameter "unlimited" already was in this node, so I think this is not the problem.
The scenario used in our test is the following:
-
There are two user terminals that are communicated by SIP Communicator
program. The INVITE message (problematic paquet) travels through the
nodes until it arrive at the Proxy node. In this node is the problem
with the core shown in my previous message. We have MIPv6 in our
scenario. In our case, we use mipv6-2.0.2 from http://www.mobile-ipv6.org/ . We have ubuntu with kernel 2.6.16.24
Next, i'll show you the configuration file in the Proxy node:
******************************************************************
#
# P-CSCF
#
# ----------- global configuration parameters ------------------------
check_via=no # (cmd. line: -v)
dns=yes # (cmd. line: -r)
rev_dns=yes # (cmd. line: -R)
fifo="/tmp/ser_fifo"
listen="pcscf"
# ------------------ module loading ----------------------------------
loadmodule "/usr/lib/ser/modules/sl.so"
loadmodule "/usr/lib/ser/modules/tm.so"
loadmodule "/usr/lib/ser/modules/rr.so"
loadmodule "/usr/lib/ser/modules/maxfwd.so"
loadmodule
"/usr/lib/ser/modules/textops.so"
loadmodule
"/usr/lib/ser/modules/xlog.so"
# ----------------- setting module-specific parameters ---------------
# -- 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");
break;
};
if (msg:len > max_len ) {
sl_send_reply("513", "Message too big");
break;
};
if (method=="REGISTER") {
# Append the Path header
# FIXME: "Require" and "Supported" issues
append_hf("Path: <sip:term@pcscf.domainA.ammi.dit.upm.es;lr>\r\n");
append_hf("Require: path\r\n");
};
# -----------------------------------------------------------------
# Loose Route Section
# -----------------------------------------------------------------
if (method != "REGISTER") {
record_route();
};
if (loose_route()) {
route(1);
break;
};
# forward to current uri
now; use stateful forwarding; that
# works reliably even if we forward from TCP to UDP
route(1);
}
route[1] {
# -----------------------------------------------------------------
# Default Message Handler
# -----------------------------------------------------------------
if (!t_relay()) {
sl_reply_error();
};
}
****************************************************************
In the next message i'll show the packet INVITE that produces the error becuase. Otherwise, the message would be very big (>40 KB) and it would not be shown.
Thanks.
______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com