Hello,
I already started playing with various scripts to do the restructuring
of the source code tree for v5.0 as we discussed in the past months and
I am considering to do it quite soon, in the next few days.
The result will look like:
/Makefile (only-forwarding make commands to various subdirs)
/README|INSTAL|LICENSE|...
/src/Makefile* (build makefiles)
/src/main.c (main c file to generate the binary)
/src/core/*.{c,h} (c code for core, including subfolders such as parser,
mem, atomic, ...)
/src/lib/* (subfolders with the internal libraries)
/src/modules/* (subfolders with the modules)
Other subfolders from root directory may be relocated, but to be decided
along the way.
At the time of doing the restructuring, I will try to merge all the pull
requests that look ok. Therefore it would be good that anyone interested
in open pull requests to do the review (and merge) meanwhile.
Also, I think it would be good to disable travis and nightly master
builds during few days when the restructuring happens in order to avoid
flooding sr-dev with alerts.
If anyone has suggestions to add, do not hesitate to write on mailing lists.
Cheers,
Daniel
--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
Hello Daniel,
I updated OFFLINE MESSAGE store based on username.
https://paste.fedoraproject.org/499377/14809030/
Slava
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "volga629" <volga629(a)skillsearch.ca>, "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Friday, 25 November, 2016 10:59:45
Subject: Re: [SR-Users] msilo
Hello,
the order you use to store and update the record is not safe, other messages from different users can be stored by another kamailio process. Use callid and username to select the last record inserted matching them, eventually protected with lock/unlock from cfgutils.
Cheers,
Daniel
On 24/11/2016 14:34, Slava Bendersky wrote:
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:
BQ_BEGIN
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
BQ_END
--
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
Dear all,
We are seeing that some RTP Payload are with 14 bytes and some are with 15
bytes.
1. 14 byte is correct or 15 byte is correct?
2. Is TOC present in all payloads i.e. in all RTP messages?
Following example with 14 byte payload.
Regards,
Amar
Hello Everyone,
I need help with while loop. Can't find why it try go over only first value from db search and not each value.
https://paste.fedoraproject.org/497911/48081139/
Any help thank you.
Slava.
From: "volga629" <volga629(a)skillsearch.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Sunday, 27 November, 2016 02:12:21
Subject: Re: [SR-Users] msilo
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
_______________________________________________
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,
I am trying to configure rtpproxy with Kamailio. kamailio.cfg is already
configured (default) for rtpproxy. I just add the following line at the top
of the cfg file.
*#!define WITH_NAT*
After that rtpproxy is working in local network. Both client and sip server
are running in local network.
But when I run this in public network, rtpproxy didn't trigger.
Rtppoxy and Kamailio are running in same public IP, Sip client also running
in another *public IP. *So there is *no NAT* *.*
Both local and public version was Centos 6
Kamailio version : 4.4
rtpproxy version: 2.1
Note: udp connection between rtpproxy and Kamailio was established (both in
public and private network)
Thanks
shantanu saha
Hey all,
Sorry for two questions out at the same time!
I'm using kamailio in front of FS, and I'm about to enable IPv6, but I have
a question that I'm not entirely clear on.
What's the proper way to forward traffic using the same interface that it
came in on? Specifically, if a client connects to kamailio on IPv6, it
should connect to FS on IPv6, so that FS knows to advertise its v6 address
in the SDP. The same should be true for v4.
Is this possible?
Best,
Colin
Local messages are malformed in Kamailio 4.4.X. For example after receiving
an error response (603) to an INVITE message, the ACK is generated with
header Max-Forwards concatenated to header CSeq and double CRLF, which is
wrong.
Via: SIP/2.0/TLS 173.16.10.61:5061
;branch=z9hG4bKc782.5b960c7c48a4363a0126963daa797eb0.0;i=7
From: "22861"<sip:22861@173.16.10.61;transport=tls>;tag=snl_OIPEOzJUNy
Call-ID: 61b500a71b510a1Pj61qq1k9dPW
To: <sip:551138174108@174.16.4.108:5061;transport=tls>;tag=435012226
CSeq: 2351 ACKMax-Forwards: 70
User-Agent:...
The fix for that seems to be just the order of append_str in function
build_local() from tm\t_msgbuilder.c.
append_str( p, method, method_len );
+ append_str( p, CRLF, CRLF_LEN );
append_str( p, MAXFWD_HEADER, MAXFWD_HEADER_LEN );
- append_str( p, CRLF, CRLF_LEN );
Hello All.
I have some troubles with upstream sip switch.
It ignores SIP packets which contains:
User-Agent: FPBX-2.11.0(11.17.1)
or
Server: User-Agent: FPBX-2.11.0(11.17.1)
If space is present before first "(" then sip switch works as expected
So my question is: how corektly make analyze and modify this headers
using kamailio?
In which routes i must parse it?
i need such modifications:
User-Agent: FPBX-2.11.0(11.17.1) -> User-Agent: FPBX-2.11.0 (11.17.1)
Server: User-Agent: FPBX-2.11.0(11.17.1) -> Server: User-Agent:
FPBX-2.11.0 (11.17.1)
Thank you.
--
Best regards,
Sergey Basov e-mail: sergey.v.basov(a)gmail.com
Hi,
about your questions:
Q1: yes it's feasible as long as the two Registrars (Kamailio) have the
location information. Please see my reply on a thread on this topic:
http://lists.sip-router.org/pipermail/sr-users/2016-February/091612.html
Q2: given that TSILO depends on the users' location you have to put it in
the Registrar.
Best regards,
Federico
On Wed, Nov 30, 2016 at 5:32 AM, C. J Hsu (徐熙杰) <CJ.Hsu(a)quantatw.com> wrote:
> hi Federico
>
> i'm stuck at TSILO and wondering if you could give me some advises.
>
> Q1:
>
> in lab1, I'm having two Kamailios with proxy and registrar together, UA1
> and UA2.
> UAs go thru hardware load-balancing device (F5) to register themselves in
> Kamailio,
>
> I wonder, UA1 calling to UA2, invite suspended in Kamailio 1, waiting for
> UA2;
> and when UA2 come to register in Kamailio 2, TSILO in Kamailio 1 resumes
> the invite and sending it to Kamailio 2, is this a no problem scenario?
>
> Q2:
>
> if we decide to separate Proxy and Registrar in different Kamailio, when
> should I put TSILO in?
>
>
> RGDS
>
> C J
>
Is this a real error?
9(1899) ERROR: cdp [peerstatemachine.c:635]: I_Snd_CER(): I_Snd_CER(): Error on finding local host address > Socket operation on non-socket
Great regards,
Victor Olvera
victor.olvera(a)verizonwireless.com<mailto:victor.olvera@verizonwireless.com>
mobile # 001-214-923-9405