Hi,
I'm making slow but steady progress with my Kamailio project.
My next task: I need to "relay" a registration to an upstream service. IE
when one or more devices registers against my local registration service, I
need to initiate a corresponding registration upstream. If all my local
devices unregister, all all the registrations lapse, I want to drop the
upstream registration.
There is an example a bit like this in the Asterisk integration example.
However in that case the Asterisk doesn't challenge for authentication.
My upstream does.
I can't find anything in the uac module docs about authenticating.
Is there any way to handle this.
One thing I did try was to create "uacreg" as a view, and use that as the
source of upstream registrations:
CREATE VIEW `uacreg` AS select distinct `s`.`id` AS `id`,`l`.`username` AS
`l_uuid`,`l`.`username` AS `l_username`,`s`.`domain` AS
`l_domain`,`l`.`username` AS `r_username`,`s`.`domain` AS
`r_domain`,`s`.`domain` AS `realm`,`l`.`username` AS
`auth_username`,`s`.`password` AS
`auth_password`,concat('sip:',`s`.`domain`,':5060') AS
`auth_proxy`,timestampdiff(SECOND,now(),`l`.`expires`) AS `expires` from
(`location` `l` join `subscriber` `s`) where (`l`.`username` =
`s`.`username`)
This kinda worked - but didn't quite track the registration status. Do you
think this idea has promise? Maybe something similar that works using
triggers rather than a straight view might work better?
Thanks,
Steve
--
Steve Davies: Technical Director, Connection Telecom (Pty) Ltd
I currently have two independent kamailio servers. I'd like to set them up
in a way that user1 on server1 can make a call to user2 on server2. After
searching I've come up with two ways that this might be able to be done.
Can someone please sanity check these or point me in the right direction?
1. Have one registrar server and convert the other server to a proxy
2. Keep them both as registrars and somehow make them each aware of the
users on the other server
I like 2 better because if one server went down users on the other server
would still be up. The only thing is I don't know how to set the servers up
to communicate with each other.
Dear All,
.May be I couldn't express my doubt properly ijn my earlier mails.Actually
we were testing OfficeSIP server with SipML5 client for multiparty
videoconferencing with presence enabled for showing buddy list and it is
working properly.Now as we moved to kamailio with same client and
configuring kamailio with Websocket and presence support, I have noticed
that the presentity and xcap tables are not populated but location,watchers
and active watchers tables are showing correct entries after a user logs in
using sip over websocket from SIPML5. I have followed the steps as
described in " http://kb.asipto.com/kamailio:presence:k31-made-simple". As
Sipml5 sends PUBLISH/NOTIFY request in pidf format is this is the possible
cause?As I am a person from java based web application technology it is
really hard for me to detect the root cause.Please give me some idea
regarding this issue.
Hi,
I followed your tutorial and the setup is running seamlessly. But the
question is that I read somewhere that asterisk can make up to 300 to 400
concurrent sip calls. Higher than that will cause problems. Will that issue
appear here as well since you are using asterisk in the sip calling
process??
Regards,
Hassan Wajahat
Hi all I have been trying to figure out where Im going wrong with following
this guide:
http://kb.asipto.com/asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb
The only thing that is different is I am using Asterisk 1.8.22.0
Kamailio works fine and I am able to register a phone to it but the forward
register fails to register with Asterisk.
Its like Asterisk doesn't see the request even running sip debug on the
Asterisk Console it doesn't show the register attempts. I have to use ngrep
to see any thing.
Realtime works fine when I register the phone on Asterisk.
Although I can get round the register using AGI I get the same issue when
passing a call to asterisk, Asterisk doesn't see the invite.
Am I missing something so obvious :-/
This is what I have in sip.conf
"IP change to protect the innocent!"
[kamailio-2]
type=peer
host=1.1.1.1
fromdomain=1.1.1.1
context=outgoing
insecure=invite,port
directmedia=nonat
qualify=yes
disallow=all
allow=all
and this is the sip trace for the register
U 2013/09/13 16:54:50.697484 1.1.1.1:5060 -> 172.16.0.110:5080
REGISTER sip:172.16.0.110:5080 SIP/2.0.
Via: SIP/2.0/UDP 1.1.1.1;branch=z9hG4bKd5d1.80da8915.0.
To: sip:102@172.16.0.110.
From: sip:102@172.16.0.110;tag=533cb9e91f4b999cf76861cbb9ed54ed-65e5.
CSeq: 10 REGISTER.
Call-ID: 4670378d1185f5b6-25000(a)127.0.0.1.
Content-Length: 0.
User-Agent: kamailio (3.3.1 (x86_64/linux)).
Contact: <sip:102@172.16.0.112:5060>.
Expires: 120.
.
U 2013/09/13 16:54:54.697484 1.1.1.1:5060 -> 172.16.0.110:5080
REGISTER sip:172.16.0.110:5080 SIP/2.0.
Via: SIP/2.0/UDP 1.1.1.1;branch=z9hG4bKd5d1.80da8915.0.
To: sip:102@172.16.0.110.
From: sip:102@172.16.0.110;tag=533cb9e91f4b999cf76861cbb9ed54ed-65e5.
CSeq: 10 REGISTER.
Call-ID: 4670378d1185f5b6-25000(a)127.0.0.1.
Content-Length: 0.
User-Agent: kamailio (3.3.1 (x86_64/linux)).
Contact: <sip:102@172.16.0.112:5060>.
Expires: 120.
and I have this for my
Asterisk binds in kamamilio.cfg
#!ifdef WITH_ASTERISK
asterisk.bindip = "172.16.0.110" desc "Asterisk IP Address"
asterisk.bindport = "5080" desc "Asterisk Port"
kamailio.bindip = "172.16.0.112" desc "Kamailio IP Address"
kamailio.bindport = "5060" desc "Kamailio Port"
#!endif
--
Regards
Mick
Hello Everyone,
I am really having an issue getting kamailio to try another dispatch route
when I get a 500 back from one of my freeswitch servers.
Currently I have a list of freeswitch servers located in my dispatch.list
file. If one of then is to busy it will respond with a 500 Maximum Call in
Progress. I am trying to get Kamailio to go to the next route in the
dispatch.list when it get one of these 503 and if it should exhaust the
whole list respond with a 503. Here is my kamailio config
####### Global Parameters #########
#!ifdef WITH_DEBUG
debug=4
log_stderror=yes
#!else
debug=4
log_stderror=yes
#!endif
memdbg=5
memlog=5
log_facility=LOG_LOCAL0
fork=yes
children=10
/* comment the next line to enable TCP */
disable_tcp=yes
/* uncomment the next line to disable the auto discovery of local aliases
based on revers DNS on IPs (default on) */
auto_aliases=no
/* uncomment and configure the following line if you want Kamailio to
bind on a specific interface/port/proto (default bind on all available)
*/
listen=udp:eth0:5060
sip_warning=no
####### Modules Section ########
#set module path
mpath="/usr/local/lib64/kamailio/modules_k/:/usr/local/lib64/kamailio/modules/"
loadmodule "mi_fifo.so"
loadmodule "kex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "mi_rpc.so"
loadmodule "acc.so"
loadmodule "dispatcher.so"
# ----------------- setting module-specific parameters ---------------
# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
modparam("xlog", "buf_size", 8192)
# ----- rr params -----
# add value to ;lr param to cope with most of the UAs
modparam("rr", "enable_full_lr", 1)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0)
# ----- acc params -----
modparam("acc", "log_flag", 1)
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_extra",
"src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;src_ip=$si")
# ----- tm params -----
modparam("tm", "fr_timer", 2000)
modparam("tm", "fr_inv_timer", 40000)
modparam("tm", "remap_503_500", 0)
# ----- dispatcher params -----
modparam("dispatcher", "list_file",
"/usr/local/etc/kamailio/dispatcher.list")
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "dst_avp", "$avp(i:271)")
modparam("dispatcher", "grp_avp", "$avp(i:272)")
modparam("dispatcher", "cnt_avp", "$avp(i:273)")
#modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
#modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
#modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
#modparam("dispatcher", "ds_append_branch", 1)
####### Routing Logic ########
# main request routing logic
route {
append_hf("X-VSIP-CUST-IP: $si\r\n");
route(DISPATCH);
route(RELAY);
}
# Dispatch requests
route[DISPATCH] {
# round robin dispatching on gateways group '1'
if(!ds_select_dst("1", "4"))
{
send_reply("404", "No destination");
exit;
}
# xlog("L_DBG", "--- SCRIPT: going to <$ru> via <$du>\n");
t_on_failure("RTF_DISPATCH");
return;
}
# Sample failure route
failure_route[RTF_DISPATCH] {
if (t_is_canceled()) {
exit;
}
# next DST - only for 500 or local timeout
if (t_check_status("500") or (t_branch_timeout() and
!t_branch_replied()))
{
if(ds_next_dst())
{
t_on_failure("DISPATCH");
route(RELAY);
exit;
}
}
}
route[RELAY] {
if (!t_relay()) {
send_reply("503", "LB01 - All Circuits Are Busy");
# sl_reply_error();
}
exit;
}
I am very new to kamailio and still learning my way around. Any help you
can provide with be fantastic!
Thank you,
Joe Watson
Hi,
is it correct that the json_get_field returns the quotes from the json
document?
Example:
{ "foo": "bar" }
json_get_field("$var(json)", "foo", "$var(result)");
result will contain "bar" with quotes ...
I was a little astonished to see that.
Flo
--
Florian Lohoff f(a)zz.de
Hello,
I want to announce that a new person got developer GIT write access to
repository: Charles Chance.
He is for long time in the community, sending patches in the past to
modules such as memcache. His immediate goal is to care of dmq module,
having a set of patches to be committed as well as plans to integrate it
within more modules.
His git commit id is: cchance
My warm welcome and looking forward to future work within the project!
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Trainings - Berlin, Oct 21-24; Miami, Nov 11-13, 2013
- more details about Kamailio trainings at http://www.asipto.com -
Hi -
Can someone help me understand how pseudo-variables interact with branches?
I've written this logic in my failure route to do a reroute of calls if the
primary destination fails:
if ( is_method("INVITE") && !t_check_status("407") && ($rd !=
"127.0.0.1") ) {
# Maybe should also check its not just a Busy or similar
xlog("L_NOTICE","SLD: INVITE failed $rm ($mt / $rs $rr):
$ci::$ft; try via asterisk instead\n");
append_branch("sip:$rU@127.0.0.1:5070");
send_reply("181", "Rerouting call via local failover");
$avp(senttoast) = 1;
if (!t_relay()) {
sl_reply_error(); # or reply_error ?
}
I'm trying to check if the call was already rerouted - by looking at $rd.
But in fact I find that $rd keeps the domain from the ORIGINAL invite even
if the call that just failed was the one to 127.0.0.1:5070 .
So I'm obviously missing something about how pseudo-variables interact with
the branching etc.
Thanks,
Steve
--
Steve Davies: Technical Director, Connection Telecom (Pty) Ltd
Email is preferred, but: Phone: 0878200200