Hi all,
I’m trying to set a pseudovariable via app_ruby. I’m able to retrieve pseudovariables using PV.gete as such:
However trying to set these using sets, I get “No method found”:
KSR::PV.sets("$fu", "sip:#{$uacs[trunk]['r_username']}@#{$uacs[trunk]['r_domain']}")
Mar 30 04:44:59 ip-10-0-0-2 /usr/local/sbin/kamailio[28421]: ERROR: {1 102 INVITE 0fae8097312bec2b5ec79ada30c227e7@127.0.0.1:5060} app_ruby [app_ruby_api.c:107]: app_ruby_print_last_exception(): exception: undefined method `[]' for nil:NilClass
PV.seti appears to work correctly. Am I calling the wrong method?
Thanks!
________________________________
Andrew White - Director
uConnected
Email: andrew(a)uconnected.com.au
Web: www.uConnected.com.au
Hey Folks,
Getting some annoying logs, pretty certain these are false positives.
I'm running kamailio 4.4.7 using localhost mysql 5.5.60 on debian
7.11. Pretty simple setup, have acc and collecting cdrs. Relevant
kamailio.cfg:
loadmodule "acc.so"
loadmodule "rtimer.so"
loadmodule "sqlops.so"
# ----- acc params -----
modparam("acc", "db_url", DBURLRW)
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)
modparam("acc", "db_extra",
"src_user=$fU;src_domain=$fd;src_ip=$si;"
"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;"
"accountcode=$avp(s:acctcode)")
modparam("rtimer", "timer", "name=cdr;interval=300;mode=1;")
modparam("rtimer", "exec", "timer=cdr;route=CDRS")
modparam("sqlops", "sqlcon", "cb=>mysql://rwuser:rwpass@localhost/kamailio")
route[CDRS] {
sql_query("cb","call kamailio_cdrs()","rb");
}
Logs:
ERROR: db_mysql [km_dbase.c:128]: db_mysql_submit_query(): driver
error on query: Lost connection to MySQL server during query (2013)
ERROR: <core> [db_query.c:181]: db_do_raw_query(): error while submitting query
ERROR: sqlops [sql_api.c:265]: sql_do_query(): cannot do the query
[call kamailio_cdrs()]
CDRs are working fine, no issues with the results, just the log
messages. Errors occur every 5 minutes so this is related to the
rtimer cycle, mode=1 is set for new connection so there really
wouldn't be a lost connection, the old connection should have been
relieved on last cycle.
I've seen some other post talking about this issue but could not find
any resolution or work around. Any help is appreciated.
Thanks.
JR
--
JR Richardson
Engineering for the Masses
Chasing the Azeotrope
Hello - Is there a way I can print current timestamp in milli or microseconds in the log file?
Something like: 2019-03-28 04:50:15.379 would be ideal
The closest thing I could find was $TV(Sn) but it doesn't suit the purpose here since its not human readable.
Thanks
Pat
Hi,
I saw in the Kazoo default.cfg this:
...
####### Flags #######
flags
FLAG_INTERNALLY_SOURCED: 1,
FLAG_ASSOCIATE_SERVER: 2,
FLAG_SKIP_NAT_CORRECTION: 3,
FLAG_ASSOCIATE_USER: 4,
FLAG_TRUSTED_SOURCE: 5,
FLAG_SESSION_PROGRESS: 6,
FLAG_IS_REPLY: 7,
FLAG_SIP_TRACE: 8;
...
So then I went here to read about it:
https://www.kamailio.org/wiki/cookbooks/5.2.x/core#flags
I found out it's not documented... is this a drop-in alternative for a:
#!define FLAG_NAME FLAG_BIT?
Sorry, first time I see this if not I would update the docs myself... :(
Thanks,
Joel.
Greetings,
Does Kamailio have a way of identifying the user-part parameters of an URI?
I have situations where i have sip:user;parameter=yes@host.
Best Regards,
Duarte Rocha
Hi all,
I’ve set the server_header variable in my primary config, and I’ve got a catch in the default reply route to modify headers where required. I’m masking this value for security reasons, and filling it with my own value for vanity reasons :).
I’ve noticed that the OPTIONS packet that is send via the dispatcher module when probing mode is on contains a User-Agent field which has the full version and OS type. Unfortunately I don’t necessarily have trust of the end destination being dispatcher to, nor the packet switchers in-between.
How can I catch this OPTIONS packet to manipulate the value? It doesn’t appear to go through the REQUEST route or the ONSEND route.
Thanks!
________________________________
Andrew White - Director
uConnected
Email: andrew(a)uconnected.com.au
Web: www.uConnected.com.au
Under
https://www.kamailio.org/docs/modules/5.2.x/modules/db_redis.html#db_redis.…
there is an example for using db_redis for accounting. This doesn't
appear to work (5.2.2)
modparam("db_redis", "keys", "acc=entry:callid,time_hires&cid:callid")
results in:
db_redis [redis_dbase.c:1886]: db_redis_insert(): inserting to prefix (table) 'acc'
db_redis [redis_dbase.c:382]: db_redis_build_entry_keys(): build entry keys
db_redis [redis_dbase.c:295]: db_redis_find_query_key(): checking for existence of ent
db_redis [redis_dbase.c:306]: db_redis_find_query_key(): found key in entry key
db_redis [redis_dbase.c:133]: db_redis_val2str(): converting str value '1db9c0bc57291e
db_redis [redis_dbase.c:338]: db_redis_find_query_key(): entry key so far is 'acc:entr
db_redis [redis_dbase.c:295]: db_redis_find_query_key(): checking for existence of entry key 'time_hires' in query
db_redis [redis_dbase.c:346]: db_redis_find_query_key(): key 'time_hires' for type 'entry' not found, unable to use this type
db_redis [redis_dbase.c:405]: db_redis_build_entry_keys(): Failed to create direct entry key, no matching key definition
db_redis [redis_dbase.c:1892]: db_redis_insert(): failed to build entry keys
db_redis [redis_dbase.c:1976]: db_redis_insert(): failed to do the insert
What does work is "time" instead of "time_hires". Since I have no idea
what values are available (I guess the table names?) and time only has a
1 sec resolution, what is a correct version of time_hires?
Hi all,
I’m currently playing with the UAC module to hand off remote registrations with trunks to Kamailio.
I want to keep Kamailio’s external connections low, so I’m planning to use db_text to load the UAC info, and populate the flat file via other methods.
When attempting to load my UAC DB via db_text however, I get the following:
Mar 26 04:59:30 ip-10-0-0-2 /usr/local/sbin/kamailio[31904]: ERROR: db_text [dbt_lib.c:143]: dbt_cache_get_db(): database [/etc/kamailio/uac.db] does not exists!
Mar 26 04:59:30 ip-10-0-0-2 /usr/local/sbin/kamailio[31902]: INFO: jsonrpcs [jsonrpcs_sock.c:443]: jsonrpc_dgram_process(): a new child 0/31902
Mar 26 04:59:30 ip-10-0-0-2 /usr/local/sbin/kamailio[31904]: ERROR: db_text [dbt_base.c:102]: dbt_init(): cannot get the link to database
Mar 26 04:59:30 ip-10-0-0-2 /usr/local/sbin/kamailio[31904]: ERROR: uac [uac_reg.c:1318]: uac_reg_load_db(): failed to connect to the database
When running using WITH_DEBUG flag, it does not appear to attempt on normal start. A kamcmd uac.reg_reload yields:
Mar 26 05:07:52 ip-10-0-0-2 kamailio: 22(32177) DEBUG: ctl [io_listener.c:442]: handle_new_connect(): handle_stream read: new connection (1) on /var/run/kamailio//kamailio_ctl
Mar 26 05:07:52 ip-10-0-0-2 kamailio: 22(32177) DEBUG: <core> [core/sr_module.c:632]: find_mod_export_record(): found export of <db_bind_api> in module db_text [/usr/local/lib64/kamailio/modules/db_text.so]
Mar 26 05:07:52 ip-10-0-0-2 kamailio: 22(32177) DEBUG: <core> [db.c:210]: db_bind_mod(): using db bind api for db_text
Mar 26 05:07:52 ip-10-0-0-2 kamailio: 22(32177) DEBUG: db_text [dbt_base.c:55]: dbt_init(): initializing for db url: [text:///etc/kamailio/uac.db]
Mar 26 05:07:52 ip-10-0-0-2 kamailio: 22(32177) DEBUG: db_text [dbt_lib.c:125]: dbt_cache_get_db(): looking for db /etc/kamailio/uac.db!
Mar 26 05:07:52 ip-10-0-0-2 kamailio: 22(32177) ERROR: db_text [dbt_lib.c:143]: dbt_cache_get_db(): database [/etc/kamailio/uac.db] does not exists!
Mar 26 05:07:52 ip-10-0-0-2 kamailio: 22(32177) ERROR: db_text [dbt_base.c:102]: dbt_init(): cannot get the link to database
Mar 26 05:07:52 ip-10-0-0-2 kamailio: 22(32177) ERROR: uac [uac_reg.c:1318]: uac_reg_load_db(): failed to connect to the database
Mar 26 05:07:52 ip-10-0-0-2 kamailio: 22(32177) DEBUG: ctl [io_listener.c:495]: handle_stream_read(): handle_stream read: eof on /var/run/kamailio//kamailio_ctl
The file of course does exist, and has fine permissions (Kamailio runs as root in this case):
-rw-r--r-- 1 root root 169 Mar 26 04:49 /etc/kamailio/uac.db
Contents of file:
l_uuid(str) l_username(str) l_domain(str) r_username(str) r_domain(str) realm(str) auth_username(str) auth_password(str) auth_proxy(str) expires(int) flags(int) reg_delay(int)
123:test:test.com:test:test.com:test.com:user:pass:10.0.0.100:600::
(At this stage I just want to see the reg packet in Wireshark).
1) Is this the correct method to do UAC? Load credentials, then Kamailio will handle the registration and renewal? I’ve struggled a bit to understand the documentation, hence the testing
2) Why is my db_text failing to load the file?
Thanks!
________________________________
Andrew White - Director
uConnected
Email: andrew(a)uconnected.com.au
Web: www.uConnected.com.au