Re: [SR-Users] Received ipv6 problem

2020-06-02 Thread Joel Serrano
Not exactly an answer to your specific question, but it might help solve
your problem in a different way...

If you using the registrar module with save()... you might be able to take
advantage in some way of the flags 0x04:

https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.f.save


*"0x04 - store and maintain one contact per AoR. If there are other contact
addresses for AoR not matching current registration, remove them. This mode
ensures one contact per AoR (user)."*

Regarding "received", I would think that you have it on IPV4 because the UA
is probably behind NAT, and you are adding it in config script, with IPv6,
there is no NAT, and --most likely-- you are not adding it, thus it's not
saved to the database. Check if you are using fix_nated_register()
somewhere in your config file.. For IPv6 it might be easier if you just
pull the IP from the Contact info.


Sorry if this isn't very helpful, I'm guessing a little based on the info
you provided :)

Cheers,
Joel.



On Tue, Jun 2, 2020 at 4:46 PM Ahmed Marsou  wrote:

> Hi;
> I'm using the received parameter to send a MESSAGE to unregsiter the first
> user that is registered to register the second one.
> Using:
> *modparam("usrloc", "received_column"*
>
> *modparam("registrar|nathelper", "received_avp",*
>
> and when I do a:
> select received from location;
> as you can see is null.
> +--+
> | received |
> +--+
> | NULL |
> +--+
>
> In IPV4 is working fine, but in IPV6 is not. Can you tell me how can I get
> this value?
> Im going crazy with that.
>
> reg_fetch_contacts("location", "$fu", "existingContact");
> if( $(ulc(existingContact=>user_agent)[0]) =~ "SPI/v"){
> $var(oldDeviceId) =
> $(ulc(existingContact=>callid)[0]{s.substr,9,0});
> $var(newDeviceId) = $(hdr(Call-ID){s.substr,9,0});
> if($var(oldDeviceId) !=  $var(newDeviceId) ){
> xlog("L_INFO","New device id is
> different:warn previous user another user overide him");
> $var(address) = $(ulc(existingContact=>
> *received*)[0]);
> $var(ruri) = $(var(address){s.substr,4,0});
> #Send a SIP Request signalling the problem
> and its reason on the body
> $uac_req(method)="MESSAGE";
> $uac_req(ruri) = "sip:"+ $au + "@" +
> $var(ruri);
> $uac_req(furi) = "sip:kamailio@sip_domain
> ";
> $uac_req(turi) = $fu;
> $uac_req(hdrs)="Max-Forwards: 70\r\nEvent:
> reg\r\nContent-Type:
> text/plain\r\nAccept-Contact:*;+g.ext.app.registration\r\n";
> $uac_req(body)="Already registered with
> another device id";
> uac_req_send();
> drop;
> }
> }
>
>
> Thank you.
>
>
> ___
> 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] Received ipv6 problem

2020-06-02 Thread Ahmed Marsou
Hi;
I'm using the received parameter to send a MESSAGE to unregsiter the first
user that is registered to register the second one.
Using:
*modparam("usrloc", "received_column"*

*modparam("registrar|nathelper", "received_avp",*

and when I do a:
select received from location;
as you can see is null.
+--+
| received |
+--+
| NULL |
+--+

In IPV4 is working fine, but in IPV6 is not. Can you tell me how can I get
this value?
Im going crazy with that.

reg_fetch_contacts("location", "$fu", "existingContact");
if( $(ulc(existingContact=>user_agent)[0]) =~ "SPI/v"){
$var(oldDeviceId) =
$(ulc(existingContact=>callid)[0]{s.substr,9,0});
$var(newDeviceId) = $(hdr(Call-ID){s.substr,9,0});
if($var(oldDeviceId) !=  $var(newDeviceId) ){
xlog("L_INFO","New device id is
different:warn previous user another user overide him");
$var(address) = $(ulc(existingContact=>
*received*)[0]);
$var(ruri) = $(var(address){s.substr,4,0});
#Send a SIP Request signalling the problem
and its reason on the body
$uac_req(method)="MESSAGE";
$uac_req(ruri) = "sip:"+ $au + "@" +
$var(ruri);
$uac_req(furi) = "sip:kamailio@sip_domain";
$uac_req(turi) = $fu;
$uac_req(hdrs)="Max-Forwards: 70\r\nEvent:
reg\r\nContent-Type:
text/plain\r\nAccept-Contact:*;+g.ext.app.registration\r\n";
$uac_req(body)="Already registered with
another device id";
uac_req_send();
drop;
}
}


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


Re: [SR-Users] kamcmd mtree.match

2020-06-02 Thread George Diamantopoulos
Have you tried

kamcmd mtree.match siteId s:49241531075212 0

?
On Tue, 2 Jun 2020, 17:17 Henning Westerholt,  wrote:

> Hello Volker,
>
>
>
> the error message you‘ve got from the command looks like the generic error
> that is returned if the number or type of parameters do not match. Did you
> managed to get a match from the kamcmd command at all?
>
>
>
> Further hints might be also visible in the kamailio log file.
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> --
>
> Henning Westerholt – https://skalatan.de/blog/
>
> Kamailio services – https://gilawa.com
>
>
>
> *From:* sr-users  *On Behalf Of *Volker
> Denneberg
> *Sent:* Sunday, May 31, 2020 12:03 AM
> *To:* sr-users@lists.kamailio.org
> *Subject:* [SR-Users] kamcmd mtree.match
>
>
>
> Hi,
>
>
>
> given this mtree
>
>
>
> kamcmd mtree.list siteId
>
> {
>
> tname: siteId
>
> tprefix: 00492419697994
>
> tvalue: {
>
> 00492419697994 2388
>
> }
>
> }
>
> {
>
> tname: siteId
>
> tprefix: 492415310752
>
> tvalue: {
>
> 492415310752 2388
>
> }
>
> }
>
>
>
> i wonder why this lookup fails:
>
>
>
> kamcmd mtree.match siteId 49241531075212 0
>
> error: 500 - Invalid Parameters
>
>
>
> My expectation was that 2nd tprefix should match.
>
>
>
> I am using
>
>
>
> modparam("mtree", "db_table", "mtrees")
>
> modparam("mtree", "char_list", "0123456789+")
>
> modparam("mtree", "mt_tree_type", 0)# payload type for
> tree data : string
>
>
>
> Thanks in advance,
>
> Volker
> ___
> 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] kamcmd mtree.match

2020-06-02 Thread Henning Westerholt
Hello Volker,

the error message you've got from the command looks like the generic error that 
is returned if the number or type of parameters do not match. Did you managed 
to get a match from the kamcmd command at all?

Further hints might be also visible in the kamailio log file.

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com

From: sr-users  On Behalf Of Volker 
Denneberg
Sent: Sunday, May 31, 2020 12:03 AM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] kamcmd mtree.match

Hi,

given this mtree

kamcmd mtree.list siteId
{
tname: siteId
tprefix: 00492419697994
tvalue: {
00492419697994 2388
}
}
{
tname: siteId
tprefix: 492415310752
tvalue: {
492415310752 2388
}
}

i wonder why this lookup fails:

kamcmd mtree.match siteId 49241531075212 0
error: 500 - Invalid Parameters

My expectation was that 2nd tprefix should match.

I am using

modparam("mtree", "db_table", "mtrees")
modparam("mtree", "char_list", "0123456789+")
modparam("mtree", "mt_tree_type", 0)# payload type for tree 
data : string

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


Re: [SR-Users] Meaning of shmem stats and question on dmq dialog sharing behaviour

2020-06-02 Thread George Diamantopoulos
Nope, it opens fine here. Does this work: https://snipboard.io/5E4V3m.jpg ?

On Tue, 2 Jun 2020 at 08:34, Daniel-Constantin Mierla 
wrote:

> Hello,
>
> I get image not found on that link, have you removed it?
>
> Cheers,
> Daniel
> On 01.06.20 13:57, George Diamantopoulos wrote:
>
> Hello all,
>
> I've recently been experimenting with dmq, and I've noticed something that
> seemed a little odd. shmem use would often be abnormally high on otherwise
> idle kamailio nodes (literally, only dispatcher module OPTIONS were
> exchanged at the time besides KDMQ messages).
>
> After disabling the "enable_dmq" parameter for the dialog module, this
> sort of absurd behaviour ceased. To get a quantified idea of this change's
> effect, check out the following screenshot from our monitoring system:
> https://pasteboard.co/Jb430lD.png
>
> As you can see, the spikes stopped manifesting at around 05:00, when dmq
> was disabled for dialog (albeit still employed for htable). shmem use then
> grew as traffic was introduced to these nodes, and htables began filling
> with data.
>
> I was wondering if this to be expected, which I find highly odd given that
> at the time other productive systems in the DMQ cluster were also idle
> (given the time of the day), not to mention that their shmem usage was not
> nearly as high.
>
> Could this be attributed to some configuration error, with updates looping
> endlessly (or until some counter reaches zero or something) among nodes? Or
> could memory be used for other housekeeping purposes unrelated to dmq
> dialog sharing?
>
> Lastly, what is the meaning (and differences) of these shmem stats?
>
>- real_used_size
>- used_size
>- max_used_size
>
> Max used size I get (I'm guessing maximum seen since server was started?)
> but what's the difference between real_used and used? Thanks!
>
> Best regards,
> George
>
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> 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-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Can't work around double SDP rewrite issue with rtpengine and config script SDP manipulation

2020-06-02 Thread George Diamantopoulos
Daniel, that worked instantly, thank you!

Care to elaborate on how msg_apply_changes() interferes with loose_route? I
also remember msg_apply_changes() complaining if called after
record_route(), is it related?

On Mon, 1 Jun 2020 at 21:24, Daniel-Constantin Mierla 
wrote:

> Hello,
>
> use msg_apply_changes just after replace_body_str(), eventually before
> loose routing processing for requests within dialog.
>
> Cheers,
> Daniel
> On 01.06.20 13:34, George Diamantopoulos wrote:
>
> Hello all,
>
> I'm facing one of those cases where I need to edit the body of a SIP
> message, which is then to be fed to rtpengine for processing. Although I've
> taken every precaution I've read about on this list and elsewhere, I can't
> prevent the edited line from appearing twice in the outgoing message.
>
> The configuration file used is huge, so I'm going to try to provide a
> high-level overview here. But first, the things (I think) I know to be
> requirements, and which I have striven to meet:
>
>- If SDP is to be edited, then all such processing is to be carried
>out in such a way in the script, so that msg_apply_changes() is run as many
>times as needed before rtpengine offer/answer/manage is called.
>- rtpengine offer/answer/manage is to be called only once per script
>iteration
>- msg_apply_changes can only be called in a request route, or in the
>core reply_route (i.e. *not* in tm-managed on_reply_route[XXX] blocks)
>
> In my case, additionally the following are true:
>
>- SDP processing (other than the one performed by rtpengine) takes
>place in one common route for all cases where it needs to happen. These are
>two at the moment in my scenario:
>- Early in the WITHINDLG route (of the example config file)
>   - After the sanity checks in the reply_route (of the example config
>   file)
>- msg_apply changes() is called once, for each script iteration:
>   - right before rtpengine_manage() is called, provided that
>   t_is_request_route() returns true (so that I don't accidentally call it
>   from a branch route or anything)
>  - rtpengine_manage() is called in its own route, which is very
>  similar to the example config file's "NATMANAGE" route. Since 
> NATMANAGE is
>  called in all branch and on_reply_routes, I employ 
> t_is_request_route()
>  here to make sure it won't execute in those cases.
>   - at the end of the "core" reply_route
>
> Now regarding the actual config-file-controlled SDP manipulation, it only
> consists of a single call to replace_body_str(). The purpose is to edit a
> line in the message body from something like:
>
>- a=fmtp:101 0-16
>
> to something along the lines of:
>
>- a=fmtp:101 0-15
>
> For replies, this works as expected.
>
> For in-dialog requests, however, I end up with both the original and the
> edited lines:
> a=fmtp:101 0-16 (the original line)
> ... other SDP stuff ...
> a=fmtp:101 0-15 (the edited line)
>
> If anyone could point out any misconceptions I have about
> msg_apply_changes, SDP rewriting from the script and rtp_engine_X()
> interoperability, I would be more than grateful.
>
> Thank you in advance and I apologize for the long read.
>
> Best regards,
> George Diamantopoulos
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> 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-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] rtpengine on different server

2020-06-02 Thread Henning Westerholt
Hello,

usually you just need to install rtpengine on the second server and configure 
the rtpengine module “rtpengine_sock” to point to its address. Then just handle 
the rtpengine commands as usual in the Kamailio cfg. Maybe you can give further 
details what are you questions.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: sr-users  On Behalf Of Gaurav Bmotra
Sent: Tuesday, June 2, 2020 8:13 AM
To: Kamailio (SER) - Users Mailing List ; Kamailio 
(SER) - Users Mailing List 
Subject: [SR-Users] rtpengine on different server

hi
i m using kamailio 5.3  ans install rtpengine on different server
kindly help me what will be the configuration in case of kamailio
and rtpengine

thank you

--








Regards:
Gaurav Kumar

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


[SR-Users] rtpengine on different server

2020-06-02 Thread Gaurav Bmotra
hi
i m using kamailio 5.3  ans install rtpengine on different server
kindly help me what will be the configuration in case of kamailio
and rtpengine

thank you

-- 








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