Hello,
I'm trying to use kamailio 1.5.3 as a registrar server. I have a table
on my db that contains all user information, like username, password,
expire time and ip address, so kamailio should use the same table to
authenticate users AND save their location.
The problem is that kamailio complains about table version when
starts. It expects a different version number for location table and
auth_db table. Is there any way I could use the same table for both
functions? I'd appreciate any help!
Thank you!
--
Santiago Soares
Fone: (41) 8488-0537
Hi Fedrico,
Sorry I missed your reply earlier (thanks by the way).
I changed the service priority using the Services GUI utility under System |
Administration as I didn't know about the update-rc.d command at the time.
Maybe the GUI doesn't do all that's required under the hood or maybe I missed
something, but anyway it's working now so that's great.
Regards,
Rick
------------------------------
Hi,
from the log you pasted is clear that the problem is that kamailio is
starting before mysql.
This because, as you said, they have the same priority and so, being the
starting order alphabetical for the same priority, kamailio will start
before mysql and cannot connect to mysql which is still not up.
You told that changing kamailio priority didn't change the result. How did
you change the priority? Did you use the update-rc.d command?
Regards,
Federico
Hi !
I have managed to get the XMPP module working for IM. Now I am working on
Presence service with the pua_xmpp module.
I have experienced some problems and I would like to ask some questions to
clarify my understandig of Kamailio.
When a SUBSCRIBE arrives to Kamailio, it adds a subscribtion to the watchers
table in the database.
And if the subscriber is online, he is also in the active_watchers table,
right?
Next... when a PUBLISH request arrives to Kamailio, by default the
handle_publish() function is called. This function generates
all NOTIFY msgs (based on the database content of watchers and presence
rules) and send them to the recipients. I wanted to ask if these
generated NOTIFY msgs go through the routing logic, or not ?
As I was saying, I was trying to get pua_xmpp module working, but Kamailio
does not seem to send NOTIFY to users in XMPP (winfo is sent, bude presence
itself is not).
Here is a piece of my configuration file:
if(is_method("NOTIFY"))
{
xlog(" ==== NOTIFY msg ====\n");
}
if(is_method("NOTIFY") && uri=~"sip:.+[*].+@sip.sk")
{
xlog(" ====== NOTIFY from $fu to $tu ======\n");
if(pua_xmpp_notify())
{
xlog(" ====== NOTIFY to xmpp domain from $fu to $tu ======\n");
t_reply("200", "OK");
}
exit;
}
if(is_method("PUBLISH"))
{
xlog("===== PUBLISH FROM $fu =====");
handle_publish();
t_release();
}
else
if( is_method("SUBSCRIBE"))
{
handle_subscribe();
if(uri=~"sip:.+[*].+@sip.sk" && $hdr(Event)== "presence")
{
xlog(" ====== SUBSCRIBE for XMPP domain from $fu to see $tu ======\n");
pua_xmpp_req_winfo("$ruri", "$hdr(Expires)");
}
t_release();
}
exit;
Based on this configuration, I never get the " ==== NOTIFY msg ====" output
to the syslog. So I assume the NOTIFY never goes through the routing logic.
Is that right?? If so, how can I get it to pass the routing logic so the
pua_xmpp_notify() function can be executed ?? Is there any way to do this??
Regards
Martin
Hello Daniel
Thanks for pointing out to the SIP traces. I found out that it if the
request is to be sent to a destination using a port other than 5060, it is
required to add the $uac_req(ouri) parameter too:
$uac_req(ouri)="sip:" + $var(asterisk_ip) + ":" + $var(asterisk_port);
....
$uac_req(ouri)="sip:" + $var(asterisk2_ip) + ":" + $var(asterisk2_port);
Thanks!
Alejandro Rios Peña
<alerios(a)debian.org>
DISCLAIMER: The opinions expressed are my own, and not necessarily those of
my employer.
<http://www.avatar.com.co>
2011/4/8 Daniel-Constantin Mierla <miconda(a)gmail.com>
> Hello,
>
>
> On 4/8/11 12:28 AM, Alejandro Rios P. wrote:
>
>>
>> Hi all,
>>
>> I am testing the scenario described here:
>> http://kb.asipto.com/asterisk:realtime:kamailio-3.1.x-asterisk-1.6.2-astdb
>>
>> It works great with one instance of Asterisk, but now that I'm testing
>> with two Asterisk instances to load balance, and I see a problem regarding
>> the registration forwarding to the second Asterisk.
>>
>> I tried adding a second "uac_req_send()" bellow the first one, but
>> Kamailio only sends the first request and the REGISTER never gets to the
>> second Asterisk:
>>
>> # Forward REGISTER to Asterisk
>> route[REGFWD] {
>> if(!is_method("REGISTER"))
>> {
>> return;
>> }
>> $var(rip) = $sel(cfg_get.asterisk.bindip);
>> $uac_req(method)="REGISTER";
>> $uac_req(ruri)="sip:" + $var(rip) + ":" +
>> $sel(cfg_get.asterisk.bindport);
>> $uac_req(furi)="sip:" + $au+ "@" + $var(rip);
>> $uac_req(turi)="sip:" + $au+ "@" + $var(rip);
>> $uac_req(hdrs)="Contact:<sip:" + $au+ "@"
>> + $sel(cfg_get.kamailio.bindip)
>> + ":" + $sel(cfg_get.kamailio.bindport)
>> + ">\r\n";
>> if($sel(contact.expires) != $null)
>> $uac_req(hdrs)= $uac_req(hdrs) + "Expires:" +
>> $sel(contact.expires) + "\r\n";
>> else
>> $uac_req(hdrs)= $uac_req(hdrs) + "Expires:" +
>> $hdr(Expires) + "\r\n";
>> uac_req_send();
>>
>> $uac_req(all) = null;
>>
>> $var(rip2) = $sel(cfg_get.asterisk2.bindip);
>> $uac_req(method)="REGISTER";
>> $uac_req(ruri)="sip:" + $var(rip2) + ":" +
>> $sel(cfg_get.asterisk2.bindport);
>> $uac_req(furi)="sip:" + $au+ "@" + $var(rip2);
>> $uac_req(turi)="sip:" + $au+ "@" + $var(rip2);
>> $uac_req(hdrs)="Contact:<sip:" + $au+ "@"
>> + $sel(cfg_get.kamailio.bindip)
>> + ":" + $sel(cfg_get.kamailio.bindport)
>> + ">\r\n";
>> if($sel(contact.expires) != $null)
>> $uac_req(hdrs)= $uac_req(hdrs) + "Expires:" +
>> $sel(contact.expires) + "\r\n";
>> else
>> $uac_req(hdrs)= $uac_req(hdrs) + "Expires:" +
>> $hdr(Expires) + "\r\n";
>> uac_req_send();
>>
>> }
>>
>> I also tried appending another branch and sending the second
>> uac_req_send() from there, but it is not being sent.
>>
>> How can I use uac_req_send() several times for the same request or in
>> parallel?
>>
> it should work one after the other. append_branch() does not affect
> uac_req_send() at all, this is a separate request built from scratch.
>
> Do you get any error message in the syslog? Can you watch the traffic on
> all interfaces 'ngrep -d any -qt -W byline port 5060' ?
>
> I see you assign '$uac_req(all) = null;', it should be '$uac_req(all) =
> $null;' - but I guess it was a copy&paste thing.
>
> Cheers,
> Daniel
>
> --
> Daniel-Constantin Mierla
> http://www.asipto.com
>
>
Hello,
I think I have found two bugs in nathelper in Kamailio 3.1.3.
Has anyone else encountered these?
Bug one
-------
nat_uac_test() doesn't seem to work for requests that arrive over UDP. I
tried with the latest versions of X-Lite and Jitsi for Windows and
observed the same behaviour with both. As far as I could tell the UDP and
TCP REGISTER methods were identical except for transport, Call-ID, tags
(and so on).
At the moment I have worked around this by treating all UDP requests as if
they have come from behind a NAT - but this is not ideal.
Bug Two
-------
nat_uac_test() with flag bit 8 (SDP checks) set fails with an error if the
request does not contain SDP. I don't think this is correct behaviour as
it seems quite sensible to me to push all requests through the same NAT
detection route. In this case it is quite likely that only some of the
methods will contain SDP.
Surely in this case the correct thing would be for the SDP checks to fail,
but not be treated as an error?
Thanks for you help,
Peter
--
Peter Dunkley
Technical Director
Crocodile RCS Ltd
Hello,
I am trying to use global variables within my configuration script. I am
using Kamailio v3.0.0 and I am following the syntax example written in
the sample config file but I keep getting syntax errors. Here is a copy
of my syntax and I am using cfg_get.voicemailserver.bindip to get the value.
#!ifdef WITH_VOICEMAIL
voicemailserver.bindip = "10.0.0.1" desc "Voicemail Server IP Address"
voicemailserver.bindport = "5060" desc "Voicemail Server Port"
#!endif
Here is the error that I am receiving:
0(1875) : <core> [cfg.y:3333]: parse error in config file
/usr/local/kamailio-3.0.0/etc/kamailio/kamailio.cfg, line 156, column
17: syntax error
0(1875) : <core> [cfg.y:3333]: parse error in config file
/usr/local/kamailio-3.0.0/etc/kamailio/kamailio.cfg, line 156, column
17: unknown config variable
0(1875) : <core> [cfg.y:3330]: parse error in config file
/usr/local/kamailio-3.0.0/etc/kamailio/kamailio.cfg, line 156, column 19-28:
ERROR: bad config file (3 errors)
0(1875) DEBUG: <core> [mem/shm_mem.c:236]: shm_mem_destroy
Thanks
Nathaniel
Hi all,
I currently setup a HA/LB conference. I currently have 1 SER and 2 asterisk conference servers. The goal is to distribute the conferences based on the room number on different server. I use ubuntu 10.04 LTS and the packages from http://deb.kamailio.org/kamailio (kamailio_3.1.2+lucid1_amd64.deb)
During the implementation I run into trouble with the "8 - first destination" policy which choose not my second server in case of a failure.
The dial in is eg. 330 with round robin to any of my asterisk servers. There they check the room number and append it to the dial number. When somebody calls 330 and enter the room number 12345 the asterisk route it back to kamilio with 33012345
route[ASTERISK_CONFERENCE_AUTH] {
if ($rU=~"(33[0-4]$)") {
if ( method=="INVITE" ) {
ds_select_dst("1","4");
forward();
exit();
}
}
}
When the number 33012345 arrives kamailio decides on which server the conference takes place. For redundancy reasons I use the dispatcher again. If one of the server fails, another will take over the conferences. For the scenario with 2 servers this is trivial. There I also could do it another way. But when I add more conference servers it looks like the best solution to me. Here are my rules for the servers.
In this case I used the policy "8" which should use the first destination according to the dispatcher.list file. So if I add more servers I can decide about a order for the fail over servers.
route [ASTERISK_CONFERENCE] {
if ($rU=~"(33[0-4][0-4][0-9][0-9][0-9][0-9]$)") {
if ( method=="INVITE" ) {
ds_select_dst("2","8");
forward();
exit();
}
}
if ($rU=~"(33[0-4][5-9][0-9][0-9][0-9][0-9]$)") {
if ( method=="INVITE" ) {
ds_select_dst("3","8");
forward();
exit();
}
}
}
distpatcher.list
# This group will be used with round robin for getting the room number
1 sip:172.16.1.88:5060 0 1
1 sip:172.16.1.89:5060 0 2
# failover schedule for ast-conf1
2 sip:172.16.1.88:5060 0 1
2 sip:172.16.1.89:5060 0 2
# failover schedule for ast-conf2
3 sip:172.16.1.89:5060 0 1
3 sip:172.16.1.88:5060 0 2
My current problem is, that the policy "8" don't select the other server in case of an failure. I simply blocks and the clients retransmit the request to kamailio.I am currently going crazy with that. :)
When I change the policy to round robin (replacing "8" with "4"), everything is working fine. But this an option because in the normal case all calls to a conference room should be placed on the same server. Could this be a bug or something like that?
Maybe not the right list here, but I didn't find anything about meetme implementation with more that one server or a HA/LB solution for that and was really wondering about that. Somebody maybe heart from such a implementation?
Kind Regards,
Sören Berger
--
Dipl.-Inf. Sören Berger
Rechenzentrum Universität Stuttgart
Allmandring 30
70550 Stuttgart
soeren.berger(a)rus.uni-stuttgart.de
+49-(0)711-685-65871
Hello,
just to let everyone know that I grnted developer access to Timo, who
submitted recently a patch for adding a new module named db_sqlite. As
the name suggests, the new module will allot to use SQLite databases as
alternative to existing db drivers such as mysql, postgres, a.s.o. Timo
will maintain the new module and may help with other modules, as he
previously submitted a patch for uac module.
His GIT username for commits is: tteras.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com
We have enum records where 0123456789 points to 0123456789(a)domain.tld. And then multiple SRV records pointing to the actual hosts; _sip._udp SRV record for domain.tld pointing to host1.domain.tld and host2.domain.tld for load balancing.
In our config we run is_from_user_enum, which up until adding a second entry for the SRV records worked fine. Now however the is_from_user_enum lookup invariably returns the opposite DNS record for the reply. Ie. host1 is requesting and the dns cache returns host2 and then the is_from_user_enum fails and the reply is dropped.
Is there a way to make is_from_user_enum test ALL values of the SRV record?
Thanks!
-Eric