I've this ser installation whose purpose in life is accounting all the
calls and redirecting them to asterisk, which routes them to ISDN or a
h323 GSM gateway.
SIP phones -> Ser -> Asterisk -> [isdn | gsm ]
all the calls are "from left to right", asterisk will never see incoming
stuff from the isdn/gsm channels
radius has mysql as backend, the calls works well but :
if the sip phone hangsup radius writes two identical lines in the
radacct table, missing the AcctSessionTime value (writes '0')
if the remote phone hangsup there are the same two lines and a third
line with caller and called inverted, and start and stop time with the
same value
Can someone tell me what's wrong with my route ? or I'm missing
something in radius configuration ?
some columns and lines from the radacct table
"RadAcctId","AcctSessionId","AcctUniqueId","UserName","AcctStartTime","AcctStopTime"
#these lines inserted if the caller hangsup first
49,"e7e71b1b-70eec1ee(a)172.18.1.13","d9428a25afbfdf52","[sip
number]","2005-08-10 08:54:53","2005-08-10 08:54:58"
50,"e7e71b1b-70eec1ee(a)172.18.1.13","d9428a25afbfdf52","[sip
number]","2005-08-10 08:54:53","2005-08-10 08:54:58"
#these if the called number hangsup
51,"72660925-e480d1a5(a)172.18.1.13","43e7c757d53c2970","[sip
number]","2005-08-10 08:57:10","2005-08-10 08:57:22"
52,"72660925-e480d1a5(a)172.18.1.13","43e7c757d53c2970","[sip
number]","2005-08-10 08:57:10","2005-08-10 08:57:22"
53,"72660925-e480d1a5(a)172.18.1.13","5b732c77e7e3f37d","[external
number]","2005-08-10 08:57:13","2005-08-10 08:57:13"
acc_radius paramethers :
modparam("acc", "radius_config", "/etc/radiusclient-ng/radiusclient.conf")
modparam("acc", "log_level", 2)
modparam("acc", "log_fmt", "cdfimorstup")
modparam("acc", "radius_flag", 1)
routing configuration :
# initial sanity checks
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;
};
# registration (and authentication)
if (uri==myself) {
if (method=="REGISTER") {
if (!radius_www_authorize("")) {
www_challenge("", "0");
break;
};
save("location");
break;
};
lookup("aliases");
};
setflag(1);
if (method=="INVITE") record_route();
rewritehost("172.18.1.11");
if (!t_relay()) {
sl_reply_error();
};
Hi all,
I have a question about routing a call to GW when user isn't in location
table.
If I have a user with SIP address:
sip:mister@no.com,
and his alias in form of his business phone on office PBX:
alias = 1234
can SER use number in aliases and rewrite sip:mister@no.com to
<mailto:1234@no.com> 1234(a)no.com?
sip:mister@no.com -> "404 Not Found" -> use aliases -> sip:1234@no.com ->
t_relay -> GW -> PBX
or something like that. So if someone could explain me how can I do this. Do
I need some external application to do that and return PSTN number to SER?
Or how can I do forking with SER?
thanks
Hi,
Trying to do the following:
pstn->SER->asterisk (call forward)->SER->Pstn
The far end rings but when you answer the call, I get an error in Asterisk: "Got SIP response 481 "Invalid CSeq Number" back from XXX.XX.XX.XX (SER).
I have tried the same using two SER machines with the same result, but if I change the scenery to pstn->SER->asterisk (call forward) -> asterisk-> Pstn, it works fine!
What could be wrong here? Does anybody implemented the scenery explained above? Could anybody give me a clue?
Thanks a lot.
Regards,
Victor.
hi,
I did admin the other SER and that works. Thanx.
Now if the request is for foreign calls I send the request from my OPENSER to a foreign SER . That SER does trust me through the source IP. We buy pstn minutes from them. Now the calls are possible when the users are with public IP and also behind NAT. But when the call is for the Cisco phone that is to be handled by the Foriegn SER it does not get established neither the rtp sesions gets established between my SER and the end called party.
Can u pls suggest a particular way to handle such calls. Can u pls suggest wat might b the problem. Thanx a lot
My configuration is:
debug=3
fork=yes
log_stderror=no
listen=203.XXX.64.XX # INSERT YOUR IP ADDRESS HERE
port=5060
children=4
dns=no
rev_dns=no
fifo="/tmp/ser_fifo"
fifo_db_url="mysql://openser:openserrw@localhost/openser"
loadmodule "/usr/local/lib/openser/modules/mysql.so"
loadmodule "/usr/local/lib/openser/modules/sl.so"
loadmodule "/usr/local/lib/openser/modules/tm.so"
loadmodule "/usr/local/lib/openser/modules/rr.so"
loadmodule "/usr/local/lib/openser/modules/maxfwd.so"
loadmodule "/usr/local/lib/openser/modules/usrloc.so"
loadmodule "/usr/local/lib/openser/modules/registrar.so"
loadmodule "/usr/local/lib/openser/modules/auth.so"
loadmodule "/usr/local/lib/openser/modules/auth_db.so"
loadmodule "/usr/local/lib/openser/modules/uri.so"
loadmodule "/usr/local/lib/openser/modules/uri_db.so"
loadmodule "/usr/local/lib/openser/modules/mediaproxy.so"
loadmodule "/usr/local/lib/openser/modules/nathelper.so"
loadmodule "/usr/local/lib/openser/modules/textops.so"
loadmodule "/usr/local/lib/openser/modules/avpops.so"
loadmodule "/usr/local/lib/openser/modules/domain.so"
loadmodule "/usr/local/lib/openser/modules/permissions.so"
loadmodule "/usr/local/lib/openser/modules/acc.so"
modparam("auth_db|permissions|uri_db|usrloc|acc",
"db_url", "mysql://openser:openserrw@localhost/openser")
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
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/local/etc/ser/sip-asymmetric-clients")
modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/ser/rtp-asymmetric-clients")
modparam("usrloc", "db_mode", 2)
modparam("registrar", "nat_flag", 6)
modparam("rr", "enable_full_lr", 1)
modparam("tm", "fr_inv_timer", 27)
modparam("tm", "fr_inv_timer_avp", "inv_timeout")
modparam("permissions", "db_mode", 1)
modparam("permissions", "trusted_table", "trusted")
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 1)
modparam("acc", "db_flag", 1)
route {
# -----------------------------------------------------------------
# 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;
};
# -----------------------------------------------------------------
# Record Route Section
# -----------------------------------------------------------------
if (method=="INVITE" && client_nat_test("3")) {
# INSERT YOUR IP ADDRESS HERE
record_route_preset("203.XXX.64.XX:5060;nat=yes");
} else if (method!="REGISTER") {
record_route();
};
# -----------------------------------------------------------------
# Call Tear Down Section
# -----------------------------------------------------------------
if (method=="BYE" || method=="CANCEL") {
end_media_session();
};
# -----------------------------------------------------------------
# Loose Route Section
# -----------------------------------------------------------------
if (loose_route()) {
if (has_totag() && (method=="INVITE" || method=="ACK")) {
if (client_nat_test("3")||search("^Route:.*;nat=yes")){
setflag(6);
use_media_proxy();
};
};
route(1);
break;
};
# -----------------------------------------------------------------
# Call Type Processing Section
# -----------------------------------------------------------------
if (uri!=myself) {
route(5);
route(1);
break;
};
if (uri==myself) {
if (method=="ACK") {
route(6);
break;
} else if (method=="CANCEL") {
route(3);
break;
} else if (method=="INVITE") {
route(3);
break;
} else if (method=="REGISTER") {
route(2);
break;
};
lookup("aliases");
if (uri!=myself) {
route(5);
route(1);
break;
};
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
break;
};
};
route(1);
}
route[1] {
# -----------------------------------------------------------------
# Default Message Handler
# -----------------------------------------------------------------
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("my_domain","subscriber")) {
www_challenge("my_domain","0");
break;
};
if (!check_to()) {
sl_send_reply("401", "Unauthorized");
break;
};
consume_credentials();
if (!save("location")) {
sl_reply_error();
};
}
route[3] {
# -----------------------------------------------------------------
# CANCEL and INVITE Message Handler
# -----------------------------------------------------------------
setflag(1);
if (client_nat_test("3")) {
setflag(7);
force_rport();
fix_nated_contact();
};
if (method=="INVITE" && !allow_trusted()) {
if (!proxy_authorize("my_domain","subscriber")) {
proxy_challenge("my_domain","0");
break;
} else if (!check_from()) {
sl_send_reply("403", "Use From=ID");
break;
};
consume_credentials();
};
lookup("aliases");
if (uri!=myself) {
route(5);
route(1);
break;
};
if (uri=~"^sip:011[0-9]*@") { # International PSTN
route(4);
break;
};
if (!lookup("location")) {
if (uri=~"^sip:[0-9]{10}@") { # Domestic PSTN
route(4);
break;
};
sl_send_reply("404", "User Not Found");
break;
};
if (method=="CANCEL") {
route(1);
break;
};
route(5);
route(1);
}
route[4] {
# -----------------------------------------------------------------
# PSTN Handler
# -----------------------------------------------------------------
#rewritehost("66.XXX.11.XX"); # INSERT YOUR PSTN GATEWAY IP ADDRESS
avp_write("i:45", "inv_timeout");
route(5);
route(1);
}
route[5] {
# -----------------------------------------------------------------
# RTP Proxy Enabler
# -----------------------------------------------------------------
if (isflagset(6) || isflagset(7)) {
use_media_proxy();
};
}
route[6] {
# ------------------------------------------------------------------------
# ACK Handler
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Aliases Section
# ------------------------------------------------------------------------
lookup("aliases");
if (uri!=myself) {
route(5);
route(1);
break;
};
lookup("location");
route(1);
}
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();
};
}
---------------------------------
Start your day with Yahoo! - make it your home page
Hi!
Is there a way for ser to recieve register message and then pass it to
another provider but the ser machine will do the rtp proxying?That is
all media packets will be relayed to ser to the user agents.
UA---NAT---SER----ANOTHER SS
Thanks!
_Jeff
Can SER server cascaded connected?
That's to say. There a centeralized SER registrar server.
below top layer, there are serval subordinate SER registrar server which must be registered on that centeralized registrar server.
In this case, how to configure those subordinate SER registrar servers to register onto that server?how to send "REGISTER" message onto center server?
All,
I am trying to connect to the database and write the enteries of a
field in a file but when trying to bind to the database I am getting
the following error.
/tmp/ccgppbh8.o(.text+0x28): In
function `main':
: undefined reference to `bind_dbmod'
The code is written within the PA module
#include <stdio.h>
#include <stdlib.h>
#include "../../db/db.h"
#define DB_URL "mysql://user:pass@127.0.0.1:3306/dbname"
int main() {
FILE *fp;
db_con_t* h;
db_res_t* res;
db_func_t* dbf;
if (bind_dbmod(DB_URL, dbf)) {
printf("Error while binding database module, did you
forget to load a database module ?\n");
return -1;
}
Please let me know. Any help will be highly appreciated.
Thanks,
Salony
"...Live a good, honorable life. Then, when you get older and think
back, you'll be able to enjoy it a second time."
Hi,
I m using mediaproxy for nat raversal and rtp handling. Nat is working
fine. Clients behind the nat are connected after ringing, but no audo
transmission takes place in either side.
On running the sessions.py of mediaproxy, the output is as following,
[root@sip ser]# python /usr/local/mediaproxy/sessions.py
Caller Via Called Status Duration
Codec Type Traffic
----------------------------------------------------------------------------
---------------------------
61.16.236.34:24742 - 66.114.236.182:35012 - ?.?.?.?:? inactive 0'12"
G711u Audio 19.42k/704/480
Total traffic: 0bps/0bps/0bps (in1/in2/out)
Session count: 1
Proxy version: 1.4.2
---------------
Why is the Called filed showing a ?.?.?.? even though the client is fully
resolved.
Please help urgent!!!
Regards,
Ashutosh Kumar
Chetu, Inc.
Ph : 1(305) 402 6724 - Witin US
Ph : 91 120 5323340 - Outside US
Fax:1 (305) 832 5987
For more information, please visit http://www.chetu.com
----- Original Message -----
From: "Marc Khayat" <marc(a)globalcarrier.net>
Date: Tuesday, August 9, 2005 9:00 pm
Subject: [Serusers] serctl start|stop|restart
> Hi all,
> The first few times I do START STOP or RESTART, everything works fine.
> But after that, it gives the following:
> [root@linux ~]# serctl stop
> Stopping SER : /usr/local/sbin/serctl: line 614: kill: (8771) - No
> suchprocess
> stopped
> [root@linux ~]#
> [root@linux ~]# serctl start
>
> Starting SER : PID file exists! (/var/run/ser.pid) already running?
> [root@linux ~]#
> [root@linux ~]# serctl restart
> Stopping SER : /usr/local/sbin/serctl: line 627: kill: (8771) - No
> suchprocess
> stopped
> Starting SER : PID file exists! (/var/run/ser.pid) already running?
>
> How can I solve it?
>
I've encounter this issue before, my previous encounter was caused by
misconfiguration in 'ser.cfg'. I can't remember what was my configuration.
If you have made any changes recently to ser.cfg. It could be the cause.
To stop ser, kill /var/run/ser.pid then start again.
seehoe