[SR-Users] COALESCE Transformation?

2017-09-20 Thread Brandon Armstead
Hello all,

I've checked the docs and did some brief searching, curious if
this transformation or method exists currently?

Such as:

https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_coalesce

Thanks!

-- 
Sincerely,
Brandon Armstead
CTO / CRYY.com

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Perl module missing in kamailio 5.0.3

2017-09-20 Thread Ginhoux, Patrick
Hi Sergey,

 

Great thanks for your action.

 

I really appreciate the help provided and see that they are always people that 
answer to user’s requests. 

 

Cordialement

Patrick GINHOUX

 

De : sr-users [mailto:sr-users-boun...@lists.kamailio.org] De la part de Sergey 
Safarov
Envoyé : mercredi 20 septembre 2017 14:13
À : Kamailio users (sr-users@lists.kamailio.org) 
Objet : Re: [SR-Users] Perl module missing in kamailio 5.0.3

 

I pushed changes to RHEL repo builder.

After 20 min you download packages with perl module

 

Sergey

 

ср, 20 сент. 2017 г. в 12:03, Ginhoux, Patrick  >:

Hi,

 

I’m thinking to upgrade my kamailio 5.0.1 running on a Rhel 7.1 server to 5.0.3 
.

 

Looking at the repository for Rhel7 to download the rpm, I don’t find the perl 
rpm.

 

For 5.0.1, it is kamailio-perl-5.0.1-1.1.x86_64.rpm.

 

Can you help to get it for 5.0.3 ?

 

Thanks in avance.

 

Cordialement

Patrick GINHOUX

 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org  
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



smime.p7s
Description: S/MIME cryptographic signature
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamctl Stats Update

2017-09-20 Thread Noah Mehl
Alex,

We are using this for time series monitoring (e.g. Zabbix).  It doesn’t make 
sense, at least to me, to implement jsonrpc-s just to get the kamctl stats 
output.  I mean, currently I’m just chaining the output with cut and tr, and 
that’s fine.  I just suggest utilizing JSON a bit better here.

Thanks!

~Noah

> On Sep 20, 2017, at 1:17 PM, Alex Balashov  wrote:
> 
> You may want to consider an alternate and more streamlined method of pulling 
> these. 
> 
> On September 20, 2017 1:16:49 PM EDT, Noah Mehl  wrote:
>> Alex,
>> 
>> This is how that output was generated:
>> 
>> # kamctl stats shmem | jq .
>> 
>> Thanks!
>> 
>> ~Noah
>> 
>>> On Sep 20, 2017, at 1:14 PM, Alex Balashov
>>  wrote:
>>> 
>>> Hello,
>>> 
>>> The jsonrpc-s module has a pretty_print option. Or is that not where
>> you're dispatching this JSON output from?
>>> 
>>> 
>>> -- Alex
>>> 
>>> --
>>> Sent via mobile, please forgive typos and brevity. 
>>> 
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> 
>> 
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 
> 
> -- Alex
> 
> --
> Sent via mobile, please forgive typos and brevity. 
> 
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamctl Stats Update

2017-09-20 Thread Alex Balashov
You may want to consider an alternate and more streamlined method of pulling 
these. 

On September 20, 2017 1:16:49 PM EDT, Noah Mehl  wrote:
>Alex,
>
>This is how that output was generated:
>
># kamctl stats shmem | jq .
>
>Thanks!
>
>~Noah
>
>> On Sep 20, 2017, at 1:14 PM, Alex Balashov
> wrote:
>> 
>> Hello,
>> 
>> The jsonrpc-s module has a pretty_print option. Or is that not where
>you're dispatching this JSON output from?
>> 
>> 
>> -- Alex
>> 
>> --
>> Sent via mobile, please forgive typos and brevity. 
>> 
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
>___
>Kamailio (SER) - Users Mailing List
>sr-users@lists.kamailio.org
>https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


-- Alex

--
Sent via mobile, please forgive typos and brevity. 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamctl Stats Update

2017-09-20 Thread Noah Mehl
Alex,

This is how that output was generated:

# kamctl stats shmem | jq .

Thanks!

~Noah

> On Sep 20, 2017, at 1:14 PM, Alex Balashov  wrote:
> 
> Hello,
> 
> The jsonrpc-s module has a pretty_print option. Or is that not where you're 
> dispatching this JSON output from?
> 
> 
> -- Alex
> 
> --
> Sent via mobile, please forgive typos and brevity. 
> 
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamctl Stats Update

2017-09-20 Thread Alex Balashov
Hello,

The jsonrpc-s module has a pretty_print option. Or is that not where you're 
dispatching this JSON output from?


-- Alex

--
Sent via mobile, please forgive typos and brevity. 

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamctl Stats Update

2017-09-20 Thread Noah Mehl
Hey all,

