Hi,
I have a simple application where I am trying to an SRV record to load
balance towards a few different destination servers.
I set up my DNS server to resolve to four different destination A
record URIs - something like:
_sip._udp.aimcidfilter.com 180 IN SRV 1 50 5061 crunch.com.
_sip._udp.aimcidfilter.com 180 IN SRV 1 50 5061 spinner.com.
_sip._udp.aimcidfilter.com 180 IN SRV 2 50 5061 homer.com.
_sip._udp.aimcidfilter.com 180 IN SRV 2 50 5061 bart.com.
In my configuration file, I am putting a domain name in my call to
seturi as follows:
seturi("sip:feature_fs@aimcidfilter.com:6010");
and then I call route to send the INVITE.
I was expecting to see a NAPTR and SRV record attempts, but when I
sniffed DNS, I only saw A record attempts.
Any advice would be very helpful.
thanks,
Tim
------------------------------------
My configuration file looks as follows:
#
# TWC OpenSER SIP Proxy for Caller ID - openser_cid.cfg
#
# ----------- global configuration parameters ------------------------
debug=5 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no # (cmd line: -E)
maxbuffer=1048576
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
#reply_to_via=1
children=4
log_facility=LOG_LOCAL4
dns_use_search_list=no
dns_servers_no=2 # One for the ENUM server and one for other DNS lookups
user="sipproxy"
group="sipproxy"
disable_dns_blacklist=yes # FOR TESTING ONLY
dns_try_ipv6=no # FOR TESTING ONLY
# Local IP Address and port to listen to
# Set the following IP addresses to the value of the local e1000g0 interface
listen=udp:65.185.232.62:5060
# Alias IP address/port pair values will be in the Req URI when the
# OpenSER is being load balanced with a BIG IP server
# Set the IP addresses to the value of the associated blade
# of the BIG IP that is load balancing for the SIP Proxy server.
alias=65.185.233.104:5060
# LOAD OpenSER MODULES
mpath="/sw/lib/openser/modules/"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "acc.so"
loadmodule "mi_fifo.so"
loadmodule "xlog.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
modparam("usrloc", "db_mode", 0)
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
# ------------------------- request routing logic -------------------
modparam("acc", "log_level", 2)
modparam("acc", "log_flag", 1)
modparam("acc","report_cancels", 1)
modparam("acc","failed_transaction_flag", 1)
modparam("acc","log_extra", "req_uri=$rU")
modparam("tm", "fr_timer", 5)
modparam("tm","fr_inv_timer",5)
modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
# 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 within 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) {
route(1);
};
if (method=="OPTIONS") {
sl_send_reply("200", "OK");
exit;
}
if (uri =~ "^sip:feature_fs@" || method=="NOTIFY") {
xlog("L_DBG", "TWC: received incoming message:\n <$mb>\n");
seturi("sip:feature_fs@aimcidfilter.com:6010");
setflag(1);
route(1);
} else {
sl_send_reply("404", "Not Found");
};
}
#####################################################
# Default Message Handler
#####################################################
route[1] {
# Send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (!t_relay()) {
sl_reply_error();
};
exit;
}
Hi,
I am from Bangladesh. I have downloaded and configured SER for proxy
purpose.
My server is working fine in test mode. Now I need some more features using
SER.
I wants to implement CDR and credit control module with this. My OS is
Redhat Ent 4.
What are the applications I need to to do so, pls let me know.
Rgds
Tuhin
I'm trying to compile the trunk version.
After updating I run
make distclean
and
make exclude_modules="auth_diameter h350 ldap mi_xmlrpc osp
postgres unixodbc" modules install
but after I always get:
make[1]: Leaving directory
`/usr/local/src/VoIP/openser/openser/trunk/modules/auth_db'
make: *** [modules] Error 2
What is this "Error 2" ? In this same machine I can compile, without a
glance, branche 1.2 with this same 'make' command.
Thanks for any help....
Edson
Ok, I am brand new to openser and don't really have ti routing anything
yet. But I did have a dumb or at least naive question.
Can openser be configured as a very simple load balancer and redirect
registration requests, in a round robin manner, to a set of Asterisk
servers? I know having openser be the registrar is the best solution in
the long run, but this may solve an issue quickly. I looked at the
dispatch module and I know it will do want I want for invites, but
didn't know if registration requests could be redirected.
Thanks,
Mike Clark
Hi all, i'm newbie in SER,
I want to route RTP packets between 2
computers with x-lite client voip
in the same network through
Mediaproxy. I know this may have
no sense, but it's just a test
configuration.
The call use_media_proxy() seems to have no effect,
the
RTP packets go directly from one computer to
another, no packet trough
Mediaproxy.
This is my environment:
SER and Mediaproxy on the same PC
(192.168.123.186)
X-lite client_A running on 192.168.123.10
X-lite
client_B running on 192.168.123.168
Client_A call Client_B that accept,
but mediaproxy refuses to
proxy the call.
This is my ser.cfg
#
----------- global configuration parameters ------------------------
debug=3 # debug level
listen=192.168.123.186
port=5060
log_facility=LOG_LOCAL6
fork=no
log_stderror=yes
check_via=no #
(cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no #
(cmd. line: -R)
fifo="/tmp/ser_fifo"
fifo_db_url="mysql://ser:
heslo@localhost/ser"
# ------------------ module loading
----------------------------------
loadmodule
"/usr/local1/lib/ser/modules/mysql.so"
loadmodule
"/usr/local1/lib/ser/modules/sl.so"
loadmodule
"/usr/local1/lib/ser/modules/tm.so"
loadmodule
"/usr/local1/lib/ser/modules/rr.so"
loadmodule
"/usr/local1/lib/ser/modules/maxfwd.so"
loadmodule
"/usr/local1/lib/ser/modules/usrloc.so"
loadmodule
"/usr/local1/lib/ser/modules/registrar.so"
loadmodule
"/usr/local1/lib/ser/modules/textops.so"
loadmodule
"/usr/local1/lib/ser/modules/uri.so"
loadmodule
"/usr/local1/lib/ser/modules/uri_db.so"
loadmodule
"/usr/local1/lib/ser/modules/domain.so"
loadmodule
"/usr/local1/lib/ser/modules/auth.so"
loadmodule
"/usr/local1/lib/ser/modules/auth_db.so"
#MEDIA PROXY module needed
loadmodule "/usr/local1/lib/ser/modules/mediaproxy.so"
loadmodule
"/usr/local1/lib/ser/modules/nathelper.so"
# ----------------- setting
module-specific parameters ---------------
# -- usrloc params --
modparam("usrloc", "db_mode", 2)
# -- auth params --
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")
#SQL settings
modparam("auth_db", "db_url", "mysql://ser:
heslo@localhost/ser")
modparam("usrloc", "db_url", "mysql://ser:
heslo@localhost/ser")
#MEDIAPROXY settings
#---------------------------
# configurazione moduli
#---------------------------
modparam("nathelper", "rtpproxy_disable",
1)
modparam("nathelper", "natping_interval", 0)
modparam("mediaproxy","
natping_interval", 30)
modparam("mediaproxy","mediaproxy_socket","
/var/run/mediaproxy.sock")
modparam("mediaproxy","sip_asymmetrics","
/usr/local1/etc/ser/sip-clients")
modparam("mediaproxy","
rtp_asymmetrics","/usr/local1/etc/ser/rtp-clients")
modparam
("registrar", "nat_flag", 6)
# -- 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 >= 2048 ) {
sl_send_reply("513",
"Message too big");
break;
};
# 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=="INVITE" && client_nat_test("3")) {
# record_route_preset("192.168.123.186:5060;nat=yes");
#} else if (method!="REGISTER") {
#
record_route();
#};
if (method=="INVITE" ) {
if (client_nat_test("3")) {
record_route_preset("192.168.123.186:5060;
nat=yes");
} else record_route_preset
("192.168.123.186");
}
else if (method!="REGISTER") {
record_route();
};
if (method=="
BYE" || method=="CANCEL") {
end_media_session();
};
# subsequent messages withing a dialog should take
the
# path determined by record-routing
#
-----------------------------------------------------------------
# Loose Route Section
#
-----------------------------------------------------------------
if (loose_route()) {
if ((method=="INVITE" ||
method=="REFER") && !has_totag()) {
sl_send_reply("403", "Forbidden");
break;
};
if (method=="INVITE") {
if (!proxy_authorize("","subscriber")) {
proxy_challenge("","0");
break;
} else
if (!check_from()) {
sl_send_reply
("403", "Use From=ID");
break;
};
consume_credentials();
if (client_nat_test("3")
|| search("^Route:.*;nat=yes")) {
setflag(6);
use_media_proxy();
};
};
route(1);
break;
};
if (!uri==myself) {
route(4);
route(1);
break;
};
# 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);
break;
} else if (method=="CANCEL") {
route(1);
break;
} else if
(method=="INVITE") {
route(3);
break;
} else if (method=="
REGISTER") {
route(2);
break;
};
lookup("aliases");
if (uri!=myself) {
route(4);
route(1);
break;
};
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
break;
};
};
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
t_on_reply("1");
if
(!t_relay()) {
if (method=="INVITE" || method=="ACK") {
end_media_session();
};
sl_reply_error();
};
}
route[2] {
#
-----------------------------------------------------------------
# REGISTER Message Handler
#
----------------------------------------------------------------
sl_send_reply("100", "Trying");
if (!search("^Contact:
[ ]*\*") && client_nat_test("7")) {
setflag(6);
fix_nated_register();
force_rport();
};
if (!www_authorize("","subscriber")) {
www_challenge("","0");
break;
};
if (!check_to()) {
sl_send_reply("401",
"Unauthorized");
break;
};
consume_credentials();
if (!save("location")) {
sl_reply_error();
};
}
route[3] {
#
-----------------------------------------------------------------
# INVITE Message Handler
#
-----------------------------------------------------------------
if (client_nat_test("3")) {
setflag(7);
force_rport();
fix_nated_contact();
};
if (!proxy_authorize("","subscriber")) {
proxy_challenge("","0");
break;
} else if (!check_from()) {
sl_send_reply("403", "Use
From=ID");
break;
};
consume_credentials();
lookup("aliases");
if (uri!
=myself) {
route(4);
route(1);
break;
};
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
break;
};
route(4);
route(1);
}
route[4] {
#
-----------------------------------------------------------------
# NAT Traversal Section
#
-----------------------------------------------------------------
if (isflagset(6) || isflagset(7)) {
if (!
isflagset(8)) {
setflag(8);
use_media_proxy();
};
};
}
onreply_route[1] {
if ((isflagset(6) || isflagset(7)) &&
(status=~"(180)|(183)|2[0-9][0-9]")) {
if (!search
("^Content-Length:[ ]*0")) {
use_media_proxy();
};
};
if (client_nat_test("1")) {
fix_nated_contact();
};
}
And this is
Mediaproxy Log:
Listening for commands on local socket
`/var/run/mediaproxy.sock'
Listening for remote commands on `192.
168.123.186:25060'
Remote commands are allowed from: 192.168.123.186,
127.0.0.1
Using IP address `192.168.123.186' for the RTP/RTCP proxy
request B390Opu7cB 192.168.123.168:25500:audio 192.168.123.168 sip.
antech.it local 192.168.123.186 remote unknown-agent info=from:
orazio@sip.antech.it,to:j2me@sip.antech.it,
fromtag:As94,totag:
session
B390Opu7cB: started. listening on 192.168.123.186:52010
execution
time: 1.71 ms
lookup B390Opu7cB 192.168.123.186:25500:audio
192.168.123.186 sip.antech.it local sip.antech.it unknown unknown-agent
info=from:orazio@sip.antech.it,to:j2me@sip.antech.it,fr
omtag:As94,
totag:oePf
execution time: 0.57 ms
session B390Opu7cB: caller signed
in from 192.168.123.168:25500 (RTP) (will return to 192.168.123.168:
25500)
status
execution time: 0.14 ms
session B390Opu7cB: 2/0/0
packets, 344/0/0 bytes (caller/called/relayed)
session B390Opu7cB:
ended (did timeout).
delete B390Opu7cB info=
execution time: 0.14 ms
and this is dump of session.py
[root@sip mediaproxy]# ./sessions.py
Caller Via Called Status
Duration Codec Type Traffic
----------------------------------------------------------------------------------------------------
192.168.123.168:25500 - 192.168.123.186:52010 - ?.?.?.?:? inactive
0'32" GSM Audio 344/0/0
Total traffic: 0bps/0bps/0bps
(in1/in2/out)
Session count: 1
Proxy version: 1.9.0
Is mediaproxy
working just between different networks
or it's an error in my
configuration file?
Please help me. Any suggestions?
Orazio
Hi,
All how can i run rtpproxy to save recorded conversation locally?
i tried:
/usr/local/bin/rtpproxy -l 1.2.3.4 -s udp:1.2.3.4:17000 -r /var/media
but got nothing under /var/media after making calls
/usr/local/bin/rtpproxy -l 1.2.3.4 -s udp:1.2.3.4:17000 -r /var/media -S
/var/media
also got nothing? has anyone tried it?
thank you
regards,
nhadie
klaus,
if you want to support domains in route headers, then you need to do
naptr and srv lookups for the domain when handling loose routing. it is
not enough to compare the domain to the ones domain module knows about.
domain in route header may namely be anything as long as it resolves to
your proxy. for this reason, i don't like the idea of domains in route
headers. it hurts performance far too much.
-- juha
Hello,
I'm trying to make outbound proxy for my network using OpenSER.
Currently I've configured OpenSER as sip registrar/rtpproxy and it works
fine even with NAT traversal. The problem is that I don't how shuould I
reconfigure my config to make it work as outbound proxy. I've tried many
changes with no results. The first problem is how to correctly handle
the register method. My config is based on:
http://siprouter.onsip.org/doc/gettingstarted/ch08s02.html
Can anyone help me?
Best regards,
Dawid Jaroslawski
Hi everyone,
I use 1.1.1 notls,
in my testing environment I came across some strange errors when using a
home made script in combination with the openserunix util.
First of all there were thousands of files like"/tmp/OpenSER.XXXXXX"
but looking around with google I found a patch for that:
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1708301&group_…
Then with the home made script I was still getting lots of socket
errors in syslog, a colleague of mine fixed the openserunix.c
############################################################
--- openserunix.c.ori 2007-09-13 19:54:00.406861237 +0200
+++ openserunix.c 2007-09-13 19:54:07.407260167 +0200
@@ -97,6 +97,7 @@
goto err;
}
+ from_len = sizeof(from);
len = recvfrom(sock, buffer, BUF_SIZE, 0, (struct sockaddr*)&from, &from_len);
if (len == -1) {
fprintf(stderr, "Error in recvfrom: %s\n", strerror(errno));
############################################################
maybe this is useful for someone since even the newest OpenSER version hast the "buggy" openserunix util :-)
cheers,
Patrick.