Hi,
I am trying to use MSRP feature of blink client. In the server config when auth is challenged, I see the following error in the client. Can you please advise if I am configuring the server right?
Note: the return value of pv_www_authenticate is "-5".
13 2016-11-07 17:57:26.494124 [blink.exe 24976]: Closed connection to 10.0.16.51:2855 ('NotificationProxyLogger' object has no attribute 'received_illegal_data')
Find attached full set of client logs.
Here is the relevant portion of kamailio.cfg:
if (!pv_www_authenticate("MY_DOMAIN", "$var(passwd)", "0",
"$msrp(method)")) {
www_challenge("MY_DOMAIN", "1");
xlog("L_ERR", "MSRP auth failed with: $var(retValue)\n");
exit;
}
Thanks,
Pranathi Venkatayogi
System Developer II
(520) 745-9447 x4466
www.cyracom.com<http://www.cyracom.com/>
Join us: [cid:image001.gif@01D1C9C9.C4E8B6D0] <https://www.facebook.com/pages/CyraCom-LLC/134704783312720> [cid:image002.gif@01D1C9C9.C4E8B6D0] <https://twitter.com/cyracom> [cid:image003.gif@01D1C9C9.C4E8B6D0] <http://www.linkedin.com/company/cyracom> [cid:image004.gif@01D1C9C9.C4E8B6D0] <http://www.cyracom.com/blog/>
[cid:image005.png@01D1C9C9.C4E8B6D0]
DISCLAIMER: This e-mail and any attached content may contain confidential or privileged material delivered for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender immediately by reply e-mail and delete all copies of this message. It is the recipient's responsibility to scan this e-mail and any attachments for viruses. The content of this e-mail message, including any attachments, does not comprise a contract or a portion of a contract, and so does not bind CyraCom International, Inc. or any of its agents or subsidiaries. CyraCom, LLC and Voiance Language Services, LLC are wholly owned subsidiaries of CyraCom International, Inc.
I have Kamailio 4.4 installed in ubuntu 16.04.03, with Siremis 4.2.0, PHP7
and apache2.
All is OK, but when I try to install the Siremis Wizard, the step 2 (Data
Base Configuration) doesn't work, and there is the message "Something Went
Wrong".
I tried all the option on Step 2, but the problem continuous. Then I can't
go to step 3 Application Configuration.
The Siremis DataBase is created and the user also.
I appreciate any help.
--
Diogenes
Hello all,
I have a databse where i created a "version" table only with a version, a
dispatcher records. I only want to use dispatcher on a db.
I don't know if kamailio is looking for the version tables somewhere else,
or it does find it in my database (not named kamailio) but the format is
wrong.
I used:
CREATE TABLE `version` (
`table_name` VARCHAR(32) NOT NULL,
`table_version` INT UNSIGNED DEFAULT 0 NOT NULL,
CONSTRAINT table_name_idx UNIQUE (`table_name`)
);
INSERT INTO version (table_name, table_version) values ('version','1');
INSERT INTO version (table_name, table_version) values ('dispatcher','4');
To create an populate the table, but kamailio returns:
mod_init(): could not initiate a connect to the database
but it does connect properly...
any thoughts?
Regards,
David Villasmil
email: david.villasmil.work(a)gmail.com
phone: +34669448337
ᐧ
Prior to the upgrade to Kamailio 4.4.4, I was using 4.4.3 with updates
through 81df84b from the 4.4 branch and the following fix_nated_sdp
call worked through the initial INVITE and when a voicemail branch was
appended from the failure_route.
route[NATMANAGE] {
...
# RTPEngine is not needed but if STUN addresses are being used on our
# internal network, rewrite the addresses to the internal source address
if(!isbflagset(FLB_RTPENGINE) && has_body("application/sdp")) {
if(dst_ip==10.1.1.2 &&
compare_pure_ips($sel(contact.uri.host), "<EXTERNAL_IP>")) {
fix_nated_sdp("10");
}
}
...
}
Since the upgrade to 4.4.4, when the original INVITE fails over to
voicemail (branch appended), fix_nated_sdp creates the SDP below,
doubling the replaced IP addresses. Asterisk replies with 488, as the
media address is completely invalid. I need something like the above
(which worked for the request and the reply) but can't figure out what
the problem is.
v=0
o=Zoiper 0 0 IN IP4 10.1.1.18210.1.1.182
s=Zoiper
c=IN IP4 10.1.1.18210.1.1.182
t=0 0
m=audio 63732 RTP/SAVP 9 3 0 97 101
a=rtpmap:9 G722/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=30
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
a=crypto:5 AES_256_CM_HMAC_SHA1_80
inline:n2C0BcdXOr32BPTEE8pfHII9mamAK566xMNvQIDIGKI2LPOLdNDOcpFdtqu5DQ==
a=crypto:6 AES_256_CM_HMAC_SHA1_32
inline:n2C0BcdXOr32BPTEE8pfHII9mamAK566xMNvQIDIGKI2LPOLdNDOcpFdtqu5DQ==
a=crypto:3 AES_192_CM_HMAC_SHA1_80
inline:n2C0BcdXOr32BPTEE8pfHII9mamAK566xMNvQIDIGKI2LPOLdNA=
a=crypto:4 AES_192_CM_HMAC_SHA1_32
inline:n2C0BcdXOr32BPTEE8pfHII9mamAK566xMNvQIDIGKI2LPOLdNA=
a=crypto:1 AES_CM_128_HMAC_SHA1_80
inline:n2C0BcdXOr32BPTEE8pfHII9mamAK566xMNvQIDI
a=crypto:2 AES_CM_128_HMAC_SHA1_32
inline:n2C0BcdXOr32BPTEE8pfHII9mamAK566xMNvQIDI
a=oldmediaip:<EXTERNAL_IP>
a=oldmediaip:<EXTERNAL_IP>
a=oldmediaip:<EXTERNAL_IP>
a=oldmediaip:<EXTERNAL_IP>
--
Anthony - https://messinet.com/ - https://messinet.com/~amessina/gallery
F9B6 560E 68EA 037D 8C3D D1C9 FF31 3BDB D9D8 99B6
Gents,
On a not really loaded kamailio (less than 50 users at the moment),
I'm getting a core dump every few days. I've tried multiple verisons
of Kamailio, 4.4.x , 4.3.x and also on 5.0.0-dev7 .
I can't reproduce it adhoc, but every few days it happens...
Is that something someone wants to jump in?
grtz,
davy
Version: version: kamailio 5.0.0-dev7 (x86_64/linux) 7360b0
[New LWP 29728]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/local/sbin/kamailio -P
/var/run/kamailio.pid -f /usr/local/etc/kamailio//k'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f92c5a0be98 in __dialog_sendpublish (dlg=0x7f92c0e3a6c0,
type=64, _params=0x7f92c0423500 <params>) at pua_dialoginfo.c:264
264 uri = dlginfo->to_uri;
(gdb) backtrace
#0 0x00007f92c5a0be98 in __dialog_sendpublish (dlg=0x7f92c0e3a6c0,
type=64, _params=0x7f92c0423500 <params>) at pua_dialoginfo.c:264
#1 0x00007f92c01e2563 in run_dlg_callbacks (type=64,
dlg=0x7f92c0e3a6c0, req=0x7f92cc6d5db8, rpl=0x0, dir=1, dlg_data=0x0)
at dlg_cb.c:256
#2 0x00007f92c01a92b1 in dlg_terminated (req=0x7f92cc6d5db8,
dlg=0x7f92c0e3a6c0, dir=1) at dlg_handlers.c:366
#3 0x00007f92c01b610f in dlg_onroute (req=0x7f92cc6d5db8,
route_params=0x7ffc7de27ba0, param=0x0) at dlg_handlers.c:1409
#4 0x00007f92c9292171 in run_rr_callbacks (req=0x7f92cc6d5db8,
rr_param=0x7ffc7de27c20) at rr_cb.c:96
#5 0x00007f92c9287ac2 in after_loose (_m=0x7f92cc6d5db8, preloaded=0)
at loose.c:928
#6 0x00007f92c9288168 in loose_route (_m=0x7f92cc6d5db8) at loose.c:962
#7 0x00007f92c928b7ee in w_loose_route (msg=0x7f92cc6d5db8, p1=0x0,
p2=0x0) at rr_mod.c:266
#8 0x000000000041f5d9 in do_action (h=0x7ffc7de285b0,
a=0x7f92cc5f7a70, msg=0x7f92cc6d5db8) at action.c:1054
#9 0x000000000042bcde in run_actions (h=0x7ffc7de285b0,
a=0x7f92cc5f7a70, msg=0x7f92cc6d5db8) at action.c:1552
#10 0x000000000042c383 in run_actions_safe (h=0x7ffc7de29c60,
a=0x7f92cc5f7a70, msg=0x7f92cc6d5db8) at action.c:1620
#11 0x000000000061fe86 in rval_get_int (h=0x7ffc7de29c60,
msg=0x7f92cc6d5db8, i=0x7ffc7de28cc0, rv=0x7f92cc5f7bc8, cache=0x0) at
rvalue.c:912
#12 0x00000000006243c3 in rval_expr_eval_int (h=0x7ffc7de29c60,
msg=0x7f92cc6d5db8, res=0x7ffc7de28cc0, rve=0x7f92cc5f7bc0) at
rvalue.c:1910
#13 0x000000000041f0d1 in do_action (h=0x7ffc7de29c60,
a=0x7f92cc600430, msg=0x7f92cc6d5db8) at action.c:1030
#14 0x000000000042bcde in run_actions (h=0x7ffc7de29c60,
a=0x7f92cc600430, msg=0x7f92cc6d5db8) at action.c:1552
#15 0x000000000041f548 in do_action (h=0x7ffc7de29c60,
a=0x7f92cc6006d0, msg=0x7f92cc6d5db8) at action.c:1045
#16 0x000000000042bcde in run_actions (h=0x7ffc7de29c60,
a=0x7f92cc6006d0, msg=0x7f92cc6d5db8) at action.c:1552
#17 0x000000000041c0fb in do_action (h=0x7ffc7de29c60,
a=0x7f92cc545730, msg=0x7f92cc6d5db8) at action.c:678
#18 0x000000000042bcde in run_actions (h=0x7ffc7de29c60,
a=0x7f92cc537760, msg=0x7f92cc6d5db8) at action.c:1552
#19 0x000000000042c44b in run_top_route (a=0x7f92cc537760,
msg=0x7f92cc6d5db8, c=0x0) at action.c:1641
#20 0x00000000005726a2 in receive_msg (
buf=0xa1c200 <buf> "BYE sip:echo@123.48.11.215:5070;transport=udp
SIP/2.0\r\nVia: SIP/2.0/UDP
0.0.0.0:5060;rport;branch=z9hG4bKPj26b505ba-7ede-4198-a917-bde966b6d8b6\r\nMax-Forwards:
69\r\nFrom: sip:192.168.60.1;tag=9a10d8ab-"..., len=462,
rcv_info=0x7ffc7de29fb0) at receive.c:264
#21 0x000000000047bcdc in udp_rcv_loop () at udp_server.c:507
#22 0x0000000000509de1 in main_loop () at main.c:1618
#23 0x00000000005112de in main (argc=5, argv=0x7ffc7de2a478) at main.c:2639
(gdb)
I need help.
I'm building a load balancer using the dispatcher. It does NAT with too
many SIP Servers. But when the balancer receives an ACK from UAC, it
immediately returns the message "404 Not Here" to UAC.
Help me solve this, since this message (ACK) has to be forwarded to SIP
Servers and finally to UAS to start an RTP session.
I thank you.
Att.,
--
Rodrigo M.
(37) 9132-4539
(34) 9889-3069
rodrigo.moreira2007
Hello Daniel,
I am trying more simple example of $dbr in REGISTER first. Insert into location temporary data. The problem is not looping though all entries in database only last one. Which compare same entry 100 times.
if(is_method("REGISTER")) {
add_path_received();
xlog("L_INFO", "MSILO: New user request saving contact [$ct]\n");
lua_dofile("/usr/bin/ruid.lua");
xlog("L_INFO", "AOR: New user Ruid -->[$var(ruid)]\n");
sql_query("cb", "SELECT * FROM location", "result");
xlog("rows: $dbr(result=>rows) cols: $dbr(result=>cols)\n");
$var(result) = 0;
while($var(i)<$dbr(result=>rows)) {
sql_pvquery("cb", "SELECT ruid FROM location WHERE callid = '$ci'", "$var(dbruid)");
if(fnmatch("$var(dbruid)", "$var(ruid)")) {
xlog("L_INFO", "AOR: Found match --> [$var(dbruid)] = [$var(ruid)]\n");
} else {
sql_query_async("cb","DELETE FROM location WHERE ruid = '$var(dbruid)'");
sql_query_async("cb","INSERT INTO location(id, username, expires, contact, user_agent, domain, callid, ruid) VALUES(0, '$au', NOW(), '$ct', '$ua', '$fd', '$ci', '$var(ruid)')");
}
}
}
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Sunday, 27 November, 2016 00:58:29
Subject: Re: [SR-Users] msilo
Ok lua works right now. I was need remove "" in the value.
Slava
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Sunday, 27 November, 2016 00:29:39
Subject: Re: [SR-Users] msilo
Hello Everyone,
I tried use sr.pv.sets, but not sure how to pass value to it.
#!/usr/bin/lua
math.randomseed(os.time())
ruid = string.format("uloc-%08x-%03x-%x", math.random(0xffffffff), math.random(0xfff), math.random(0xf))
print(ruid) ---> Works
sr.pv.sets("$var(ruid)", "ruid") ---> In kamailio just static ruid
Output
AOR: New user Ruid -->[ruid]
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Saturday, 26 November, 2016 23:41:46
Subject: Re: [SR-Users] msilo
Hello Everyone,
Can't find how actually return actual value from lua script not 1.
Because my setup is pass through REGISTER to B2BUA, I can't use registrar module. I though insert manually, but location table require ruid entry. I installed small lua script to generate it. Not sure if this good approach for it.
When user send first REGISTER in request do like this
if(is_method("REGISTER")) {
add_path_received();
xlog("L_INFO", "MSILO: New user request saving contact [$ct]\n");
$var(ruid) = lua_dofile("/usr/bin/ruid.lua");
xlog("L_INFO", "AOR: New user Ruid -->[$var(ruid)]\n");
sql_query_async("cb","INSERT INTO location(id, username, expires, contact, user_agent, domain, callid, ruid) VALUES(0, '$au', $TS, '$ct', '$ua', '$fd', '$ci', '$var(ruid)')");
}
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Friday, 25 November, 2016 02:14:59
Subject: Re: [SR-Users] msilo
Hello Everyone,
I am trying run small lua script to generate random formatted string, but always get 1. Is script need be set in special way ? That related
to MSILO setup which I am trying to do.
xlog("L_INFO", "MSILO: New user request saving contact [$ct]\n");
$var(ruid) = lua_dofile("/usr/bin/ruid.lua");
xlog("L_INFO", "AOR: New user Ruid -->[$var(ruid)]\n");
Output
Nov 25 01:06:54 cavprx00 /usr/sbin/kamailio[3345]: INFO: <script>: AOR: New user Ruid -->[1]
Actual output
[root@cavprx00 kamailio]# /usr/bin/ruid.lua
uloc-8b7dae10-c17-2
[root@cavprx00 kamailio]# cat /usr/bin/ruid.lua
#!/usr/bin/lua
math.randomseed(os.time())
print(string.format("uloc-%08x-%03x-%x", math.random(0xffffffff), math.random(0xfff), math.random(0xf)))
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, 24 November, 2016 12:15:45
Subject: Re: [SR-Users] msilo
Hello Everyone,
For dump I though do something like this. No sure if possible optimise it. Also how if possible convert inc_time to human readable ?
xlog("L_INFO", "[$rm], Got Register request for <$tU> dumping OFFLINE SMS\n");
while(sql_pvquery("cb","SELECT id FROM silo ORDER BY id ASC","$avp(id)")) {
sql_pvquery("cb", "SELECT dst_addr, src_addr, body, inc_time FROM silo WHERE id = '$avp(id)'","$avp(dst), $avp(src), $avp(body), $avp(time)");
crypto_aes_decrypt("$var(body)", "decryption key", "$avp(decrypted)");
$uac_req(method)="MESSAGE";
$uac_req(furi)=$avp(src);
$uac_req(turi)=$avp(dst);
$uac_req(body)= $avp(decrypted) ;
uac_req_send();
}
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: miconda(a)gmail.com, "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, 24 November, 2016 09:34:18
Subject: Re: [SR-Users] msilo
Hello Daniel,
That good idea, I will need help with sqlops to update information properly. Make sure the query is optimal. I will still can use if(m_store("$tu")), because it maintain offline notification, but I can use something like this. For dump I will put uac.
route[OFFLINE_MESSAGE] {
if(!is_method("MESSAGE")) {
return;
}
if(isflagset(FLAG_FROM_PEER)) {
if(!lookup("location")) {
xlog("L_INFO", "User $tU domain $td offline. Trying store SMS for later delivery\n");
xlog("L_INFO", "SMS received from $fU to $tU domain [$td] --> storing using MSILO\n");
# MSILO - storing as offline message
if(m_store("$tu")) {
xlog("L_INFO", "MSILO: offline message stored\n");
# Encrypt stored offline message
crypto_aes_encrypt("$rb", "mykey", "$avp(encrypted)");
sql_pvquery("cb", "select * from silo ORDER BY id DESC LIMIT 1","$avp(id)");
sql_query_async("cb","UPDATE silo SET body = $avp(encrypted) WHERE id = $avp(id)");
if(is_request()) {
if(!sl_send_reply("202", "Accepted")) {
sl_reply_error();
}
} else {
xlog("L_INFO", "MSILO: offline message NOT stored\n");
#if(!sl_send_reply("503", "Service Unavailable")) {
# sl_reply_error();
#}
}
}
t_on_failure("SMS_FAIL_ROUTE");
exit;
}
}
}
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, 24 November, 2016 06:45:48
Subject: Re: [SR-Users] msilo
I expect the encryption/decryption can be done with some triggers in mysql server.
In kamailio config you can use crypto module to encrypt a text and store it in a variable:
- https://www.kamailio.org/docs/modules/stable/modules/crypto.html
Then you can use sqlops to insert into the database. The issue comes when dumping stored messages... probably you can just replace msilo with sqlops+uac at the expense of a more complex configuration file.
On the other hand, probably adds some privacy to the local platform operators, which have access only to the mysql, because the key will be in kamailio.cfg. For full privacy, the endpoints should do the encryption/decryption with a key they agreed before, without being known by the server.
Cheers,
Daniel
On 24/11/2016 05:28, Slava Bendersky wrote:
Sent message to mailing list
From: "volga629" <volga629(a)skillsearch.ca>
To: miconda(a)gmail.com
Sent: Thursday, 24 November, 2016 00:25:30
Subject: Re: [SR-Users] msilo
Hello Everyone,
I want to ask about another improvement for MSILO module. If possible encrypt BODY column in database. That will improve some privacy concerns for storing body in plain text.
Slava.
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ok lua works right now. I was need remove "" in the value.
Slava
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Sunday, 27 November, 2016 00:29:39
Subject: Re: [SR-Users] msilo
Hello Everyone,
I tried use sr.pv.sets, but not sure how to pass value to it.
#!/usr/bin/lua
math.randomseed(os.time())
ruid = string.format("uloc-%08x-%03x-%x", math.random(0xffffffff), math.random(0xfff), math.random(0xf))
print(ruid) ---> Works
sr.pv.sets("$var(ruid)", "ruid") ---> In kamailio just static ruid
Output
AOR: New user Ruid -->[ruid]
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Saturday, 26 November, 2016 23:41:46
Subject: Re: [SR-Users] msilo
Hello Everyone,
Can't find how actually return actual value from lua script not 1.
Because my setup is pass through REGISTER to B2BUA, I can't use registrar module. I though insert manually, but location table require ruid entry. I installed small lua script to generate it. Not sure if this good approach for it.
When user send first REGISTER in request do like this
if(is_method("REGISTER")) {
add_path_received();
xlog("L_INFO", "MSILO: New user request saving contact [$ct]\n");
$var(ruid) = lua_dofile("/usr/bin/ruid.lua");
xlog("L_INFO", "AOR: New user Ruid -->[$var(ruid)]\n");
sql_query_async("cb","INSERT INTO location(id, username, expires, contact, user_agent, domain, callid, ruid) VALUES(0, '$au', $TS, '$ct', '$ua', '$fd', '$ci', '$var(ruid)')");
}
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Friday, 25 November, 2016 02:14:59
Subject: Re: [SR-Users] msilo
Hello Everyone,
I am trying run small lua script to generate random formatted string, but always get 1. Is script need be set in special way ? That related
to MSILO setup which I am trying to do.
xlog("L_INFO", "MSILO: New user request saving contact [$ct]\n");
$var(ruid) = lua_dofile("/usr/bin/ruid.lua");
xlog("L_INFO", "AOR: New user Ruid -->[$var(ruid)]\n");
Output
Nov 25 01:06:54 cavprx00 /usr/sbin/kamailio[3345]: INFO: <script>: AOR: New user Ruid -->[1]
Actual output
[root@cavprx00 kamailio]# /usr/bin/ruid.lua
uloc-8b7dae10-c17-2
[root@cavprx00 kamailio]# cat /usr/bin/ruid.lua
#!/usr/bin/lua
math.randomseed(os.time())
print(string.format("uloc-%08x-%03x-%x", math.random(0xffffffff), math.random(0xfff), math.random(0xf)))
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, 24 November, 2016 12:15:45
Subject: Re: [SR-Users] msilo
Hello Everyone,
For dump I though do something like this. No sure if possible optimise it. Also how if possible convert inc_time to human readable ?
xlog("L_INFO", "[$rm], Got Register request for <$tU> dumping OFFLINE SMS\n");
while(sql_pvquery("cb","SELECT id FROM silo ORDER BY id ASC","$avp(id)")) {
sql_pvquery("cb", "SELECT dst_addr, src_addr, body, inc_time FROM silo WHERE id = '$avp(id)'","$avp(dst), $avp(src), $avp(body), $avp(time)");
crypto_aes_decrypt("$var(body)", "decryption key", "$avp(decrypted)");
$uac_req(method)="MESSAGE";
$uac_req(furi)=$avp(src);
$uac_req(turi)=$avp(dst);
$uac_req(body)= $avp(decrypted) ;
uac_req_send();
}
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: miconda(a)gmail.com, "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, 24 November, 2016 09:34:18
Subject: Re: [SR-Users] msilo
Hello Daniel,
That good idea, I will need help with sqlops to update information properly. Make sure the query is optimal. I will still can use if(m_store("$tu")), because it maintain offline notification, but I can use something like this. For dump I will put uac.
route[OFFLINE_MESSAGE] {
if(!is_method("MESSAGE")) {
return;
}
if(isflagset(FLAG_FROM_PEER)) {
if(!lookup("location")) {
xlog("L_INFO", "User $tU domain $td offline. Trying store SMS for later delivery\n");
xlog("L_INFO", "SMS received from $fU to $tU domain [$td] --> storing using MSILO\n");
# MSILO - storing as offline message
if(m_store("$tu")) {
xlog("L_INFO", "MSILO: offline message stored\n");
# Encrypt stored offline message
crypto_aes_encrypt("$rb", "mykey", "$avp(encrypted)");
sql_pvquery("cb", "select * from silo ORDER BY id DESC LIMIT 1","$avp(id)");
sql_query_async("cb","UPDATE silo SET body = $avp(encrypted) WHERE id = $avp(id)");
if(is_request()) {
if(!sl_send_reply("202", "Accepted")) {
sl_reply_error();
}
} else {
xlog("L_INFO", "MSILO: offline message NOT stored\n");
#if(!sl_send_reply("503", "Service Unavailable")) {
# sl_reply_error();
#}
}
}
t_on_failure("SMS_FAIL_ROUTE");
exit;
}
}
}
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, 24 November, 2016 06:45:48
Subject: Re: [SR-Users] msilo
I expect the encryption/decryption can be done with some triggers in mysql server.
In kamailio config you can use crypto module to encrypt a text and store it in a variable:
- https://www.kamailio.org/docs/modules/stable/modules/crypto.html
Then you can use sqlops to insert into the database. The issue comes when dumping stored messages... probably you can just replace msilo with sqlops+uac at the expense of a more complex configuration file.
On the other hand, probably adds some privacy to the local platform operators, which have access only to the mysql, because the key will be in kamailio.cfg. For full privacy, the endpoints should do the encryption/decryption with a key they agreed before, without being known by the server.
Cheers,
Daniel
On 24/11/2016 05:28, Slava Bendersky wrote:
Sent message to mailing list
From: "volga629" <volga629(a)skillsearch.ca>
To: miconda(a)gmail.com
Sent: Thursday, 24 November, 2016 00:25:30
Subject: Re: [SR-Users] msilo
Hello Everyone,
I want to ask about another improvement for MSILO module. If possible encrypt BODY column in database. That will improve some privacy concerns for storing body in plain text.
Slava.
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello Everyone,
I tried use sr.pv.sets, but not sure how to pass value to it.
#!/usr/bin/lua
math.randomseed(os.time())
ruid = string.format("uloc-%08x-%03x-%x", math.random(0xffffffff), math.random(0xfff), math.random(0xf))
print(ruid) ---> Works
sr.pv.sets("$var(ruid)", "ruid") ---> In kamailio just static ruid
Output
AOR: New user Ruid -->[ruid]
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Saturday, 26 November, 2016 23:41:46
Subject: Re: [SR-Users] msilo
Hello Everyone,
Can't find how actually return actual value from lua script not 1.
Because my setup is pass through REGISTER to B2BUA, I can't use registrar module. I though insert manually, but location table require ruid entry. I installed small lua script to generate it. Not sure if this good approach for it.
When user send first REGISTER in request do like this
if(is_method("REGISTER")) {
add_path_received();
xlog("L_INFO", "MSILO: New user request saving contact [$ct]\n");
$var(ruid) = lua_dofile("/usr/bin/ruid.lua");
xlog("L_INFO", "AOR: New user Ruid -->[$var(ruid)]\n");
sql_query_async("cb","INSERT INTO location(id, username, expires, contact, user_agent, domain, callid, ruid) VALUES(0, '$au', $TS, '$ct', '$ua', '$fd', '$ci', '$var(ruid)')");
}
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Friday, 25 November, 2016 02:14:59
Subject: Re: [SR-Users] msilo
Hello Everyone,
I am trying run small lua script to generate random formatted string, but always get 1. Is script need be set in special way ? That related
to MSILO setup which I am trying to do.
xlog("L_INFO", "MSILO: New user request saving contact [$ct]\n");
$var(ruid) = lua_dofile("/usr/bin/ruid.lua");
xlog("L_INFO", "AOR: New user Ruid -->[$var(ruid)]\n");
Output
Nov 25 01:06:54 cavprx00 /usr/sbin/kamailio[3345]: INFO: <script>: AOR: New user Ruid -->[1]
Actual output
[root@cavprx00 kamailio]# /usr/bin/ruid.lua
uloc-8b7dae10-c17-2
[root@cavprx00 kamailio]# cat /usr/bin/ruid.lua
#!/usr/bin/lua
math.randomseed(os.time())
print(string.format("uloc-%08x-%03x-%x", math.random(0xffffffff), math.random(0xfff), math.random(0xf)))
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, 24 November, 2016 12:15:45
Subject: Re: [SR-Users] msilo
Hello Everyone,
For dump I though do something like this. No sure if possible optimise it. Also how if possible convert inc_time to human readable ?
xlog("L_INFO", "[$rm], Got Register request for <$tU> dumping OFFLINE SMS\n");
while(sql_pvquery("cb","SELECT id FROM silo ORDER BY id ASC","$avp(id)")) {
sql_pvquery("cb", "SELECT dst_addr, src_addr, body, inc_time FROM silo WHERE id = '$avp(id)'","$avp(dst), $avp(src), $avp(body), $avp(time)");
crypto_aes_decrypt("$var(body)", "decryption key", "$avp(decrypted)");
$uac_req(method)="MESSAGE";
$uac_req(furi)=$avp(src);
$uac_req(turi)=$avp(dst);
$uac_req(body)= $avp(decrypted) ;
uac_req_send();
}
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: miconda(a)gmail.com, "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, 24 November, 2016 09:34:18
Subject: Re: [SR-Users] msilo
Hello Daniel,
That good idea, I will need help with sqlops to update information properly. Make sure the query is optimal. I will still can use if(m_store("$tu")), because it maintain offline notification, but I can use something like this. For dump I will put uac.
route[OFFLINE_MESSAGE] {
if(!is_method("MESSAGE")) {
return;
}
if(isflagset(FLAG_FROM_PEER)) {
if(!lookup("location")) {
xlog("L_INFO", "User $tU domain $td offline. Trying store SMS for later delivery\n");
xlog("L_INFO", "SMS received from $fU to $tU domain [$td] --> storing using MSILO\n");
# MSILO - storing as offline message
if(m_store("$tu")) {
xlog("L_INFO", "MSILO: offline message stored\n");
# Encrypt stored offline message
crypto_aes_encrypt("$rb", "mykey", "$avp(encrypted)");
sql_pvquery("cb", "select * from silo ORDER BY id DESC LIMIT 1","$avp(id)");
sql_query_async("cb","UPDATE silo SET body = $avp(encrypted) WHERE id = $avp(id)");
if(is_request()) {
if(!sl_send_reply("202", "Accepted")) {
sl_reply_error();
}
} else {
xlog("L_INFO", "MSILO: offline message NOT stored\n");
#if(!sl_send_reply("503", "Service Unavailable")) {
# sl_reply_error();
#}
}
}
t_on_failure("SMS_FAIL_ROUTE");
exit;
}
}
}
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Thursday, 24 November, 2016 06:45:48
Subject: Re: [SR-Users] msilo
I expect the encryption/decryption can be done with some triggers in mysql server.
In kamailio config you can use crypto module to encrypt a text and store it in a variable:
- https://www.kamailio.org/docs/modules/stable/modules/crypto.html
Then you can use sqlops to insert into the database. The issue comes when dumping stored messages... probably you can just replace msilo with sqlops+uac at the expense of a more complex configuration file.
On the other hand, probably adds some privacy to the local platform operators, which have access only to the mysql, because the key will be in kamailio.cfg. For full privacy, the endpoints should do the encryption/decryption with a key they agreed before, without being known by the server.
Cheers,
Daniel
On 24/11/2016 05:28, Slava Bendersky wrote:
Sent message to mailing list
From: "volga629" <volga629(a)skillsearch.ca>
To: miconda(a)gmail.com
Sent: Thursday, 24 November, 2016 00:25:30
Subject: Re: [SR-Users] msilo
Hello Everyone,
I want to ask about another improvement for MSILO module. If possible encrypt BODY column in database. That will improve some privacy concerns for storing body in plain text.
Slava.
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users