I was wondering if the kamctl stats output could be updated to provide a bit 
more parseable JSON?  For instance:

# kamctl stats shmem | jq .
{
  "jsonrpc": "2.0",
  "result": [
"shmem:fragments = 18",
"shmem:free_size = 467187808",
"shmem:max_used_size = 69694104",
"shmem:real_used_size = 69683104",
"shmem:total_size = 536870912",
"shmem:used_size = 41048984"
  ],
  "id": 4300
}

I would hope would be more like this:

{
   "jsonrpc":"2.0",
   "result":[
  {
 "shmem":[
{
   "fragments":18,
   "free_size":467187808,
   "max_used_size":69694104,
   "real_used_size":69683104,
   "total_size":536870912,
   "used_size":41048984
}
 ]
  }
   ],
   "id":4300
}

I apologize in advanced because I don’t have the skillset to contribute such a 
feature.

Thanks!

~Noah
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] private memory leak - but where?

2017-09-20 Thread Daniel-Constantin Mierla
The situation is like declaring:

int a;
int b;
...
int ...

in a C program -- it will run out of memory as well. As said, I plan to
push a solution soon.

Cheers,
Daniel


On 20.09.17 15:35, Sebastian Damm wrote:
> Thanks Daniel,
>
> looks like that is indeed the case. We the hash table key is the
> call-id, but we're not calling $sht(foo=>$ci) but instead passing in
> the call-id as a string.
>
> Ich have now written a test script with those two functions:
>
> function handle_packet_bad()
>   callId = sr.pv.get("$ci")
>   if sr.pv.get("$sht(interceptedSessions=>"..callId..")") ~= nil then
> sr.dbg("Lua found matching packet")
>   end
> end
>
> function handle_packet_good()
>   callId = sr.pv.get("$ci")
>   sr.pv.sets("$var(htableKey)", callId)
>   if sr.pv.get("$sht(interceptedSessions=>$var(htableKey))") ~= nil then
> sr.dbg("Lua found matching packet")
>   end
> end
>
> Then in my Kamailio config, I call one or the other function depending
> on whether the PID is odd or even.
>
> if ($pp & 1) {
> if(!lua_run("handle_packet_bad")) {
> xlog("L_ERR", "SCRIPT: failed to execute lua
> function!\n");
> }
> } else {
> if(!lua_run("handle_packet_good")) {
> xlog("L_ERR", "SCRIPT: failed to execute lua
> function!\n");
> }
> }
>
> Now when I track the "real_mem" used by the UDP listeners, I see the
> difference. While the odd PIDs use more and more memory, the even ones
> stay about at the same level.
>
> I wouldn't have found that by myself. Thanks again.
>
> Best Regards,
> Sebastian
>
> On Wed, Sep 20, 2017 at 10:56 AM, Daniel-Constantin Mierla
>  wrote:
>> Hello,
>>
>> my guess is that you define many cfg variables from lua, which take from
>> private memory (their definition).
>>
>> So $sht(x=>abc) is defined when used first time and kept in memory. If
>> you use also $sht(x=>efg), this is another defined variable.
>>
>> This happens when you do KSR.pv.get("$sht(x=>abc)") or
>> KSR.pv.get("$sht(x=>efg)")
>>
>> To avoid defining a lot of variables, you can do:
>>
>> KSR.pv.sets("$var(n)", "abc");
>> KSR.pv.get("$sht(x=>$var(n)");
>> KSR.pv.sets("$var(n)", "efg");
>> KSR.pv.get("$sht(x=>$var(n)");
>>
>> The practically you define only one cfg variable,
>> KSR.pv.get("$sht(x=>$var(n)")
>>
>> The issue is known, there were other reporting it here on the mailing
>> list. It's in my to-do before 5.1 to fix it in a way or another, by
>> either setting a limit of defined variables and then throw error
>> (easier), or track when a variable is used and start deleting the
>> definition for older ones when the limit is exceeded.
>>
>> Cheers,
>> Daniel
>>
>>
>>
>> On 19.09.17 17:56, Sebastian Damm wrote:
>>> Hi Daniel,
>>>
>>> thanks for the quick response. See my other mail with more details.
>>>
>>> I don't use cfg variable from the lua script, I only access $shv(...)
>>> and $vn(...) or $var(...) and $sht(...) from it. And of course $tU,
>>> $hdr(...) and other builtin variables. Some of the variables I'm
>>> accessing might not be there always, though ($au for example).
>>>
>>> Anything I can help with? I only need about half an hour to reproduce it.
>>>
>>> Best Regards,
>>> Sebastian
>>>
>>> On Tue, Sep 19, 2017 at 5:46 PM, Daniel-Constantin Mierla
>>>  wrote:
 Hello,

 do you use kamailio.cfg variables in the lua script? If yes, can you
 show how you do it?

 If you have troubles with pkg dump, it should be printed when you
 stop/restart. It would be good to do the pkg summary, it is easier to
 see the used chunks as a report. There are global parameters to
 configure it.

 Cheers,
 Daniel

>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> --
>> Daniel-Constantin Mierla
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio Advanced Training - www.asipto.com
>> Kamailio World Conference - www.kamailioworld.com
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] private memory leak - but where?

2017-09-20 Thread Sebastian Damm
Thanks Daniel,

looks like that is indeed the case. We the hash table key is the
call-id, but we're not calling $sht(foo=>$ci) but instead passing in
the call-id as a string.

Ich have now written a test script with those two functions:

function handle_packet_bad()
  callId = sr.pv.get("$ci")
  if sr.pv.get("$sht(interceptedSessions=>"..callId..")") ~= nil then
sr.dbg("Lua found matching packet")
  end
end

function handle_packet_good()
  callId = sr.pv.get("$ci")
  sr.pv.sets("$var(htableKey)", callId)
  if sr.pv.get("$sht(interceptedSessions=>$var(htableKey))") ~= nil then
sr.dbg("Lua found matching packet")
  end
end

Then in my Kamailio config, I call one or the other function depending
on whether the PID is odd or even.

if ($pp & 1) {
if(!lua_run("handle_packet_bad")) {
xlog("L_ERR", "SCRIPT: failed to execute lua
function!\n");
}
} else {
if(!lua_run("handle_packet_good")) {
xlog("L_ERR", "SCRIPT: failed to execute lua
function!\n");
}
}

Now when I track the "real_mem" used by the UDP listeners, I see the
difference. While the odd PIDs use more and more memory, the even ones
stay about at the same level.

I wouldn't have found that by myself. Thanks again.

Best Regards,
Sebastian

On Wed, Sep 20, 2017 at 10:56 AM, Daniel-Constantin Mierla
 wrote:
> Hello,
>
> my guess is that you define many cfg variables from lua, which take from
> private memory (their definition).
>
> So $sht(x=>abc) is defined when used first time and kept in memory. If
> you use also $sht(x=>efg), this is another defined variable.
>
> This happens when you do KSR.pv.get("$sht(x=>abc)") or
> KSR.pv.get("$sht(x=>efg)")
>
> To avoid defining a lot of variables, you can do:
>
> KSR.pv.sets("$var(n)", "abc");
> KSR.pv.get("$sht(x=>$var(n)");
> KSR.pv.sets("$var(n)", "efg");
> KSR.pv.get("$sht(x=>$var(n)");
>
> The practically you define only one cfg variable,
> KSR.pv.get("$sht(x=>$var(n)")
>
> The issue is known, there were other reporting it here on the mailing
> list. It's in my to-do before 5.1 to fix it in a way or another, by
> either setting a limit of defined variables and then throw error
> (easier), or track when a variable is used and start deleting the
> definition for older ones when the limit is exceeded.
>
> Cheers,
> Daniel
>
>
>
> On 19.09.17 17:56, Sebastian Damm wrote:
>> Hi Daniel,
>>
>> thanks for the quick response. See my other mail with more details.
>>
>> I don't use cfg variable from the lua script, I only access $shv(...)
>> and $vn(...) or $var(...) and $sht(...) from it. And of course $tU,
>> $hdr(...) and other builtin variables. Some of the variables I'm
>> accessing might not be there always, though ($au for example).
>>
>> Anything I can help with? I only need about half an hour to reproduce it.
>>
>> Best Regards,
>> Sebastian
>>
>> On Tue, Sep 19, 2017 at 5:46 PM, Daniel-Constantin Mierla
>>  wrote:
>>> Hello,
>>>
>>> do you use kamailio.cfg variables in the lua script? If yes, can you
>>> show how you do it?
>>>
>>> If you have troubles with pkg dump, it should be printed when you
>>> stop/restart. It would be good to do the pkg summary, it is easier to
>>> see the used chunks as a report. There are global parameters to
>>> configure it.
>>>
>>> Cheers,
>>> Daniel
>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training - www.asipto.com
> Kamailio World Conference - www.kamailioworld.com
>

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Perl module missing in kamailio 5.0.3

2017-09-20 Thread Sergey Safarov
I pushed changes to RHEL repo builder.
After 20 min you download packages with perl module

Sergey

ср, 20 сент. 2017 г. в 12:03, Ginhoux, Patrick <
patrick.ginh...@fr.unisys.com>:

> Hi,
>
>
>
> I’m thinking to upgrade my kamailio 5.0.1 running on a Rhel 7.1 server to
> 5.0.3 .
>
>
>
> Looking at the repository for Rhel7 to download the rpm, I don’t find the
> perl rpm.
>
>
>
> For 5.0.1, it is kamailio-perl-5.0.1-1.1.x86_64.rpm.
>
>
>
> Can you help to get it for 5.0.3 ?
>
>
>
> Thanks in avance.
>
>
>
> Cordialement
>
> Patrick GINHOUX
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] how to play ring tune when callee declines

2017-09-20 Thread Sergey Safarov
You can add this example to dialplan and make test


  



  



ср, 20 сент. 2017 г. в 10:14, 赵国杰 :

> Hello Sergey,
>  I installed freeswitch, what should i do next?
>
>
>
>
>
> At 2017-09-19 12:07:23, "Sergey Safarov"  wrote:
>
> This can be implemenred using freeswitch.
> Ping me directly after you install freeswith on linux and configure ssh
> remote access
>
> вт, 19 сент. 2017 г., 6:27 赵国杰 :
>
>> Thanks Daniel,
>> I've done some digging, and from Andrew Prokop's blog, it says this
>> envolves early midia. Usually this is done by reply a 183 to the caller
>> with media ip and port in the SDP. This makes sense but i still have no
>> idea how to generate 183 response with embedded SDP.
>>
>>
>>
>>
>> At 2017-09-18 18:05:46, "Daniel Tryba"  wrote:
>> >On Mon, Sep 18, 2017 at 03:37:22PM +0800, 赵国杰 wrote:
>> >>  I want the caller to play a short audio(like "the number your are 
>> >> calling is busy") when the callee declines the call. How can i do that?
>> >
>> >You need to check for the status codes in a failure route and then
>> >somehow generate audio somewhere, which is out of the scope of kamailio
>> >(maybe rtpproxy can do this, otherwise use something like asterisk):
>> >
>> >failure_route[MANAGE_FAILURE] {
>> >if (t_check_status("486"))
>> >{
>> >  $du=null;
>> >  $ru="busymess...@asterisk.example.org";
>> >  route(RELAY);
>> >  exit;
>> >}
>> >
>> >___
>> >Kamailio (SER) - Users Mailing List
>> >sr-users@lists.kamailio.org
>> >https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Perl module missing in kamailio 5.0.3

2017-09-20 Thread Ginhoux, Patrick
Hi,

 

I'm thinking to upgrade my kamailio 5.0.1 running on a Rhel 7.1 server to
5.0.3 .

 

Looking at the repository for Rhel7 to download the rpm, I don't find the
perl rpm.

 

For 5.0.1, it is kamailio-perl-5.0.1-1.1.x86_64.rpm.

 

Can you help to get it for 5.0.3 ?

 

Thanks in avance.

 

Cordialement

Patrick GINHOUX

 



smime.p7s
Description: S/MIME cryptographic signature
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] private memory leak - but where?

2017-09-20 Thread Daniel-Constantin Mierla
Hello,

my guess is that you define many cfg variables from lua, which take from
private memory (their definition).

So $sht(x=>abc) is defined when used first time and kept in memory. If
you use also $sht(x=>efg), this is another defined variable.

This happens when you do KSR.pv.get("$sht(x=>abc)") or
KSR.pv.get("$sht(x=>efg)")

To avoid defining a lot of variables, you can do:

KSR.pv.sets("$var(n)", "abc");
KSR.pv.get("$sht(x=>$var(n)");
KSR.pv.sets("$var(n)", "efg");
KSR.pv.get("$sht(x=>$var(n)");

The practically you define only one cfg variable,
KSR.pv.get("$sht(x=>$var(n)")

The issue is known, there were other reporting it here on the mailing
list. It's in my to-do before 5.1 to fix it in a way or another, by
either setting a limit of defined variables and then throw error
(easier), or track when a variable is used and start deleting the
definition for older ones when the limit is exceeded.

Cheers,
Daniel



On 19.09.17 17:56, Sebastian Damm wrote:
> Hi Daniel,
>
> thanks for the quick response. See my other mail with more details.
>
> I don't use cfg variable from the lua script, I only access $shv(...)
> and $vn(...) or $var(...) and $sht(...) from it. And of course $tU,
> $hdr(...) and other builtin variables. Some of the variables I'm
> accessing might not be there always, though ($au for example).
>
> Anything I can help with? I only need about half an hour to reproduce it.
>
> Best Regards,
> Sebastian
>
> On Tue, Sep 19, 2017 at 5:46 PM, Daniel-Constantin Mierla
>  wrote:
>> Hello,
>>
>> do you use kamailio.cfg variables in the lua script? If yes, can you
>> show how you do it?
>>
>> If you have troubles with pkg dump, it should be printed when you
>> stop/restart. It would be good to do the pkg summary, it is easier to
>> see the used chunks as a report. There are global parameters to
>> configure it.
>>
>> Cheers,
>> Daniel
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users