Hi All,
i want to stop second registration request if use already registered i
am using below code but getting no any response. please help me how to
solve this problem.
if (method=="REGISTER") {
if (registered("location") ) {
xlog("L_NOTICE","Asif: lookup(location) Passed\n");
sl_send_reply("699", "User Not Found");
return;
}
route(2);
return;
route[2] {
# -----------------------------------------------------------------
# REGISTER Message Handler
# ----------------------------------------------------------------
xlog("L_NOTICE","Danish: Entering route[2]\n");
# if (registered("location")) {
# xlog("L_NOTICE","Asif: lookup(location) failed\n");
# sl_send_reply("404", "User Not Found");
# return;
# };
xlog("L_NOTICE","Asif: Register message IPsrcaddr [$si],
RecvdIPaddr[$Ri]\n");
if (!search("^Contact:[ ]*\*") && nat_uac_test("2")) {
xlog("L_NOTICE","Danish: In route[2] Found Nated contact\n");
setflag(6);
setbflag(6);
# if you want OPTIONS natpings uncomment next
setbflag(7);
fix_nated_register();
force_rport();
};
sl_send_reply("100", "Trying");
if (!radius_www_authorize("abc.com")) {
www_challenge("abc.com", "1");
};
consume_credentials();
if (!save("location")) {
sl_reply_error();
};
}
}
regards,
Asif
Hi
I'm using Xlite 2.0 release 1105d, and when I try to REGISTER to IP:5070, it doesn't let me. In another Windows computer I have Xlite 3.0 and there you can user an IP:Port Address to register to. Does anyone know If it is a problem from version 2.0 or I am doing something wrong. If it is a problem of 2.0 version, and since we don't have an upgrade of X-lite for linux systems, could you recommend me another Softphone.
Thanks
David Cespedes
Hello,
I have opensip working as a sip load balancer which balances load between 8 asterisk servers running 4 instances on each.
The opensip task is just to load balance the incoming requests for 32 asterisk instances on 8 boxes.
Can i run it in the stateless mode? Anything that i should be aware about which will prohibit me to run it on the stateless mode.
Thanks,
KChris
Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
I knowed that you can have TLS connection between UA and other Proxy Servers, but I didn't know that Kamailio supports it, thanks for your comment.
So maybe Paulos's problem is that his Client is not trying to REGISTER to the correct port (5061) of his Kamailio.
----- Mensaje original -----
De: Klaus Darilion <klaus.mailinglists(a)pernau.at>
Fecha: Viernes, Octubre 24, 2008 12:45 pm
Asunto: Re: [Kamailio-Users] kamailio with tls
> (cc'ed to the mailinglist)
>
> ingdavidcespedes(a)cable.net.co schrieb:
> > Enable TLS in Kamailio is only for connection between other Kamailio
> > (SIP Proxy Servers), it doesn't have anything to do with UA, or
> am I
> > wrong? . As I understand, you can not implement TLS between UA's and
> > Kamailio.
>
> Of course you can. If the SIP client supports TLS you can also use
> TLS
> between UA and Kamailio - no problem.
>
> I use it with eyebeam clients and SNOM phones. Also pjsip supports
> TLS,
> for example you can test it using QjSimple.
> http://www.ipcom.at/index.php?id=560
>
> regards
> klaus
>
>
> >
> > ----- Mensaje original ----- De: Klaus Darilion
> > <klaus.mailinglists(a)pernau.at> Fecha: Viernes, Octubre 24, 2008
> 11:04> am Asunto: Re: [Kamailio-Users] kamailio with tls
> >
> >>
> >> paulo leonardo schrieb:
> >>> Hi,
> >>>
> >>> I would like a litle help :D!
> >>>
> >>> I installed kamailio and everything is ok :D! But i want to use
> >> TLS, but
> >>> when i setup TLS in kamailio, don't work the REGISTER (i can't
> >> register
> >>> my sofphone ...). And i compliled kamilio with TLS!!! when i
> >> comment the
> >>> cofigurantion TLS and use port 5060 works!
> >>
> >> So, "what" does not work?
> >>
> >> - Does Kamailio start (ps -Alf|grep kamailio)? - Does K listen to
> >> the specified TLS socket (netstat -anp|grep kama)? - which client
> >> do you use? - is a TCP connection set up? - is a TLS handshake
> >> happening (ssldump)? - what is in the logfile of Kamailio? .....
> >>
> >> Your error description is to short!
> >>
> >> regards klaus
> >>
> >>
> >>
> >>
> >>> below is my configuration
> >>>
> >>> ----------------------------------------- disable_tls = no listen
> >>> = tls:192.168.170.101:5061 <http://192.168.170.101:5061>
> >>> tls_verify_server = 1 tls_verify_client = 1
> >>> tls_require_client_certificate = 1 tls_method = TLSv1
> >>> tls_certificate =
> >>> "/usr/local/etc/kamailio/tls/user/user-cert.pem" tls_private_key
> >>> = "/usr/local/etc/kamailio/tls/user/user-
> >> privkey.pem"> tls_ca_list
> >>> ---------------------------------------
> >>>
> >>> if (!www_authorize("192.168.170.101 <http://192.168.170.101>",
> >>> "subscriber")) { www_challenge("192.168.170.101
> >> <http://192.168.170.101>", "0");
> >>> exit; }
> >>>
> >>> ----------------------------------------
> >>>
> >>> root@pst:/usr/local/etc/kamailio# ls -R tls/ tls/: ca.conf
> >>> README request.conf rootCA user user.conf
> >>>
> >>> tls/rootCA: cacert.pem certs index.txt private serial
> >>>
> >>> tls/rootCA/certs:
> >>>
> >>> tls/rootCA/private: cakey.pem
> >>>
> >>> tls/user: user-calist.pem user-cert.pem user-cert_req.pem
> >>> user-privkey.pem
> >>>
> >>>
> >>> thanks!!!
> >>>
> >>>
> >>>
> >>> ----------------------------------------------------------------
> --
> >>>
> >> ------
> >>> _______________________________________________ Users mailing
> >>> list Users(a)lists.kamailio.org
> >>> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
> >> _______________________________________________ Users mailing
> list
> >> Users(a)lists.kamailio.org
> >> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
> >>
> >
>
> _______________________________________________
> Users mailing list
> Users(a)lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>
Hi,
I'm trying to follow the INSTALL.txt of the CDRTool to accomplish a nice
installation of OpenSER 1.3.2 + Mediaproxy + SerMyAdmin + Asterisk + CDRTool
+ FreeRadius.
All went well until i started CDRTool installation... it's a little
confusing for a newbie like me but... all the steps of the installation seem
to went well.
When i go to the browser to look for the CDRTool portal it gives me this
error:
Database error: pconnect as cdradmin to sipdb failed. Session halted.
I thought it was a mysql users problem... so i went to the shell and
tried to enter mysql with login and password for cdradmin, and... No
problem. It worked fine. Mysql accepted the user login/password.
Is there someone who can tell me where can i look for errors... I'm
really stuck on this part...
Thanks in advance,
Nuno
(cc'ed to the mailinglist)
ingdavidcespedes(a)cable.net.co schrieb:
> Enable TLS in Kamailio is only for connection between other Kamailio
> (SIP Proxy Servers), it doesn't have anything to do with UA, or am I
> wrong? . As I understand, you can not implement TLS between UA's and
> Kamailio.
Of course you can. If the SIP client supports TLS you can also use TLS
between UA and Kamailio - no problem.
I use it with eyebeam clients and SNOM phones. Also pjsip supports TLS,
for example you can test it using QjSimple.
http://www.ipcom.at/index.php?id=560
regards
klaus
>
> ----- Mensaje original ----- De: Klaus Darilion
> <klaus.mailinglists(a)pernau.at> Fecha: Viernes, Octubre 24, 2008 11:04
> am Asunto: Re: [Kamailio-Users] kamailio with tls
>
>>
>> paulo leonardo schrieb:
>>> Hi,
>>>
>>> I would like a litle help :D!
>>>
>>> I installed kamailio and everything is ok :D! But i want to use
>> TLS, but
>>> when i setup TLS in kamailio, don't work the REGISTER (i can't
>> register
>>> my sofphone ...). And i compliled kamilio with TLS!!! when i
>> comment the
>>> cofigurantion TLS and use port 5060 works!
>>
>> So, "what" does not work?
>>
>> - Does Kamailio start (ps -Alf|grep kamailio)? - Does K listen to
>> the specified TLS socket (netstat -anp|grep kama)? - which client
>> do you use? - is a TCP connection set up? - is a TLS handshake
>> happening (ssldump)? - what is in the logfile of Kamailio? .....
>>
>> Your error description is to short!
>>
>> regards klaus
>>
>>
>>
>>
>>> below is my configuration
>>>
>>> ----------------------------------------- disable_tls = no listen
>>> = tls:192.168.170.101:5061 <http://192.168.170.101:5061>
>>> tls_verify_server = 1 tls_verify_client = 1
>>> tls_require_client_certificate = 1 tls_method = TLSv1
>>> tls_certificate =
>>> "/usr/local/etc/kamailio/tls/user/user-cert.pem" tls_private_key
>>> = "/usr/local/etc/kamailio/tls/user/user-
>> privkey.pem"> tls_ca_list
>>> ---------------------------------------
>>>
>>> if (!www_authorize("192.168.170.101 <http://192.168.170.101>",
>>> "subscriber")) { www_challenge("192.168.170.101
>> <http://192.168.170.101>", "0");
>>> exit; }
>>>
>>> ----------------------------------------
>>>
>>> root@pst:/usr/local/etc/kamailio# ls -R tls/ tls/: ca.conf
>>> README request.conf rootCA user user.conf
>>>
>>> tls/rootCA: cacert.pem certs index.txt private serial
>>>
>>> tls/rootCA/certs:
>>>
>>> tls/rootCA/private: cakey.pem
>>>
>>> tls/user: user-calist.pem user-cert.pem user-cert_req.pem
>>> user-privkey.pem
>>>
>>>
>>> thanks!!!
>>>
>>>
>>>
>>> ------------------------------------------------------------------
>>>
>> ------
>>> _______________________________________________ Users mailing
>>> list Users(a)lists.kamailio.org
>>> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>> _______________________________________________ Users mailing list
>> Users(a)lists.kamailio.org
>> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>>
>
Hi,
I would like a litle help :D!
I installed kamailio and everything is ok :D! But i want to use TLS, but
when i setup TLS in kamailio, don't work the REGISTER (i can't register my
sofphone ...). And i compliled kamilio with TLS!!! when i comment the
cofigurantion TLS and use port 5060 works!
below is my configuration
-----------------------------------------
disable_tls = no
listen = tls:192.168.170.101:5061
tls_verify_server = 1
tls_verify_client = 1
tls_require_client_certificate = 1
tls_method = TLSv1
tls_certificate = "/usr/local/etc/kamailio/tls/user/user-cert.pem"
tls_private_key = "/usr/local/etc/kamailio/tls/user/user-privkey.pem"
tls_ca_list
---------------------------------------
if (!www_authorize("192.168.170.101", "subscriber"))
{
www_challenge("192.168.170.101", "0");
exit;
}
----------------------------------------
root@pst:/usr/local/etc/kamailio# ls -R tls/
tls/:
ca.conf README request.conf rootCA user user.conf
tls/rootCA:
cacert.pem certs index.txt private serial
tls/rootCA/certs:
tls/rootCA/private:
cakey.pem
tls/user:
user-calist.pem user-cert.pem user-cert_req.pem user-privkey.pem
thanks!!!
Hi guys
does someone have experience about the interaction of asterisk and SER.
I have a strange behavior.
I terminate a call from an Asterisk to SER and then to a interconnection
partner which runs also on asterisk.
Whenever I make a call after a long (3-5 mins) idle time I got a one way
audio call because the interconnection partner sends it back to SER
instead of asterisk. But the call after works like a charm. And this
happens all the time.
This is my SER config
# ----------- global configuration parameters ------------------------
#debug=4
debug=2
fork=yes
log_stderror=yes # (cmd line: -E)
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
listen=82.98.89.140:5060
port=5060
children=4
fifo="/tmp/ser_fifo"
# ------------------ module loading ----------------------------------
loadmodule "/usr/local/ser/current/lib/ser/modules/sl.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/exec.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/tm.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/rr.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/registrar.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/textops.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/avpops.so"
#loadmodule "/usr/local/ser/current/lib/ser/modules/group.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/xlog.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/auth.so"
#loadmodule "/usr/local/ser/current/lib/ser/modules/nathelper.so"
loadmodule "/usr/local/ser/current/lib/ser/modules/uri.so"
#loadmodule "/usr/local/ser/current/lib/ser/modules/uri_db.so"
# ----------------- setting module-specific parameters ---------------
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 -------------------
# 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=="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");
route(1);
break;
};
if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
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;
}
if (method=="REGISTER") {
save("location");
break;
};
# only forward if from our nat ip
if (method=="INVITE" && (src_ip==82.98.89.146 ||
src_ip==82.98.89.147 || src_ip==82.98.89.129)) {
#record_route();
if (uri =~ "sip:[0-9]*@*") {
#record_route();
route(3);
break;
}
}
else {
sl_send_reply("401", "Unauthorized");
};
if (method=="CANCEL") {
route(1);
break;
};
if (method=="BYE") {
route(1);
break;
}
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
break;
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "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
if (!t_relay()) {
sl_reply_error();
};
}
route[3]
{
# strip the first 4 characters 1991
#strip(4);
#rewritehost("62.134.16.104");
rewritehostport("62.134.16.104:5060");
#t_relay_to_udp("62.134.16.104", "5060");
xlog("L_WARN", "[%Tf]: Call forwarded to BT from: [%fu] to:
[%tu] next: [%ds]\r\n");
route(1);
break;
}
The asterisk dialplan looks like this
; route everything to SER
exten => _X.,1,Noop(${SIP_HEADER(FROM)})
exten => _X.,n,Set(SIP_CODEC="gsm")
exten => _X.,n,Dial(sip/${EXTEN}(a)82.98.89.140)
exten => _X.,n,Hangup()
The asterisk server has the public IP 82.98.89.146 and SER 82.98.89.140.
BT which is our interconnection partner has the IP 62.134.16.104.
Could someone help me with this?
Thanks
Ciao
Thorsten Kohlhepp
Hi!
This week we saw interesing problem with one of our clients:
initially he was not able to configure his CCME to register
on our proxy, so we just added static location serctl ul add ...,
that's our classic workaround for CCME and another not-so-smart admins.
But when he finally configured registration - things gone nuts:
clients asks for registration:
Date: Fri, 24 Oct 2008 13:16:29 GMT
Timestamp: 1224854189
CSeq: 2905600 REGISTER
Contact: <sip:NNNNNNN@AA.BBB.CCC.DD:5060>
Expires: 3600
Authorization: Digest ....
and ser replies with 200 OK, but with Contact: field filled with
his static registration:
Contact: <sip:NNNNNNN@AA.BBB.CCC.DD>;q=1;expires=4293498731;received=""
As you can see, expires value is 4293498731, which means that
it will be valid for about 136 years, just sixteen days short than
2^32 seconds... So, by RFC, client's router should wait for ~100 years
before attempting registration refresh :)
But CCME, i suppose, thinks different, it just adds received expires
value to current time, got uint32 overflow and result is now()-16 days.
As a result CCME thinks that registration is always expired and tries to
re-register immediately... And does so hundredths times per second,
creating unnecessary extra load to our proxy and database backend....
Why that is so:
modules/registrar/reply.c calculates expires= as
int2str((int)(c->expires - act_time), &len)
but, c->expires can be less than act_time, so, result will be
negative integer (translated to unsigned int on call to int2str,
and this unsigned int will have higher bit set on, so it will be big
one). Well, there are check if(VALID_CONTACT(c, act_time)) which
filters out most of the cases where с->expires <= act_time, but
for 'static' registrations these checks are off:
((c->expires > act_time) || (c->flags & FL_PERMANENT)) is always true
in case of 'static' contact because of FL_PERMANENT.
For now I fixed it with following patch (not perfect, i suppose,
it just uses default_expires value for negative expires time, but
it was easy to write and it works for me):
--- reply.c.orig Thu Jan 13 11:48:08 2005
+++ reply.c Fri Oct 24 14:08:13 2008
@@ -163,7 +163,11 @@
memcpy(p, EXPIRES_PARAM, EXPIRES_PARAM_LEN);
p += EXPIRES_PARAM_LEN;
- cp = int2str((int)(c->expires - act_time), &len);
+ if (c->expires > act_time) {
+ cp = int2str((int)(c->expires - act_time), &len);
+ } else {
+ cp = int2str(default_expires, &len);
+ }
memcpy(p, cp, len);
p += len;
Environment: ser-0.9.6/i386/FreeBSD (ser-2.0 has the same code, so it may
be affected too). The only tuning of usrloc and registrar modules is
db_url and dbmode = 2.