Hello
I have setup 2 gateways in my dr_rules: 5,6 - so the 2nd one is tried if
the first fails.
The second one requires credentials.
When the first one fails: I execute the following code:
failure_route[ROUTEFAIL] {
if ( t_check_status("[345][0-9][0-9]") or (t_branch_timeout() and
!t_branch_replied() )) {
t_on_failure("ROUTEFAIL");
if (use_next_gw()) {
xlog("L_INFO","failure_route(ROUTEFAIL) @@ routing
to: rd: $rd, ru:$ru, t_relay");
t_relay();
exit;
}
then in the same ROUTEFAIL (before this code), I have
if (t_check_status("401|407")) {
xlog("L_INFO","failure_route(ROUTEFAIL) @@ call to uac_auth(), $si rd:
$rd\n");
.....
So, when the first gateway replies with a 404, it executes correctly the
first block, finds the second gw and I see in the log that rd is set to its
address.
Yet, when the 2nd gw replies with 401, rd is set to the very first gw.
However, the pcap traces confirm it is indeed the second that replies this.
If this behaviour is correct, I cant seem to find the source IP of the
gateway that replied to me, to retrieve credentials from the db.
version: kamailio 5.0.5 / 5.0.6 (tested on both)
Thank you for your help
J
Hello guys,
I'm trying to call an xmlrpc method with parameters like:
<?xml version="1.0"?>
<methodCall>
<methodName>dispatcher.set_state</methodName>
<params>
<param>
<value><string>state:i</string></value>
</param>
<param>
<value><string>group:1</string></value>
</param>
<param>
<value><string>sip:1.2.3.4:5060</string></value>
</param>
</params>
</methodCall>
I'm getting back "Invalid Parameters".
I can't find any documentation as to _how_ to call it with parameters.
Can anyone help?
Regards,
David Villasmil
email: david.villasmil.work(a)gmail.com
phone: +34669448337
ᐧ
Hi all,
I have kamailio setup that uses a mongo cluster, and everything works fine. Only I have problems with the avpops module. The avp_db_load fails with "field [attribute] not found in result iterator", even if the attribute field is present in the object in mongo. Does anybody know what could be going wrong?
Thanks in advance, and kind regards,
===============================================================================
kamailio.cfg:
...
# ---- avpops params ----
modparam("avpops", "db_url", DBURL)
modparam("avpops", "avp_table", "usr_preferences")
...
xlog("trying avp_db_load\n");
if (avp_db_load("$fu/username", "$avp(s:attributevalue)")) {
xlog("if succeeded\n");
}
xlog("if not succeeded\n");
...
===============================================================================
mongo:
rs:SECONDARY> db.usr_preferences.find({"username":"1234567890"})
{ "_id" : ObjectId("5ab22a5b384cd2aa0d4cf403"), "attribute" : "attributevalue", "username" : "1234567890", "domain" : null, "value" : "750", "uuid" : "", "type" : 0 }
===============================================================================
syslog:
...
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: ERROR: <script>: trying avp_db_load
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_query(): query to collection [usr_preferences]
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: db_mongodb [mongodb_dbase.c:885]: db_mongodb_query(): query filter: { "username" : "1234567890", "attribute" : "attributevalue" }
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: db_mongodb [mongodb_dbase.c:904]: db_mongodb_query(): columns filter: { "value" : 1, "attribute" : 1, "type" : 1 }
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: <core> [db_res.c:116]: db_new_result(): allocate 56 bytes for result set at 0x7f43b613c480
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: db_mongodb [mongodb_dbase.c:349]: db_mongodb_get_columns(): 3 columns returned from the query
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: <core> [db_res.c:154]: db_allocate_columns(): allocate 24 bytes for result names at 0x7f43b613c318
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: <core> [db_res.c:165]: db_allocate_columns(): allocate 12 bytes for result types at 0x7f43b614d888
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: db_mongodb [mongodb_dbase.c:377]: db_mongodb_get_columns(): Found a field[0] named: value
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: db_mongodb [mongodb_dbase.c:396]: db_mongodb_get_columns(): allocate 16 bytes for RES_NAMES[0] at 0x7f43b614d9b8
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: db_mongodb [mongodb_dbase.c:431]: db_mongodb_get_columns(): use DB1_STRING result type
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: db_mongodb [mongodb_dbase.c:460]: db_mongodb_get_columns(): RES_NAMES(0x7f43b614d9b8)[0]=[value] (2)
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: db_mongodb [mongodb_dbase.c:377]: db_mongodb_get_columns(): Found a field[1] named: attribute
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: ERROR: db_mongodb [mongodb_dbase.c:381]: db_mongodb_get_columns(): field [attribute] not found in result iterator
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: ERROR: db_mongodb [mongodb_dbase.c:739]: db_mongodb_store_result(): failed to set the columns
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: ERROR: db_mongodb [mongodb_dbase.c:918]: db_mongodb_query(): failed to store result
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: ERROR: db_mongodb [mongodb_dbase.c:927]: db_mongodb_query(): failed to do the query
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: <core> [db_res.c:79]: db_free_columns(): freeing 3 columns
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[0] at 0x7f43b614d9b8
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: <core> [db_res.c:92]: db_free_columns(): freeing result names at 0x7f43b613c318
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: <core> [db_res.c:97]: db_free_columns(): freeing result types at 0x7f43b614d888
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: DEBUG: <core> [db_res.c:134]: db_free_result(): freeing result set at 0x7f43b613c480
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: ERROR: avpops [avpops_impl.c:381]: ops_dbload_avps(): db_load failed
Mar 21 17:15:16 ccccc /opt/kamailio/sbin/kamailio[2544]: ERROR: <script>: if not succeeded
...
===============================================================================
Hello,
I’ve installed kamailio 5.1 but when I run:
kamctl dispatcher reload
I get:
{
"jsonrpc": "2.0",
"error": {
"code": 500,
"message": "Method Not Found"
},
"id": 31222
}
How do I fix this?
Thanks,
Arik Halperin
I am using Captagent on 2 sip servers communicating with each other.
Both Captagents then route the SIP traffic to the same Kamailio.
Therefore, if I understand, Kamailio will get every msg between them twice.
Once from server A and once from server B.
Let's say that each of them has a different capturing code (100 for server
A and 200 for server B)
How will the data look in the DB?
Will it hold both entries pretty much the same with a difference is some
fields such as the capture node?
Thanks a lot,
Amit
--
*Amit Zigelman* | *Software Developer*
Mobile (+972) 54-570-9129 <+972%254-570-9129> | amit.zigelman(a)vonage.com
When I connect using mongo, the credentials work:
$ mongo kamailio -u "kam" -p "kam"
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017/kamailio
MongoDB server version: 3.4.9
> db.subscriber.find()
{ "_id" : ObjectI ...
But when I use the following DBURL in kamailio.cfg, kamailio fails to even login to mongo:
#!define DBURL "mongodb://kam:kam@localhost/kamailio"
If I disable mongodb authentication, kamailio starts up just fine again. Any idea what's going wrong here?
Greetings,
I have a doubt about the flag 16 used in nat_uac_test() belonging to the
module NATDETECT.
In the documentation, the following is stated :
*16* - Test if the source port is different from the port in the “Via”
header
I have some situations that I receive a request from port 5060 and the Via
Header contains no port. I think it probably assumes that it is the default
port.
Will this situation trigger the "16" flag ?
Thanks in advance,
Cheers
Hello guys,
I want to execute an sql only for INITIAL INVITEs, I'm trying like:
#!ifdef WITH_DID_VALIDATE
if(!has_totag()) {
sql_query("acd", "select * from did_numbers where didNumber =
'$tU' and active = 'Y'", "ra");
xlog("L_ERR", "[REQUEST_ROUTE] number of rows in table domain:
$dbr(ra=>rows)\n");
if( $dbr(ra=>rows)==0 ) {
xlog("L_ERR", "[REQUEST_ROUTE] DID Number validation
returned [$dbr(ra=>rows)], not responding to this request\n");
exit;
}
sql_result_free("ra");
}
#!endif
But, say I remove the DID from the allowed list while a call is going on.
Then responses to the allowed INVITE would not be processed.
How would I limit that to ONLY the INITIAL INVITE? Should I use has_totag?
Thanks!
David
Regards,
David Villasmil
email: david.villasmil.work(a)gmail.com
phone: +34669448337
ᐧ