Hi,
I am using NDB_MONGODB to ask some questions to a database.
My database structure is pretty heavy, so I like to return as little data as required to Kamailio.
I have tried the following MongoDB syntax for projection to include only given (my_field) column in the response.
mongodb_find_one("srv_name", "database", "collection", "{ \"user_id\" : \"$var(user_id)\" }, { \"my_field\" : 1}", "mgr1")
I always get full DB entry back. Is this supported?
The same string works OK in the vanilla mongo client.
How can I limit the result?
Thanks
Lars
Hi!
I'm trying to solve quite simple task and want to solve it as simple as possible.
Idea is to have restriction to allow register certain username/domain only from certain subnets.
So, I decided to use group and permissions modules.
But stuck on group one.
Code is fairly simple
modparam("group", "db_url", DBURL)
modparam("group", "use_domain", 1)
...
if (get_user_group("From", "$avp(user_groups)")) {
xlog("$fu from $si:$sp is matched group $avp(user_groups)\n");
if (allow_source_address("$avp(user_groups)")) {
...allow furter
}
} else {
xlog("$fu from $si:$sp is not matched any groups\n");
}
grp table is looks like
kamctl db exec 'select * from grp'
+----+-------------+-------------------+-----+---------------------+
| id | username | domain | grp | last_modified |
+----+-------------+-------------------+-----+---------------------+
| 1 | 61388140395 | sip.localhost.net | 5 | 2000-01-01 00:00:01 |
+----+-------------+-------------------+-----+---------------------+
But actual line of debug in logs saying this
kamailio_1 | 10(18) exec: {1 1 REGISTER 4oQTNaaVlEWQC2VMK6YAKg..} *** cfgtrace:request_route=[PERMISSIONS] c=[/etc/kamailio/kamailio.cfg] l=720 a=26 n=get_user_group
kamailio_1 | 10(18) DEBUG: {1 1 REGISTER 4oQTNaaVlEWQC2VMK6YAKg..} group [re_group.c:188]: get_user_group(): getting groups for <sip:61388140395@sip.localhost.net>
kamailio_1 | 10(18) exec: {1 1 REGISTER 4oQTNaaVlEWQC2VMK6YAKg..} *** cfgtrace:request_route=[PERMISSIONS] c=[/etc/kamailio/kamailio.cfg] l=727 a=25 n=xlog
kamailio_1 | 10(18) ERROR: {1 1 REGISTER 4oQTNaaVlEWQC2VMK6YAKg..} <script>: sip:61388140395@sip.localhost.net;transport=UDP from 172.21.0.1:56787 is not matched any groups
What am I missing here? Or module is too old?
Thanks!
Hello,
I think it was discussed during past IRC meetings or at some events
across the world, with jsonrpc being these days more popular than
xmlrpc, specially due to easier integration with web based apps, I am
considering to replace the example of using xmlrpc over http(s) with
jsonrpc in the default configuration file. It is not enabled by default
for xmlrpc (requiring to define WITH_XMLRPC), so it will stay also as a
define option for jsonrpc.
The jsonrpcs module is already loaded for kamctl, it will require the
xhttp module to be added.
As for those looking for xmlrpc in the future, there is another example
kamailio cfg which has the option with it:
misc/examples/pkg/kamailio-oob.cfg
Any other opinions?
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - April 27-29, 2020, in Berlin -- www.kamailioworld.com
Hello, Kamailio community,
we are implementing evapi communication to our Kamailio server. We have
implemented and tested it on our testing server. Everything was working OK.
Now we are testing it on our production servers with a lot more calls and
we have some problems here.
Every n seconds we are requesting from Kamailio list of all dialogs. And
this list of dialogs (from jsonrpc *dlg.list*) is sent to evapi connection.
Here is a snippet of our *Kamailio code*:
route[CGR_DLG_LIST]
{
xlog("L_INFO", "XLOG: $ci [CGR_DLG_LIST] Requested dialog list");
# CGRateS connection is still alive, set check to true
$sht(cgrconn=>check) = 1;
if $sht(cgrconn=>cgr) == $null {
sl_send_reply("503","Charging controller unreachable");
exit;
}
jsonrpc_exec('{"jsonrpc":"2.0","id":1,
"method":"dlg.list","params":[]}');
xlog("L_INFO", "XLOG: $ci [CGR_DLG_LIST] Test1: $jsonrpl(body)");
evapi_relay("{\"event\":\"CGR_DLG_LIST_REPLY\",
\"jsonrpl_body\":$jsonrpl(body)}");
}
During a higher number of calls Kamailio is generating ERROR messages from
evapi module. Here is the syslog:
Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: INFO:
<script>: XLOG: 123 [CGR_DLG_LIST] Requested dialog list
Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: INFO:
<script>:
Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: DEBUG:
evapi [evapi_dispatch.c:740]: _evapi_relay(): relaying event data [
Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: ERROR:
evapi [evapi_dispatch.c:764]: _evapi_relay(): cannot serialize event
Oct 30 12:02:15 kam-prod /opt/ipgate/kamailio/sbin/kamailio[19512]: ERROR:
evapi [evapi_mod.c:265]: w_evapi_relay(): failed to relay event:
*We are expecting something like this when nobody is calling*
Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: INFO:
<script>: XLOG: 123 [CGR_DLG_LIST] Requested dialog list
Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: INFO:
<script>: XLOG: 123 [CGR_DLG_LIST] Test1: {
#011"jsonrpc":#011"2.0",
#011"result":#011[],
#011"id":#0111
}
Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: DEBUG:
evapi [evapi_dispatch.c:740]: _evapi_relay(): relaying event data
[{"event":"CGR_DLG_LIST_REPLY",
#011#011#011"jsonrpl_body":{
#011"jsonrpc":#011"2.0",
#011"result":#011[],
#011"id":#0111
}}] (96)
Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: DEBUG:
evapi [evapi_dispatch.c:778]: _evapi_relay(): sending [0x169ff674]
[96:{"event":"CGR_DLG_LIST_REPLY",
#011#011#011"jsonrpl_body":{
#011"jsonrpc":#011"2.0",
#011"result":#011[],
#011"id":#0111
}},] (100)
Oct 30 14:12:22 kam-test /opt/ipgate/kamailio/sbin/kamailio[32090]: DEBUG:
evapi [evapi_dispatch.c:789]: _evapi_relay(): dispatching [0x169ff674]
[96:{"event":"CGR_DLG_LIST_REPLY",
#011#011#011"jsonrpl_body":{
#011"jsonrpc":#011"2.0",
#011"result":#011[],
#011"id":#0111
}},] (100)
We enabled debug messages for module evapi and are trying to understand
where is the problem. To make this work to this state we needed to increase
the *pv_buffer* to really big size (2097152).
It looks like $jsonrpl(body) is not ready and everything concated with it
is not working.
Any help or suggestion is welcomed.
Sincerely Michal
Hello,
I'm trying to get the reason in my cdrs in log_write_cdr() messages while I see It in acc_log_request() messages.
Is there a way to retrieve it in log_write_cdr() messages ?
Bellow is my config :
modparam("acc", "log_level", 1)
modparam("acc", "log_facility", "LOG_LOCAL3")
modparam("acc", "cdr_log_enable", 1)
modparam("acc", "log_flag", 1)
modparam("acc", "failed_transaction_flag", 2)
modparam("acc", "log_missed_flag", 3)
modparam("acc", "report_cancels", 1)
modparam("acc", "cdr_on_failed", 1)
modparam("acc", "cdr_enable", 1)
modparam("acc", "cdr_facility", "LOG_LOCAL3")
modparam("acc", "cdr_expired_dlg_enable", 1)
modparam("acc", "cdr_start_on_confirmed", 1)
modparam("acc", "cdr_extra", "call_id=$ci;src_ip=$si;fU=$fU;")"
David VILLAUME
Hello Henning,
is there an planed release date for this 5.3.x version?
Unfortunately without this change i cant deploy it without changing all my
mysql user credentials to be sure there is no "kamailio DBURL separator"
within the password field.
Cheers
Karsten
[...]
--
Mit freundlichen Grüßen
*Karsten Horsmann*
Dear All,
I have seen in the new kamailio release 5.3.0, kamailio support for haproxy protocol – both the v1 (human-readable) and v2 (binary) versions of the protocol are supported ( https://www.kamailio.org/w/kamailio-v5-3-0-release-notes/ ) but it seems to be for Database, webserver failover not for kamailio itself.
Haproxy is ONLY supporting TCP but not UDP.
My question is :
I am looking for failover service of kamailio servers looks like haproxy but udp & tcp.
- one domain name : sip.secure.com pointing my public ip address.
- two kamailio server pointing same database content (user, whitelist, ...) no asterisk or pbx. Kamailio is used Only for signaling (users, whitelist & rtp)
Monitoring service : identify who is the kamailio server online, offline and the ability to force all the SIP/RTP/MANAGEMENT connection from Kamailio Srv1 to Kamailio Srv2 and vice-versa ?
Thanks for your suggestions.
--
Youssef
Hi!
I'm playing around libphonenum to get validation accross e.164 numbers.
So, idea is simple
if (phonenum_match($fU, "src_num")) {
if ($phn(src_num=>valid) != 1) {
send_reply("400", "Invalid e.164 format");
xlog("L_ALERT","ALERT: FU: $fU is not e.164 number $phn(src_num=>error)\n");
exit;
}
}
But on every (actually valid e.164 number like 380442459966 or 61388141397) I got Parsing number failed in error result.
Tried both phonenum_match($fU, "src_num") and phonenum_match("$fU", "src_num")
Actually phonenum_match("380442459966", "src_num") also not working
Debian 10 Buster
version: kamailio 5.2.5 (x86_64/linux)
libphonenumber7 is already the newest version (7.1.0-5+b4).
hello
everyone i m working on a project kamailio on kubernetes
for high availability and auto scalability
but as i m able to run it in side the cluster with using kubenetes feature
but having issue to access the service form outside the cluster
i m using the ingress in kubernetse to point the service
its flow like that
domain.com:80
------ingress-controler--------kamailio-service:80:5060-------
POD(kamailio)5060
ISSUE IS I M NOT GETING CONNECTION BITWEEN DOMAIN.COM TO POD(kamailio)
is there any one ho can help me in this
thank you
--
*Regards:*
Gaurav Kumar