Re: [sr-dev] [kamailio/kamailio] $xavi(...) (#2337)

2020-05-28 Thread Daniel-Constantin Mierla
I could not spot anything on a quick look over the patch. If nobody else wants 
to still keep it here for review, I am fine to merge it.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2337#issuecomment-635793213___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] dispatcher: rework attrs parameter in rpc 'add' command (#2339)

2020-05-28 Thread Henning Westerholt
Merged #2339 into master.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2339#event-3385841526___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:41714a49: dispatcher: rework attrs parameter in rpc 'add' command

2020-05-28 Thread Henning Westerholt
Module: kamailio
Branch: master
Commit: 41714a49e88800378db37670fbc22cafb7eca81a
URL: 
https://github.com/kamailio/kamailio/commit/41714a49e88800378db37670fbc22cafb7eca81a

Author: Federico Cabiddu 
Committer: Henning Westerholt 
Date: 2020-05-29T08:41:44+02:00

dispatcher: rework attrs parameter in rpc 'add' command

---

Modified: src/modules/dispatcher/dispatch.c
Modified: src/modules/dispatcher/dispatcher.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/41714a49e88800378db37670fbc22cafb7eca81a.diff
Patch: 
https://github.com/kamailio/kamailio/commit/41714a49e88800378db37670fbc22cafb7eca81a.patch

---

diff --git a/src/modules/dispatcher/dispatch.c 
b/src/modules/dispatcher/dispatch.c
index 8cff6cdb56..d859dc3907 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -2426,10 +2426,6 @@ int ds_add_dst(int group, str *address, int flags, str 
*attrs)
setn = _ds_list_nr;
priority = 0;
 
-   if (attrs->len == 0) {
-   attrs->s = 0;
-   }
-
*next_idx = (*crt_idx + 1) % 2;
ds_avl_destroy(&ds_lists[*next_idx]);
 
diff --git a/src/modules/dispatcher/dispatcher.c 
b/src/modules/dispatcher/dispatcher.c
index b2693a2947..836038442f 100644
--- a/src/modules/dispatcher/dispatcher.c
+++ b/src/modules/dispatcher/dispatcher.c
@@ -1798,15 +1798,19 @@ static const char *dispatcher_rpc_add_doc[2] = {
  */
 static void dispatcher_rpc_add(rpc_t *rpc, void *ctx)
 {
-   int group, flags;
+   int group, flags, nparams;
str dest;
-  str attrs;
+   str attrs;
 
flags = 0;
 
-   if(rpc->scan(ctx, "dS*d", &group, &dest, &flags, &attrs) < 3) {
+   nparams = rpc->scan(ctx, "dS*dS", &group, &dest, &flags, &attrs);
+   if(nparams < 2) {
rpc->fault(ctx, 500, "Invalid Parameters");
return;
+   } else if (nparams < 3) {
+   attrs.s = 0;
+   attrs.len = 0;
}
 
if(ds_add_dst(group, &dest, flags, &attrs) != 0) {


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


Re: [sr-dev] [kamailio/kamailio] dispatcher: rework attrs parameter in rpc 'add' command (#2339)

2020-05-28 Thread Henning Westerholt
LGTM analysis failed due to out of memory - but I guess this is not related to 
this commit.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2339#issuecomment-635791179___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] dispatcher: rework attrs parameter in rpc 'add' command (#2339)

2020-05-28 Thread Daniel-Constantin Mierla
Thanks, can be merged.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2339#issuecomment-635787982___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] RTPengine PV varaibles missing the leg wise vallues for media stats attributes like jitter (mos_average_jitter_A_pv), mos (mos_average_A_pv), packetloss (mos_average_packe

2020-05-28 Thread altanai


### Description

Extract media stats per leg from RTPengine but in spite of labels being present 
in RTPengine logs the values are not extracted in their respective PV's
Note : the overall average, max and min values appear fine 

### Troubleshooting

Opened Kamailio in debug mode and saw that labels are being set  , yet 
appearing as null

Snipets 
```
tagsd8:91e08b04d3:tag8:91e08b045:label6:caller7:createdi1590686836e16:in 
dialogue 
with13:tKtpK3BHjFavK6:mediasld5:indexi1e4:type5:audio8:protocol8:RTP/AVPF7
..
looking for label ''
```  
Full logs below  in the "Log Messages" section

 Reproduction
Using Lua on Kamailio v5.2.1

1. Add labels in RTPengine offer , ensuring the traffic is AVPF
```
local rtpengine_codecs_flag = " codec-strip-all codec-offer-PCMA 
codec-offer-pcma "

local rtpengine_offer_flag = "ICE=remove RTP/AVPF full-rtcp-attribute 
direction=external direction=external replace-origin replace-session-connection 
record-call=yes " .. rtpengine_codecs_flag .. " label=caller "
local rtpengine_answer_flag = "ICE=remove RTP/AVPF full-rtcp-attribute 
direction=external direction=external replace-origin replace-session-connection 
record-call=yes label=callee "

```
2. set the mos label 
```
 KSR.pv.sets("$avp(mos_A_label)", "caller");
```

3. Make call and do RTPengine offer and answer like usual 
```
KSR.rtpengine.rtpengine_offer(rtpengine_offer_flag)
...
KSR.rtpengine.rtpengine_answer(rtpengine_answer_flag)
```

3. On BYE , do rtpengihne delete
```
KSR.rtpengine.rtpengine_delete0()
```

4.  gather PV values for legs 
```
KSR.log("info", "mos_A_label  " .. KSR.pv.getvn("$avp(mos_A_label)", 1) 
.. "\n ")
KSR.log("info", "mos_average_packetloss_A " .. 
KSR.pv.getvn("$avp(mos_average_packetloss_A)", 0) .. "\n ")
KSR.log("info", "mos_average_jitter_A " .. 
KSR.pv.getvn("$avp(mos_average_jitter_A)", 0) .. "\n ")
KSR.log("info", "mos_average_roundtrip_A " .. 
KSR.pv.getvn("$avp(mos_average_roundtrip_A)", 0) .. "\n ")
KSR.log("info", "mos_average_A " .. KSR.pv.getvn("$avp(mos_average_A)", 
0) .. "\n ")
```

 Debugging Data



```
(paste your debugging data here)
```

 Log Messages




Log from kamailio from BYE untill printing overall average mos score 
```
 4(11084) INFO:  [core/kemi.c:143]: sr_kemi_core_log(): >>> delete 
RTPengine 
  4(11084) DEBUG: rtpengine [rtpengine.c:2912]: select_rtpp_node_old(): 
rtpengine hash table lookup find node=udp:192.168.1.109: for calllen=49 
callid=103103ZjIzOGM1MWRlYjQxZDhjYWQ4YTlhN2I3ODg0YWNmN2I viabranch=
 4(11084) DEBUG: rtpengine [rtpengine.c:2452]: rtpp_function_call(): proxy 
reply: d7:createdi1590686836e10:created_usi219955e11:last 
signali1590686836e4:SSRCd10:2899397750d11:average MOSd3:MOSi43e15:round-trip 
timei14365e6:jitteri0e11:packet lossi0e7:samplesi3ee10:lowest 
MOSd3:MOSi43e15:round-trip timei12630e6:jitteri1e11:packet lossi0e11:reported 
ati1590686846ee11:highest MOSd3:MOSi44e15:round-trip 
timei7559e6:jitteri0e11:packet lossi0e11:reported ati1590686849ee15:MOS 
progressiond8:intervali0e7:entriesld3:MOSi43e15:round-trip 
timei12630e6:jitteri1e11:packet lossi0e11:reported 
ati1590686846eed3:MOSi44e15:round-trip timei7559e6:jitteri0e11:packet 
lossi0e11:reported ati1590686849eed3:MOSi43e15:round-trip 
timei22908e6:jitteri0e11:packet lossi0e11:reported 
ati1590686855e10:3469957276d11:average MOSd3:MOSi43e15:round-trip 
timei17045e6:jitteri0e11:packet lossi0e7:samplesi5ee10:lowest 
MOSd3:MOSi43e15:round-trip timei10048e6:jitteri0e11:packet lossi0e11:reported 
ati1590686844ee11:highest MOSd3:MOSi44e15:round-trip 
timei7134e6:jitteri0e11:packet lossi0e11:reported ati1590686848ee15:MOS 
progressiond8:intervali1e7:entriesld3:MOSi43e15:round-trip 
timei10048e6:jitteri0e11:packet lossi0e11:reported 
ati1590686844eed3:MOSi44e15:round-trip timei7134e6:jitteri0e11:packet 
lossi0e11:reported ati1590686848eed3:MOSi43e15:round-trip 
timei22738e6:jitteri0e11:packet lossi0e11:reported 
ati1590686852eed3:MOSi43e15:round-trip timei22566e6:jitteri0e11:packet 
lossi0e11:reported ati1590686853eed3:MOSi43e15:round-trip 
timei22739e6:jitteri0e11:packet lossi0e11:reported 
ati1590686854ee4:tagsd8:91e08b04d3:tag8:91e08b045:label6:caller7:createdi1590686836e16:in
 dialogue 
with13:tKtpK3BHjFavK6:mediasld5:indexi1e4:type5:audio8:protocol8:RTP/AVPF7:streamsld10:local
 
porti31052e8:endpointd6:family4:IPv47:address13:192.168.1.1084:porti58004ee19:advertised
 endpointd6:family4:IPv47:address13:192.168.1.1084:porti58004ee11:last 
packeti1590686855e5:flagsl3:RTP6:filled9:confirmed10:kernelized17:no kernel 
supporte4:SSRCi2899397750e5:statsd7:packetsi928e5:bytesi157696e6:errorsi12eeed10:local
 
porti31053e8:endpointd6:family4:IPv47:address13:192.168.1.1084:porti58005ee19:advertised
 endpointd6:family4:IPv47:address13:192.168.1.1084:porti58005ee11:last 
packeti1590686855e5:flagsl4:RTCP6:filled9:confirmed10:kernelized17:no kernel 
supporte4:SSRCi2899397750e5:statsd7:packetsi5e5:bytesi400e6:errorsi05:flagsl11:initi

Re: [sr-dev] [kamailio/kamailio] dispatcher: rework attrs parameter in rpc 'add' command (#2339)

2020-05-28 Thread Federico Cabiddu
@grumvalski pushed 1 commit.

583b63e23f48b9bde84c6a86940ae09ff54bc252  dispatcher: rework attrs parameter in 
rpc 'add' command


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/kamailio/kamailio/pull/2339/files/e86af7e10e386845dcc2dc53623309d6b372f136..583b63e23f48b9bde84c6a86940ae09ff54bc252
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] dispatcher: rework attrs parameter in rpc 'add' command (#2339)

2020-05-28 Thread Federico Cabiddu
@grumvalski commented on this pull request.



>   rpc->fault(ctx, 500, "Invalid Parameters");
return;
+   } else if (nparams < 4) {

right, fixed and force pushed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2339#discussion_r431980107___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] dispatcher: rework attrs parameter in rpc 'add' command (#2339)

2020-05-28 Thread Daniel-Constantin Mierla
@miconda commented on this pull request.



>   rpc->fault(ctx, 500, "Invalid Parameters");
return;
+   } else if (nparams < 4) {

I think the condition here has to be `(nparams < 3)`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2339#pullrequestreview-420286632___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [SR-Users] congestion control priority for priority based dispatching

2020-05-28 Thread Julien Chavanton
Thank you both for the attention and the feedbacks

Point clarified, it should be a new algorithms, something like :

   “13” - location optimized routing mode, the lowest latency gets higher
priority (serial forking ordered by priority,  ds_ping_latency_stats is
required).

The main drawback it that there is not load balancing, I would like to
address this now, by making it configurable, an option to activate location
optimized with load balancing routing mode.

I would like to find a clear and simple way to do this, that should be easy
to document and understand.

For example in a scenario like that, it would be best that gateways with
similar latency would get traffic load balanced to them, the priority could
be overloaded to represent the threshold :




I found this simple formula : *ADJUSTED_PRIORITY = PRIORITY -
(ROUNDDOWN(ESTIMATED_LATENCY/PRIORITY))*
Priority is also the threshold for latency priority adjustment, not sure if
overloading it is creating confusion, in this example gateway 1, 4 and 6
would receive 33%/33%/33%, the other gateways would be only there for
failover


GATEWAY PRIORITY ESTIMATED_LATENCY ADJUSTED_PRIORITY
1 30 21 30
2 30 91 27
3 30 61 28
4 30 19 30
5 30 32 29
6 30 0 30
7 30 201 24






















On Thu, May 28, 2020 at 9:08 AM Daniel-Constantin Mierla 
wrote:

> Hello,
>
> maybe a dedicated module is going to be too complex or better said,
> duplicate a lot of code for management of the destinations,
> load/reload/keepalive, ... (although I won't have anything against such
> approach, if considered better by developer).
>
> However, if done in dispatcher, I think that a new algorithm id should be
> used, leaving 8 as it is. Also, there should be a new field added in the
> internal structure to keep this "dynamic" priority -- it can be initialized
> to the "priority" value.
>
> In some cases I use different algorithms for the same group of
> destinations, so it would be good to be able to use algorithm 8 with
> priority from database and the new algorithm at the same time.
>
> Cheers,
> Daniel
> On 27.05.20 21:46, Henning Westerholt wrote:
>
> Hi Julien,
>
>
>
> sounds interesting, a “location optimized routing mode”. What about making
> it as a dedicated mode, to not overloading the mode “8”?
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> --
>
> Henning Westerholt – https://skalatan.de/blog/
>
> Kamailio services – https://gilawa.com
>
>
>
> *From:* sr-dev 
>  *On Behalf Of *Julien Chavanton
> *Sent:* Thursday, May 14, 2020 7:26 PM
> *To:* Kamailio (SER) - Development Mailing List
>  ; Kamailio (SER) -
> Users Mailing List 
> 
> *Subject:* [sr-dev] congestion control priority for priority based
> dispatching
>
>
>
> Hi Folks,
>
>
> Just found another simple use case of the dispatcher latency stats.
>
> Just shraing this idea of a feature I want to contribute.
>
>
> When using dispatcher algorithm 8:
>
>“8” - select destination sorted by priority attribute value (serial
> forking ordered by priority).
>
> If the gateway as the attribute, the priority becomes the estimated
> latency.
>
>cc-priority
>
>
>
> - The dispatcher would automatically prioritize the closest one.
>
> - If a gateway is becoming unresponsive it will automatically become de
> prioritize.
>
>
> Consider this real life scenario where you have gateways in East and West
> Coast
>
> Example
>
>
> URI: sip:28.71.19.140
>
>
> FLAGS: AP
> PRIORITY: 10
> ATTRS: {
> BODY: cc_priority=1
> }
> LATENCY: {
> AVG: 84.001000
> STD: 0.062000
> EST: 84.001000 (high == low priority)
> MAX: 93
> TIMEOUT: 0
> URI: sip:28.71.16.140
> FLAGS: AP
> PRIORITY: 10
>
> ATTRS: {
> BODY: cc_priority=1
> }
>
> LATENCY: {
> AVG: 29.11
> STD: 2.383000
> EST: 31.999000 (low == high priority)
> MAX: 1499
> TIMEOUT: 1
>
>
>
>
>
> Another major improvement to all of this would be to gather stats on
> INVITE <> 100 to have a very accurate latency estimation even if the
> gateway does not support SIP OPTIONS pings
>
>
>
>
>
> ___
> Kamailio (SER) - Development Mailing 
> Listsr-dev@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
> www.linkedin.com/in/miconda
> Funding: https://www.paypal.me/dcmierla
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-us...@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] congestion control priority for priority based dispatching

2020-05-28 Thread Daniel-Constantin Mierla
Hello,

maybe a dedicated module is going to be too complex or better said,
duplicate a lot of code for management of the destinations,
load/reload/keepalive, ... (although I won't have anything against such
approach, if considered better by developer).

However, if done in dispatcher, I think that a new algorithm id should
be used, leaving 8 as it is. Also, there should be a new field added in
the internal structure to keep this "dynamic" priority -- it can be
initialized to the "priority" value.

In some cases I use different algorithms for the same group of
destinations, so it would be good to be able to use algorithm 8 with
priority from database and the new algorithm at the same time.

Cheers,
Daniel

On 27.05.20 21:46, Henning Westerholt wrote:
>
> Hi Julien,
>
>  
>
> sounds interesting, a “location optimized routing mode”. What about
> making it as a dedicated mode, to not overloading the mode “8”?
>
>  
>
> Cheers,
>
>  
>
> Henning
>
>  
>
> -- 
>
> Henning Westerholt – https://skalatan.de/blog/
>
> Kamailio services – https://gilawa.com 
>
>  
>
> *From:* sr-dev  *On Behalf Of
> *Julien Chavanton
> *Sent:* Thursday, May 14, 2020 7:26 PM
> *To:* Kamailio (SER) - Development Mailing List
> ; Kamailio (SER) - Users Mailing List
> 
> *Subject:* [sr-dev] congestion control priority for priority based
> dispatching
>
>  
>
> Hi Folks,
>
>
> Just found another simple use case of the dispatcher latency stats.
>
> Just shraing this idea of a feature I want to contribute.
>
>
> When using dispatcher algorithm 8:
>
>    “8” - select destination sorted by priority attribute value (serial
> forking ordered by priority).
>
> If the gateway as the attribute, the priority becomes the estimated
> latency.
>
>    cc-priority
>
>  
>
> - The dispatcher would automatically prioritize the closest one.
>
> - If a gateway is becoming unresponsive it will automatically become
> de prioritize.
>
>
> Consider this real life scenario where you have gateways in East and
> West Coast
>
> Example
>
>
> URI: sip:28.71.19.140                                                
>                                                                      
>                                                                
> FLAGS: AP
> PRIORITY: 10
> ATTRS: {
>         BODY: cc_priority=1
> }
> LATENCY: {
>         AVG: 84.001000
>         STD: 0.062000
>         EST: 84.001000 (high == low priority)
>         MAX: 93
>         TIMEOUT: 0
> URI: sip:28.71.16.140
> FLAGS: AP
> PRIORITY: 10
>
> ATTRS: {
>         BODY: cc_priority=1
> }
>
> LATENCY: {
>         AVG: 29.11
>         STD: 2.383000
>         EST: 31.999000 (low == high priority)
>         MAX: 1499
>         TIMEOUT: 1
>
>  
>
>  
>
> Another major improvement to all of this would be to gather stats on
> INVITE <> 100 to have a very accurate latency estimation even if the
> gateway does not support SIP OPTIONS pings
>
>  
>
>  
>
>
> ___
> Kamailio (SER) - Development Mailing List
> sr-dev@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

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


Re: [sr-dev] [kamailio/kamailio] dispatcher: rework attrs parameter in rpc 'add' command (#2339)

2020-05-28 Thread Henning Westerholt
related to review remarks from #2336 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2339#issuecomment-635272034___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Cannot set alias from substdef/environment (#2310)

2020-05-28 Thread Mathias Brodala
I finally was able to have another look at this and it works just fine now. 
Thanks a lot for your help!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2310#issuecomment-635266794___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:92648988: kazoo: avoid unnecessary casts for kemi exports

2020-05-28 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 92648988694970bc7b29a56814c935421d362cfa
URL: 
https://github.com/kamailio/kamailio/commit/92648988694970bc7b29a56814c935421d362cfa

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-05-28T11:36:24+02:00

kazoo: avoid unnecessary casts for kemi exports

---

Modified: src/modules/kazoo/kz_amqp.c
Modified: src/modules/kazoo/kz_amqp.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/92648988694970bc7b29a56814c935421d362cfa.diff
Patch: 
https://github.com/kamailio/kamailio/commit/92648988694970bc7b29a56814c935421d362cfa.patch

---

diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index 7c9482e270..8076315dfd 100644
--- a/src/modules/kazoo/kz_amqp.c
+++ b/src/modules/kazoo/kz_amqp.c
@@ -1242,21 +1242,21 @@ int kz_amqp_publish_ex(struct sip_msg* msg, char* 
exchange, char* routing_key, c
return -1;
}
 
-   return ki_kz_amqp_publish(msg, (char*)&exchange_s, 
(char*)&routing_key_s, (char*)&pl_s);
+   return ki_kz_amqp_publish(msg, &exchange_s, &routing_key_s, 
&pl_s);
 };
 
-int ki_kz_amqp_publish(struct sip_msg* msg, char* exchange, char* routing_key, 
char* payload)
+int ki_kz_amqp_publish(sip_msg_t* msg, str* exchange, str* routing_key, str* 
payload)
 {
  char *pl = ((str*)payload)->s;
  struct json_object *j = json_tokener_parse(pl);
 
  if (j==NULL) {
- LM_ERR("empty or invalid JSON payload : %.*s\n", 
((str*)payload)->len, ((str*)payload)->s);
+ LM_ERR("empty or invalid JSON payload : %.*s\n", 
payload->len, payload->s);
  return -1;
  }
- 
+
  json_object_put(j);
- return kz_amqp_pipe_send((str*)exchange, (str*)routing_key, 
(str*)payload);
+ return kz_amqp_pipe_send(exchange, routing_key, payload);
 }
 
 int kz_amqp_publish(struct sip_msg* msg, char* exchange, char* routing_key, 
char* payload)
@@ -1801,16 +1801,16 @@ kz_amqp_exchange_binding_ptr 
kz_amqp_exchange_binding_from_json(json_object* JOb
 int kz_amqp_subscribe(struct sip_msg* msg, char* payload)
 {
str payload_s = STR_NULL;
-
+
if (fixup_get_svalue(msg, (gparam_p)payload, &payload_s) != 0) {
LM_ERR("cannot get payload value\n");
return -1;
}
 
-   return ki_kz_amqp_subscribe(msg, (char*)(&payload_s));
+   return ki_kz_amqp_subscribe(msg, &payload_s);
 }
 
-int ki_kz_amqp_subscribe(struct sip_msg* msg, char* payload)
+int ki_kz_amqp_subscribe(struct sip_msg* msg, str* payload)
 {
str exchange_s = STR_NULL;
str queue_s = STR_NULL;
@@ -1833,12 +1833,11 @@ int ki_kz_amqp_subscribe(struct sip_msg* msg, char* 
payload)
kz_amqp_bind_ptr bind = NULL;
kz_amqp_binding_ptr binding = NULL;
 
-   char* pl = ((str*)payload)->s;
+   char* pl = payload->s;
json_obj = kz_json_parse(pl);
 
if (json_obj == NULL)
return -1;
-
 
json_extract_field("exchange", exchange_s);
json_extract_field("queue", queue_s);
diff --git a/src/modules/kazoo/kz_amqp.h b/src/modules/kazoo/kz_amqp.h
index 1ca3e5447f..cf8333acad 100644
--- a/src/modules/kazoo/kz_amqp.h
+++ b/src/modules/kazoo/kz_amqp.h
@@ -274,11 +274,11 @@ int kz_amqp_add_connection(modparam_t type, void* val);
 
 int kz_amqp_publish(struct sip_msg* msg, char* exchange, char* routing_key, 
char* payload);
 int kz_amqp_publish_ex(struct sip_msg* msg, char* exchange, char* routing_key, 
char* payload, char* _pub_flags);
-int ki_kz_amqp_publish(struct sip_msg* msg, char* exchange, char* routing_key, 
char* payload);
+int ki_kz_amqp_publish(sip_msg_t* msg, str* exchange, str* routing_key, str* 
payload);
 int kz_amqp_query(struct sip_msg* msg, char* exchange, char* routing_key, 
char* payload, char* dst);
 int kz_amqp_query_ex(struct sip_msg* msg, char* exchange, char* routing_key, 
char* payload);
 int kz_amqp_subscribe(struct sip_msg* msg, char* payload);
-int ki_kz_amqp_subscribe(struct sip_msg* msg, char* payload);
+int ki_kz_amqp_subscribe(sip_msg_t* msg, str* payload);
 int kz_amqp_subscribe_simple(struct sip_msg* msg, char* exchange, char* 
exchange_type, char* queue_name, char* routing_key);
 int kz_amqp_encode(struct sip_msg* msg, char* unencoded, char* encoded);
 int kz_amqp_encode_ex(str* unencoded, pv_value_p dst_val);


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


[sr-dev] [kamailio/kamailio] dispatcher: rework attrs parameter in rpc 'add' command (#2339)

2020-05-28 Thread Federico Cabiddu




 Pre-Submission Checklist



- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, 
...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook 
files
in `doc/` subfolder, the README file is autogenerated)

 Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

 Checklist:

- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue # (replace  with an open issue number)

 Description
Fixed attrs parameters handling i rpc 'add' command.

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/2339

-- Commit Summary --

  * dispatcher: rework attrs parameter in rpc 'add' command

-- File Changes --

M src/modules/dispatcher/dispatch.c (4)
M src/modules/dispatcher/dispatcher.c (10)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/2339.patch
https://github.com/kamailio/kamailio/pull/2339.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2339
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:b68ae9f3: modules: readme files regenerated - textops ... [skip ci]

2020-05-28 Thread Kamailio Dev
Module: kamailio
Branch: master
Commit: b68ae9f333a2664b240232097c1a9aeac5e674b3
URL: 
https://github.com/kamailio/kamailio/commit/b68ae9f333a2664b240232097c1a9aeac5e674b3

Author: Kamailio Dev 
Committer: Kamailio Dev 
Date: 2020-05-28T10:01:16+02:00

modules: readme files regenerated - textops ... [skip ci]

---

Modified: src/modules/textops/README

---

Diff:  
https://github.com/kamailio/kamailio/commit/b68ae9f333a2664b240232097c1a9aeac5e674b3.diff
Patch: 
https://github.com/kamailio/kamailio/commit/b68ae9f333a2664b240232097c1a9aeac5e674b3.patch


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


[sr-dev] git:master:948e1e5f: textops: docs for functions to remove or test headers with variables

2020-05-28 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 948e1e5f354e436d9216b66700ea8b3c45fd14d1
URL: 
https://github.com/kamailio/kamailio/commit/948e1e5f354e436d9216b66700ea8b3c45fd14d1

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-05-28T09:46:09+02:00

textops: docs for functions to remove or test headers with variables

---

Modified: src/modules/textops/doc/textops_admin.xml

---

Diff:  
https://github.com/kamailio/kamailio/commit/948e1e5f354e436d9216b66700ea8b3c45fd14d1.diff
Patch: 
https://github.com/kamailio/kamailio/commit/948e1e5f354e436d9216b66700ea8b3c45fd14d1.patch


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


[sr-dev] git:master:157f32a2: textops: added functions to remove or test headers with var parameters

2020-05-28 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 157f32a26089de16d954e9722c25e4d4c2d52461
URL: 
https://github.com/kamailio/kamailio/commit/157f32a26089de16d954e9722c25e4d4c2d52461

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-05-28T09:28:41+02:00

textops: added functions to remove or test headers with var parameters

---

Modified: src/modules/textops/textops.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/157f32a26089de16d954e9722c25e4d4c2d52461.diff
Patch: 
https://github.com/kamailio/kamailio/commit/157f32a26089de16d954e9722c25e4d4c2d52461.patch


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


[sr-dev] git:master:9d6c274b: core: exposed kemi function to remove a header by name

2020-05-28 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 9d6c274b043f9cc548addb3204f2f8f18d62db8a
URL: 
https://github.com/kamailio/kamailio/commit/9d6c274b043f9cc548addb3204f2f8f18d62db8a

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2020-05-28T09:26:43+02:00

core: exposed kemi function to remove a header by name

---

Modified: src/core/kemi.c
Modified: src/core/kemi.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/9d6c274b043f9cc548addb3204f2f8f18d62db8a.diff
Patch: 
https://github.com/kamailio/kamailio/commit/9d6c274b043f9cc548addb3204f2f8f18d62db8a.patch

---

diff --git a/src/core/kemi.c b/src/core/kemi.c
index 2a63279795..3cbeee6d08 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -1991,7 +1991,7 @@ static int sr_kemi_hdr_append_after(sip_msg_t *msg, str 
*txt, str *hname)
 /**
  *
  */
-static int sr_kemi_hdr_remove(sip_msg_t *msg, str *hname)
+int sr_kemi_hdr_remove(sip_msg_t *msg, str *hname)
 {
struct lump* anchor;
hdr_field_t *hf;
diff --git a/src/core/kemi.h b/src/core/kemi.h
index dd7d4bf50b..6493ab5009 100644
--- a/src/core/kemi.h
+++ b/src/core/kemi.h
@@ -225,4 +225,8 @@ sr_kemi_t* sr_kemi_exports_get_pv(void);
 #define SR_KEMI_XVAL_NULL_ZERO 3
 void sr_kemi_xval_null(sr_kemi_xval_t *xval, int rmode);
 void sr_kemi_xval_free(sr_kemi_xval_t *xval);
+
+/* functions exported to kemi that are used in other places */
+int sr_kemi_hdr_remove(sip_msg_t *msg, str *hname);
+
 #endif


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