Re: [SR-Users] Re-use TCP connections on different transactions

2019-11-01 Thread Joel Serrano
Hi Yuriy,

Thanks for your suggestion, I've tried tcp_accept_aliases=yes in config and
I added force_tcp_alias() in the request route, but I haven't seen any
changes.

All the VIA headers look exactly the same, and I still get this in the logs:

"message":" DEBUG: {1 11762916 BYE d2T9-YOxYk} 
[core\/tcp_main.c:2060]: tcp_send(): no open tcp connection found, opening
new one"}


The docs say:

"force_tcp_alias(port)

adds a tcp port alias for the current connection (if tcp). Useful if you
want to send all the trafic to port_alias through the same connection this
request came from [it could help for firewall or nat traversal]. With no
parameters adds the port from the message via as the alias. When the
“aliased” connection is closed (e.g. it's idle for too much time), all the
port aliases are removed."

I tried also using force_tcp_alias(5353) as an example, just to see if I
find "5353" added to any headers, but no luck, it wasn't added anywhere..


Any other suggestions? Am I missing something?


Thanks,

Joel.

On Thu, Oct 31, 2019 at 10:53 PM Yuriy Gorlichenko 
wrote:

> You have to use
> tcp_accept_aliases=yes
> But this is not enough as this param will be triggered by function
> force_tcp_alias() you need to use in the route for request ( for example
> record_route or subroutes)
> It will add param paramname= (I Don't remember specific name)
> to Via header that will be used for all dialog requests belongs one being
> affected
>
>
> On Fri, 1 Nov 2019, 00:52 Joel Serrano,  wrote:
>
>> Hello,
>>
>> I'm setting up a Kamailio instance behind a TCP load balancer (with proxy
>> protocol and NAT routing: meaning Kam stays in the flow all the time).
>>
>> I've managed to get working almost everything we need for our service,
>> except for one thing, and that is for Kam to use existing connections for
>> subsequent transactions:
>>
>> Following this example:
>>
>>
>> [image: image.png]
>>
>>
>> EXT & INT represent the external and internal interface of a LB between
>> the UAC and Kamailio, using TLS on both legs and proxy protocol.
>>
>> Transaction 1: INVITE, 100, 180, 183, 200 OK
>>
>> UAC 1.1.1.1: -> 2.2.2.2:443 (EXT) 3.3.3.3: (INT) -> 7.7.7.7:5060
>> (Kamailio)
>>
>> Transaction 2: ACK
>>
>> UAC 1.1.1.1:1112 -> 2.2.2.2:443 (EXT) 4.4.4.4: (INT) -> 7.7.7.7:5060
>> (Kamailio)
>>
>> Transaction 3: BYE
>>
>> Kam 7.7.7.7:5060 -> 3.3.3.3: (INT) 2.2.2.2:443 (EXT) -> 1.1.1.1:
>> UAC
>>
>>
>>
>> My problem is with Transaction 3. In this case the BYE is originated by
>> the callee, and Kam has to send it to the caller. As the TCP load balancer
>> is between Kam and the UAC, Kam has to send it to the LB so then the LB can
>> forward it back to the UAC. This works well for msgs that belong to the
>> same transaction (INVITE, 100, 180, 183, 200 OK) but it fails when they
>> don't belong to the same transaction.
>>
>> Thanks to the newly added $tcp(c_si) and $tcp(c_sp) pseudovars, I can
>> save the internal IP:Port of the LB, so I can send stuff later to it, my
>> problem is that Kam doesn't seem to allow this?
>>
>> On the original INVITE, I use the following to save where I have to reach
>> the UAC:
>>
>> add_contact_alias("$tcp(c_si)", "$tcp(c_sp)", "tls");
>>
>> Then, handle_ruri_alias() will take care of setting $du to the correct
>> (internal LB) IP:Port so I can reach the UAC, this works.
>>
>> My problem is that Kamailio doesn't identify that there is a valid
>> existing TLS connection still up (from the INVITE), and tries to create a
>> new one (and this obviously doesn't gives all sorts of problems).
>>
>> So when I run handle_ruri_alias(), and $du is set to 3.3.3.3: (from
>> the example above), instead of using the existing connection, Kamailio
>> tries to create a new one.
>>
>> I have a log statement right before with the result of tcp_conid_state(1)
>> (the connid is 1 for this connection) and the $rc is 1 (Connection is OK),
>> but when I tell Kamailio it has to use it I get this in the logs:
>>
>> DEBUG: {1 11726467 BYE gqR1qqNK8B}  [core\/tcp_main.c:2060]:
>> tcp_send(): no open tcp connection found, opening new one"}
>>
>> And then the problems begin...
>>
>>
>> I have tried playing around with:
>>
>> tcp_reuse_port
>> tcp_connection_match
>>
>> But no luck..!
>>
>> I also thought it could be a problem of the connection being created on
>> one worker, and a different worker handling BYE transaction, so tested with
>> children=1 and tcp_children=1, but still same problem.
>>
>> A more detailed log:
>>
>> In blue my log statement checking for the status of conid "1", in red Kam
>> not being able to find it, although it exists (as validated
>> by tcp_conid_state(), and even in netstat I can see the connection
>> established). In this log, 35.191.0.66:60271 would be the equivalent of
>> 3.3.3.3: and 104.175.176.242:28157 would be 1.1.1.1: from the
>> example above.
>>
>> ...
>> "message":" DEBUG: {1 11727734 BYE 5-LX4GdI9X} 
>> [core\/tcp_main.c:1657]: _tcpconn_find(): found 

Re: [SR-Users] lookup(aliases) issues with 5.2

2019-11-01 Thread Henning Westerholt
Hello Igor,

functional extensions like this will be usually not be backported to older 
stable releases.

But you should be able to easily apply the patch to your local copy, if you 
build from tar anyway.

This is the patch, you can apply with the command "patch":

https://github.com/kamailio/kamailio/commit/038158c99da96933c26b11a919ed1cbe29af9fab.patch

Cheers,

Henning

Am 28.10.19 um 19:13 schrieb 
igor.potjevle...@gmail.com:
Hello Daniel,

Thank you!
Is it pushed in one of the latest release? Because we don't have a connection 
to git on our server. We build from tar.

Regards,

Igor.

De : Daniel-Constantin Mierla 
Envoyé : jeudi 10 octobre 2019 14:40
À : igor.potjevle...@gmail.com; 'Kamailio 
(SER) - Users Mailing List' 

Objet : Re: [SR-Users] lookup(aliases) issues with 5.2


Hello,

I just pushed a commit adding a core parameter to allow specifying additional 
character in the host part of URIs:

 - 
https://github.com/kamailio/kamailio/commit/038158c99da96933c26b11a919ed1cbe29af9fab

It is in the master branch. Can you test it and report if works as expected?

Cheers,
Daniel
On 04.10.19 10:08, 
igor.potjevle...@gmail.com wrote:
Hello Daniel,

I confirm that we did that indeed. Just added the support of "_" instead of 
rollback on the whole code.

Thank you!

Regards,

Igor.

De : Daniel-Constantin Mierla 
Envoyé : mercredi 11 septembre 2019 09:51
À : igor.potjevle...@gmail.com; 'Kamailio 
(SER) - Users Mailing List' 

Objet : Re: [SR-Users] lookup(aliases) issues with 5.2


Hello,

I will think what would be good ways to optimizie.

If you want to change the code, probably doesn't make sense to revert the 
entire patch locally, just allow '_' -- you should change:

if(!isalnum(*p) && (*p != '.') && (*p != '-')) {

to

if(!isalnum(*p) && (*p != '.') && (*p != '-') && (*p != '_')) {

in src/core/parser/parse_uri.c -- see function parse_uri() and case URI_HOST_P.

Cheers,
Daniel


On 29.08.19 10:21, 
igor.potjevle...@gmail.com wrote:
Hello Daniel, Henning,

I'd be interested, but if I'm the only one... Otherwise I can indeed remove 
this patch as Henning suggests, but it embarrasses me to have a different 
source code.
Tell me if it's possible to make it customizable. Otherwise I will consider 
either removing the patch or finding another workaround.

Regards,

Igor.

De : Daniel-Constantin Mierla 
Envoyé : mercredi 28 août 2019 20:26
À : igor.potjevle...@gmail.com; 'Kamailio 
(SER) - Users Mailing List' 

Objet : Re: [SR-Users] lookup(aliases) issues with 5.2


Hello,

I haven't authored that patch and also never needed an underscore in host part 
of the URI, but also it didn't affect me before that change. I guess Juha 
wanted o be compliant with the RFC.

If people need to allow an extended set of chars in the host part, I am fine to 
add some parameter to control that.

Cheers,
Daniel
On 28.08.19 15:34, 
igor.potjevle...@gmail.com wrote:
Hello,

Hmm, ok. Saw it.
Is it possible to reconsider a less strict control?

Regards,

Igor.

De : Daniel-Constantin Mierla 
Envoyé : mercredi 28 août 2019 10:25
À : igor.potjevle...@gmail.com; 'Kamailio 
(SER) - Users Mailing List' 

Objet : Re: [SR-Users] lookup(aliases) issues with 5.2


Hello,

reading again I see that the error with the host uri is printed from the C 
code. I thought of another issue that was reported related to IPv6 addresses in 
the URI that kamctl rejected.

The problem is that the underscore is not allowed in hostname: the relevant 
standard is RFC 1123, section 2.1 "Host Names and Numbers" which limits host 
names to letters-digits-hyphen.

I checked the commits log and it seems this more strict verification was added 
by next commit:

commit 4994960324d5353222b3de08515bed07802ab7bc
Author: Juha Heinanen 
Date:   Wed Jan 10 08:39:48 2018 +0200

core/parser: more strict parsing of sip uri host

Regarding the $ALL_METHODS not being defined, iirc, you should set it to . (or 
maybe -1 in this case).

Cheers,
Daniel
On 28.08.19 10:12, 
igor.potjevle...@gmail.com wrote:
Hello Daniel,

We moved to the latest 5.2.4 but hostname with underscore are still not handle 
properly.
Is it a real design choice or a mistake somewhere in the code that handle 
domain name?

Regards,

Igor.

De : igor.potjevle...@gmail.com 

Envoyé : mardi 27 août 2019 11:53
À : 

Re: [SR-Users] How to use sdp_remove_media() ?

2019-11-01 Thread Karsten Horsmann
Hi Denys,

AFAIK read and writes rtpengine the complete sdp. So manipulating with the
"classic" textops tools is more for RtpProxy. You can search for things but
writing will done by rtpengine.
I remove for example an codec with codec-mask. Or you can manipulate the
avp you read from rtpengine (via modparam) in the request.

Did you try to *codec-mask= in the rtpengine calls (answer / manage)? *
*So rtpengine takes care for the removal. *
*It needs to know what to remove. *

https://www.kamailio.org/docs/modules/5.3.x/modules/rtpengine.html#idm1459


Cheers
Karsten

Denys Pozniak  schrieb am Fr., 1. Nov. 2019, 15:10:

> If I put route(SDP_VIDEO_REMOVER) into the section route[NATMANAGE] (
> https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg#L820 ),
> Kamailio shows the error I posted below.
>
> route[SDP_VIDEO_REMOVER] {
> if ( is_request() && has_body("application/sdp") &&
> sdp_with_media("video") ) {
> sdp_remove_media("video");
> msg_apply_changes();
> xlog("L_WARN","[$cfg(route)] *m=video detected* |
>  $rm/$rs/$avp(sdp_mvideo_line)/ \n");
> }
> }
>
> 16(15993) DEBUG: sdpops [sdpops_mod.c:883]: sdp_with_media(): attempting
> to search for media type: [video]
> 16(15993) DEBUG: sdpops [sdpops_mod.c:898]: sdp_with_media(): stream 0 of
> 0 - media [audio]
> 16(15993) DEBUG: sdpops [sdpops_mod.c:898]: sdp_with_media(): stream 1 of
> 0 - media [video]
> 16(15993) DEBUG: sdpops [sdpops_mod.c:1038]: sdp_remove_media():
> attempting to search for media type: [video]
> 16(15993) DEBUG: sdpops [sdpops_mod.c:1055]: sdp_remove_media(): stream 0
> of 0 - media [audio]
> 16(15993) DEBUG: sdpops [sdpops_mod.c:1055]: sdp_remove_media(): stream 1
> of 0 - media [video]
> 16(15993) DEBUG: sdpops [sdpops_mod.c:1061]: sdp_remove_media(): removing
> media stream: video16(15993) *ERROR: textopsx [textopsx.c:181]:
> ki_msg_apply_changes(): invalid usage - not in request route or a reply*
> 16(15993) WARNING: 

Re: [SR-Users] How to use sdp_remove_media() ?

2019-11-01 Thread Denys Pozniak
If I put route(SDP_VIDEO_REMOVER) into the section route[NATMANAGE] (
https://github.com/kamailio/kamailio/blob/master/etc/kamailio.cfg#L820 ),
Kamailio shows the error I posted below.

route[SDP_VIDEO_REMOVER] {
if ( is_request() && has_body("application/sdp") &&
sdp_with_media("video") ) {
sdp_remove_media("video");
msg_apply_changes();
xlog("L_WARN","[$cfg(route)] *m=video detected* |
 $rm/$rs/$avp(sdp_mvideo_line)/ \n");
}
}

16(15993) DEBUG: sdpops [sdpops_mod.c:883]: sdp_with_media(): attempting to
search for media type: [video]
16(15993) DEBUG: sdpops [sdpops_mod.c:898]: sdp_with_media(): stream 0 of 0
- media [audio]
16(15993) DEBUG: sdpops [sdpops_mod.c:898]: sdp_with_media(): stream 1 of 0
- media [video]
16(15993) DEBUG: sdpops [sdpops_mod.c:1038]: sdp_remove_media(): attempting
to search for media type: [video]
16(15993) DEBUG: sdpops [sdpops_mod.c:1055]: sdp_remove_media(): stream 0
of 0 - media [audio]
16(15993) DEBUG: sdpops [sdpops_mod.c:1055]: sdp_remove_media(): stream 1
of 0 - media [video]
16(15993) DEBUG: sdpops [sdpops_mod.c:1061]: sdp_remove_media(): removing
media stream: video16(15993) *ERROR: textopsx [textopsx.c:181]:
ki_msg_apply_changes(): invalid usage - not in request route or a reply*
16(15993) WARNING: 

Re: [SR-Users] How to use sdp_remove_media() ?

2019-11-01 Thread Daniel-Constantin Mierla
Hello,

that's strange, because the condition in the c code is:

    if(msg->first_line.type != SIP_REPLY && get_route_type() !=
REQUEST_ROUTE) {
        LM_ERR("invalid usage - not in request route or a reply\n");
        return -1;
    }

Which is clear about whether the message is a SIP reply or function is
executed in request_route. There is a condition later about the
record_route(), but it didn't get to that code...

Maybe you can share the entire request_route you had when the error was
exposed.

Cheers,
Daniel

On 01.11.19 12:14, Denys Pozniak wrote:
> Got message in debug=3:
> /13(2141) ERROR: textopsx [textopsx.c:181]: ki_msg_apply_changes():
> invalid usage - not in request route or a reply/
>
> But definitely msg_apply_changes() is placed in request_route section.
> I have just moved code part before calling record_route() function and
> it helped.
>
> Interesting, but as I remember Kamailio should display in such cases
> something like below:
> "...cannot apply msg changes after adding record-route header..."
>
> Thanks for the hint.
>  
>
>
>
> пт, 1 нояб. 2019 г. в 11:35, Daniel-Constantin Mierla
> mailto:mico...@gmail.com>>:
>
> Hello,
>
> run with debug=3 and what the logs to see if there are
> error/warning messages.
>
> Cheers,
> Daniel
>
> On 01.11.19 10:26, Denys Pozniak wrote:
>> Hello!
>>
>> I'm trying to remove m=video stream from incoming SIP/SDP request
>> in th way below:
>>
>> modparam("rtpengine", "read_sdp_pv", "$avp(read_sdp_pv)")
>> modparam("rtpengine", "write_sdp_pv", "$avp(write_sdp_pv)")
>> ...
>>   sdp_remove_media("video");
>>   msg_apply_changes();
>>   sdp_get("$avp(read_sdp_pv)");
>>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci| rb=/$rb/ \n");
>>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci|
>> avp(read_sdp_pv)=/$avp(read_sdp_pv)/ \n");
>>   rtpengine_manage("$avp(rtpengine_offer)");
>>   set_body("$avp(write_sdp_pv)", "application/sdp");
>>
>> But no luck, xlog shows m=video in $rb and $avp(rtp_sdp_read) as
>> well.
>>
>> -- 
>>
>> BR,
>> Denys Pozniak
>>
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org 
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> -- 
> Daniel-Constantin Mierla -- www.asipto.com 
> www.twitter.com/miconda  -- 
> www.linkedin.com/in/miconda 
> Kamailio World Conference - April 27-29, 2020, in Berlin -- 
> www.kamailioworld.com 
>
>
>
> -- 
>
> BR,
> Denys Pozniak
>
>
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - April 27-29, 2020, in Berlin -- 
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] How to use sdp_remove_media() ?

2019-11-01 Thread Denys Pozniak
Got message in debug=3:
*13(2141) ERROR: textopsx [textopsx.c:181]: ki_msg_apply_changes(): invalid
usage - not in request route or a reply*

But definitely msg_apply_changes() is placed in request_route section.
I have just moved code part before calling record_route() function and it
helped.

Interesting, but as I remember Kamailio should display in such cases
something like below:
"...cannot apply msg changes after adding record-route header..."

Thanks for the hint.




пт, 1 нояб. 2019 г. в 11:35, Daniel-Constantin Mierla :

> Hello,
>
> run with debug=3 and what the logs to see if there are error/warning
> messages.
>
> Cheers,
> Daniel
> On 01.11.19 10:26, Denys Pozniak wrote:
>
> Hello!
>
> I'm trying to remove m=video stream from incoming SIP/SDP request in th
> way below:
>
> modparam("rtpengine", "read_sdp_pv", "$avp(read_sdp_pv)")
> modparam("rtpengine", "write_sdp_pv", "$avp(write_sdp_pv)")
> ...
>   sdp_remove_media("video");
>   msg_apply_changes();
>   sdp_get("$avp(read_sdp_pv)");
>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci| rb=/$rb/ \n");
>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci|
> avp(read_sdp_pv)=/$avp(read_sdp_pv)/ \n");
>   rtpengine_manage("$avp(rtpengine_offer)");
>   set_body("$avp(write_sdp_pv)", "application/sdp");
>
> But no luck, xlog shows m=video in $rb and $avp(rtp_sdp_read) as well.
>
> --
>
> BR,
> Denys Pozniak
>
>
>
> ___
> 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
> Kamailio World Conference - April 27-29, 2020, in Berlin -- 
> www.kamailioworld.com
>
>

-- 

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


Re: [SR-Users] Phonenum module

2019-11-01 Thread Igor Olhovskiy
Yes, thanks, adding "+" in a front helps.

I'm ok with overhead, cause need to verify if number is valid as well. 
According to international rules
On Nov 1 2019, at 11:00 am, Daniel-Constantin Mierla  wrote:
>
> Yes, it should be a leading + to make it international, because that number 
> can be a local one in Germany -- in many countries the phone number length 
> can vary, not like in US where is fixed size.
> phonenum has also some overhead if you just want to see if it is a number, 
> maybe next one is better:
> - 
> https://kamailio.org/docs/modules/stable/modules/siputils.html#siputils.f.is_tel_number
>  
> (https://link.getmailspring.com/link/dd175d56-ed77-44fb-9884-10b49b80d...@getmailspring.com/0?redirect=https%3A%2F%2Fkamailio.org%2Fdocs%2Fmodules%2Fstable%2Fmodules%2Fsiputils.html%23siputils.f.is_tel_number=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> Cheers,
> Daniel
>
>
> On 01.11.19 10:55, Igor Olhovskiy wrote:
> >
> > That's the main problem here.
> > I just need to verify, that number came is valid. I don't have any info on 
> > country code (means I can do a sort of regex match, but it will be overkill)
> > But why number is not in international format? Or should I add leading "+"?
> > On Nov 1 2019, at 10:52 am, Daniel-Constantin Mierla  
> > (https://link.getmailspring.com/link/dd175d56-ed77-44fb-9884-10b49b80d...@getmailspring.com/1?redirect=mailto%3Amiconda%40gmail.com=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> >  wrote:
> > >
> > > Hello,
> > > probably you have to use the function that has the country code:
> > > - 
> > > https://kamailio.org/docs/modules/stable/modules/phonenum.html#phonenum.f.phonenum_match_cn
> > >  
> > > (https://link.getmailspring.com/link/dd175d56-ed77-44fb-9884-10b49b80d...@getmailspring.com/2?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F8DDF8210-B25C-424B-8A27-045E24988840%40getmailspring.com%2F0%3Fredirect%3Dhttps%253A%252F%252Fkamailio.org%252Fdocs%252Fmodules%252Fstable%252Fmodules%252Fphonenum.html%2523phonenum.f.phonenum_match_cn%26recipient%3DbWljb25kYUBnbWFpbC5jb20%253D=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> > > Because the number is not in international format.
> > > Cheers,
> > > Daniel
> > >
> > >
> > > On 01.11.19 10:42, Igor Olhovskiy wrote:
> > > >
> > > > Tried with doublequotes and without em.
> > > > Log string is only
> > > > kamailio_1 | 10(17) exec: *** cfgtrace:request_route=[INITIAL_CHECK] 
> > > > c=[/etc/kamailio/kamailio.cfg] l=640 a=16 n=if
> > > > kamailio_1 | 9(16) DEBUG: phonenum [phonenum_pv.c:332]: 
> > > > phonenum_update_pv(): phonenum PV updated for: 380442459966 
> > > > (0/none/Parsing number failed)
> > > > kamailio_1 | 9(16) exec: *** cfgtrace:request_route=[INITIAL_CHECK] 
> > > > c=[/etc/kamailio/kamailio.cfg] l=669 a=16 n=if
> > > > kamailio_1 | 9(16) exec: *** cfgtrace:request_route=[INITIAL_CHECK] 
> > > > c=[/etc/kamailio/kamailio.cfg] l=665 a=26 n=send_reply
> > > >
> > > > On Nov 1 2019, at 10:31 am, Daniel-Constantin Mierla 
> > > >  
> > > > (https://link.getmailspring.com/link/dd175d56-ed77-44fb-9884-10b49b80d...@getmailspring.com/3?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F8DDF8210-B25C-424B-8A27-045E24988840%40getmailspring.com%2F1%3Fredirect%3Dmailto%253Amiconda%2540gmail.com%26recipient%3DbWljb25kYUBnbWFpbC5jb20%253D=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> > > >  wrote:
> > > > >
> > > > > Hello,
> > > > > can you try with the first parameter in between double quotes ("$fU")?
> > > > > Otherwise, set debug=3 and provide all log messages printed by 
> > > > > kamailio when executing the phonenum_match() function.
> > > > > Cheers,
> > > > > Daniel
> > > > >
> > > > >
> > > > > On 01.11.19 10:10, Igor Olhovskiy wrote:
> > > > > >
> > > > > > Hi!
> > > > > > I'm playing around libphonenum to get validation accross e.164 
> > > > > > numbers.
> > > > > >
> > > > > > So, idea is simple
> > > > > > if (phonenum_match($fU, "src_num")) {
> > > > > > if ($phn(src_num=>valid) != 1) {
> > > > > > send_reply("400", "Invalid e.164 format");
> > > > > > xlog("L_ALERT","ALERT: FU: $fU is not e.164 number 
> > > > > > $phn(src_num=>error)\n");
> > > > > > exit;
> > > > > > }
> > > > > > }
> > > > > >
> > > > > > But on every (actually valid e.164 number like 380442459966 or 
> > > > > > 61388141397) I got Parsing number failed in error result.
> > > > > > Tried both phonenum_match($fU, "src_num") and phonenum_match("$fU", 
> > > > > > "src_num")
> > > > > > Actually phonenum_match("380442459966", "src_num") also not working
> > > > > > Debian 10 Buster
> > > > > > version: kamailio 5.2.5 (x86_64/linux)
> > > > > > libphonenumber7 is already the newest version (7.1.0-5+b4).
> > > > > >
> > > > > > ___
> > > > > > Kamailio (SER) - Users Mailing List
> > > > > > sr-users@lists.kamailio.org 
> > > > > > 

Re: [SR-Users] Phonenum module

2019-11-01 Thread Daniel-Constantin Mierla
Yes, it should be a leading + to make it international, because that
number can be a local one in Germany -- in many countries the phone
number length can vary, not like in US where is fixed size.

phonenum has also some overhead if you just want to see if it is a
number, maybe next one is better:

  -
https://kamailio.org/docs/modules/stable/modules/siputils.html#siputils.f.is_tel_number

Cheers,
Daniel

On 01.11.19 10:55, Igor Olhovskiy wrote:
> That's the main problem here.
>
> I just need to verify, that number came is valid. I don't have any
> info on country code (means I can do a sort of regex match, but it
> will be overkill)
>
> But why number is not in international format? Or should I add leading
> "+"?
>
> On Nov 1 2019, at 10:52 am, Daniel-Constantin Mierla
>  wrote:
>
>
> Hello,
>
> probably you have to use the function that has the country code:
>
>   -
> 
> https://kamailio.org/docs/modules/stable/modules/phonenum.html#phonenum.f.phonenum_match_cn
> 
> 
>
> Because the number is not in international format.
>
> Cheers,
> Daniel
>
> On 01.11.19 10:42, Igor Olhovskiy wrote:
>
>
> Tried with doublequotes and without em.
>
> Log string is only
> kamailio_1    | 10(17) exec: ***
> cfgtrace:request_route=[INITIAL_CHECK]
> c=[/etc/kamailio/kamailio.cfg] l=640 a=16 n=if
> kamailio_1    |  9(16) DEBUG: phonenum [phonenum_pv.c:332]:
> phonenum_update_pv(): phonenum PV updated for: 380442459966
> (0/none/Parsing number failed)
> kamailio_1    |  9(16) exec: ***
> cfgtrace:request_route=[INITIAL_CHECK]
> c=[/etc/kamailio/kamailio.cfg] l=669 a=16 n=if
> kamailio_1    |  9(16) exec: ***
> cfgtrace:request_route=[INITIAL_CHECK]
> c=[/etc/kamailio/kamailio.cfg] l=665 a=26 n=send_reply
>
> On Nov 1 2019, at 10:31 am, Daniel-Constantin Mierla
> 
> 
> 
> wrote:
>
>
> Hello,
>
> can you try with the first parameter in between double
> quotes ("$fU")?
>
> Otherwise, set debug=3 and provide all log messages
> printed by kamailio when executing the phonenum_match()
> function.
>
> Cheers,
> Daniel
>
> On 01.11.19 10:10, Igor Olhovskiy wrote:
>
>
> Hi!
>
> I'm playing around libphonenum to get validation
> accross e.164 numbers.
>
>
> So, idea is simple
> if (phonenum_match($fU, "src_num")) {
>     if ($phn(src_num=>valid) != 1) {
>     send_reply("400", "Invalid e.164 format");
>     xlog("L_ALERT","ALERT: FU: $fU is not
> e.164 number $phn(src_num=>error)\n");
>     exit;
>     }
> }
>
> But on every (actually valid e.164 number like
> 380442459966 or 61388141397) I got  Parsing number
> failed in error result.
>
> Tried both phonenum_match($fU, "src_num")
> andphonenum_match("$fU", "src_num")
>
> Actually phonenum_match("380442459966", "src_num")
> also not working
>
> Debian 10 Buster
> version: kamailio 5.2.5 (x86_64/linux)
> libphonenumber7 is already the newest version
> (7.1.0-5+b4).
>
> |
>
> |___
> Kamailio (SER) - Users Mailing List 
> ||sr-users@lists.kamailio.org
> 
> ||https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 
> |
>
> |
>
> |
>
> |-- 

Re: [SR-Users] Phonenum module

2019-11-01 Thread Igor Olhovskiy
That's the main problem here.

I just need to verify, that number came is valid. I don't have any info on 
country code (means I can do a sort of regex match, but it will be overkill)
But why number is not in international format? Or should I add leading "+"?
On Nov 1 2019, at 10:52 am, Daniel-Constantin Mierla  wrote:
>
> Hello,
> probably you have to use the function that has the country code:
> - 
> https://kamailio.org/docs/modules/stable/modules/phonenum.html#phonenum.f.phonenum_match_cn
>  
> (https://link.getmailspring.com/link/8ddf8210-b25c-424b-8a27-045e24988...@getmailspring.com/0?redirect=https%3A%2F%2Fkamailio.org%2Fdocs%2Fmodules%2Fstable%2Fmodules%2Fphonenum.html%23phonenum.f.phonenum_match_cn=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> Because the number is not in international format.
> Cheers,
> Daniel
>
>
> On 01.11.19 10:42, Igor Olhovskiy wrote:
> >
> > Tried with doublequotes and without em.
> > Log string is only
> > kamailio_1 | 10(17) exec: *** cfgtrace:request_route=[INITIAL_CHECK] 
> > c=[/etc/kamailio/kamailio.cfg] l=640 a=16 n=if
> > kamailio_1 | 9(16) DEBUG: phonenum [phonenum_pv.c:332]: 
> > phonenum_update_pv(): phonenum PV updated for: 380442459966 (0/none/Parsing 
> > number failed)
> > kamailio_1 | 9(16) exec: *** cfgtrace:request_route=[INITIAL_CHECK] 
> > c=[/etc/kamailio/kamailio.cfg] l=669 a=16 n=if
> > kamailio_1 | 9(16) exec: *** cfgtrace:request_route=[INITIAL_CHECK] 
> > c=[/etc/kamailio/kamailio.cfg] l=665 a=26 n=send_reply
> >
> > On Nov 1 2019, at 10:31 am, Daniel-Constantin Mierla  
> > (https://link.getmailspring.com/link/8ddf8210-b25c-424b-8a27-045e24988...@getmailspring.com/1?redirect=mailto%3Amiconda%40gmail.com=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> >  wrote:
> > >
> > > Hello,
> > > can you try with the first parameter in between double quotes ("$fU")?
> > > Otherwise, set debug=3 and provide all log messages printed by kamailio 
> > > when executing the phonenum_match() function.
> > > Cheers,
> > > Daniel
> > >
> > >
> > > On 01.11.19 10:10, Igor Olhovskiy wrote:
> > > >
> > > > Hi!
> > > > I'm playing around libphonenum to get validation accross e.164 numbers.
> > > >
> > > > So, idea is simple
> > > > if (phonenum_match($fU, "src_num")) {
> > > > if ($phn(src_num=>valid) != 1) {
> > > > send_reply("400", "Invalid e.164 format");
> > > > xlog("L_ALERT","ALERT: FU: $fU is not e.164 number 
> > > > $phn(src_num=>error)\n");
> > > > exit;
> > > > }
> > > > }
> > > >
> > > > But on every (actually valid e.164 number like 380442459966 or 
> > > > 61388141397) I got Parsing number failed in error result.
> > > > Tried both phonenum_match($fU, "src_num") and phonenum_match("$fU", 
> > > > "src_num")
> > > > Actually phonenum_match("380442459966", "src_num") also not working
> > > > Debian 10 Buster
> > > > version: kamailio 5.2.5 (x86_64/linux)
> > > > libphonenumber7 is already the newest version (7.1.0-5+b4).
> > > >
> > > > ___
> > > > Kamailio (SER) - Users Mailing List
> > > > sr-users@lists.kamailio.org 
> > > > (https://link.getmailspring.com/link/8ddf8210-b25c-424b-8a27-045e24988...@getmailspring.com/2?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F1D1DF284-F963-4251-A8F1-C242A43A8ABF%40getmailspring.com%2F0%3Fredirect%3Dmailto%253Asr-users%2540lists.kamailio.org%26recipient%3DbWljb25kYUBnbWFpbC5jb20%253D=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> > > >  
> > > > (https://link.getmailspring.com/link/8ddf8210-b25c-424b-8a27-045e24988...@getmailspring.com/3?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F1D1DF284-F963-4251-A8F1-C242A43A8ABF%40getmailspring.com%2F1%3Fredirect%3Dhttps%253A%252F%252Flists.kamailio.org%252Fcgi-bin%252Fmailman%252Flistinfo%252Fsr-users%26recipient%3DbWljb25kYUBnbWFpbC5jb20%253D=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> > > --
> > > Daniel-Constantin Mierla -- www.asipto.com 
> > > (https://link.getmailspring.com/link/8ddf8210-b25c-424b-8a27-045e24988...@getmailspring.com/4?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F1D1DF284-F963-4251-A8F1-C242A43A8ABF%40getmailspring.com%2F2%3Fredirect%3Dhttp%253A%252F%252Fwww.asipto.com%26recipient%3DbWljb25kYUBnbWFpbC5jb20%253D=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)www.twitter.com/miconda
> > >  
> > > (https://link.getmailspring.com/link/8ddf8210-b25c-424b-8a27-045e24988...@getmailspring.com/5?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F1D1DF284-F963-4251-A8F1-C242A43A8ABF%40getmailspring.com%2F3%3Fredirect%3Dhttp%253A%252F%252Fwww.twitter.com%252Fmiconda%26recipient%3DbWljb25kYUBnbWFpbC5jb20%253D=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> > >  -- www.linkedin.com/in/miconda 
> > > (https://link.getmailspring.com/link/8ddf8210-b25c-424b-8a27-045e24988...@getmailspring.com/6?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F1D1DF284-F963-4251-A8F1-C242A43A8ABF%

Re: [SR-Users] Phonenum module

2019-11-01 Thread Daniel-Constantin Mierla
Hello,

probably you have to use the function that has the country code:

  -
https://kamailio.org/docs/modules/stable/modules/phonenum.html#phonenum.f.phonenum_match_cn

Because the number is not in international format.

Cheers,
Daniel

On 01.11.19 10:42, Igor Olhovskiy wrote:
> Tried with doublequotes and without em.
>
> Log string is only
> kamailio_1    | 10(17) exec: ***
> cfgtrace:request_route=[INITIAL_CHECK] c=[/etc/kamailio/kamailio.cfg]
> l=640 a=16 n=if
> kamailio_1    |  9(16) DEBUG: phonenum [phonenum_pv.c:332]:
> phonenum_update_pv(): phonenum PV updated for: 380442459966
> (0/none/Parsing number failed)
> kamailio_1    |  9(16) exec: ***
> cfgtrace:request_route=[INITIAL_CHECK] c=[/etc/kamailio/kamailio.cfg]
> l=669 a=16 n=if
> kamailio_1    |  9(16) exec: ***
> cfgtrace:request_route=[INITIAL_CHECK] c=[/etc/kamailio/kamailio.cfg]
> l=665 a=26 n=send_reply
>
> On Nov 1 2019, at 10:31 am, Daniel-Constantin Mierla
>  wrote:
>
>
> Hello,
>
> can you try with the first parameter in between double quotes ("$fU")?
>
> Otherwise, set debug=3 and provide all log messages printed by
> kamailio when executing the phonenum_match() function.
>
> Cheers,
> Daniel
>
> On 01.11.19 10:10, Igor Olhovskiy wrote:
>
>
> Hi!
>
> I'm playing around libphonenum to get validation accross e.164
> numbers.
>
>
> So, idea is simple
> if (phonenum_match($fU, "src_num")) {
>     if ($phn(src_num=>valid) != 1) {
>     send_reply("400", "Invalid e.164 format");
>     xlog("L_ALERT","ALERT: FU: $fU is not e.164 number
> $phn(src_num=>error)\n");
>     exit;
>     }
> }
>
> But on every (actually valid e.164 number like 380442459966 or
> 61388141397) I got  Parsing number failed in error result.
>
> Tried both phonenum_match($fU, "src_num")
> andphonenum_match("$fU", "src_num")
>
> Actually phonenum_match("380442459966", "src_num") also not
> working
>
> Debian 10 Buster
> version: kamailio 5.2.5 (x86_64/linux)
> libphonenumber7 is already the newest version (7.1.0-5+b4).
>
> |
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org 
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>  
> 
>
> |
>
> |
>
> -- 
> Daniel-Constantin Mierla -- www.asipto.com 
> www.twitter.com/miconda
>  
> 
>  -- www.linkedin.com/in/miconda 
> 
> Kamailio World Conference - April 27-29, 2020, in Berlin -- 
> www.kamailioworld.com 
> 
>
> |
>
> Sent from Mailspring 

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - April 27-29, 2020, in Berlin -- 
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] How to use sdp_remove_media() ?

2019-11-01 Thread Daniel-Constantin Mierla
This was obviously a response on the wrong thread.


On 01.11.19 10:49, Daniel-Constantin Mierla wrote:
>
> Hello,
>
> probably you have to use the function that has the country code:
>
>   -
> https://kamailio.org/docs/modules/stable/modules/phonenum.html#phonenum.f.phonenum_match_cn
>
> Because the number is not in international format.
>
> Cheers,
> Daniel
>
> On 01.11.19 10:35, Daniel-Constantin Mierla wrote:
>>
>> Hello,
>>
>> run with debug=3 and what the logs to see if there are error/warning
>> messages.
>>
>> Cheers,
>> Daniel
>>
>> On 01.11.19 10:26, Denys Pozniak wrote:
>>> Hello!
>>>
>>> I'm trying to remove m=video stream from incoming SIP/SDP request in
>>> th way below:
>>>
>>> modparam("rtpengine", "read_sdp_pv", "$avp(read_sdp_pv)")
>>> modparam("rtpengine", "write_sdp_pv", "$avp(write_sdp_pv)")
>>> ...
>>>   sdp_remove_media("video");
>>>   msg_apply_changes();
>>>   sdp_get("$avp(read_sdp_pv)");
>>>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci| rb=/$rb/ \n");
>>>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci|
>>> avp(read_sdp_pv)=/$avp(read_sdp_pv)/ \n");
>>>   rtpengine_manage("$avp(rtpengine_offer)");
>>>   set_body("$avp(write_sdp_pv)", "application/sdp");
>>>
>>> But no luck, xlog shows m=video in $rb and $avp(rtp_sdp_read) as well.
>>>
>>> -- 
>>>
>>> BR,
>>> Denys Pozniak
>>>
>>>
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> -- 
>> Daniel-Constantin Mierla -- www.asipto.com
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio World Conference - April 27-29, 2020, in Berlin -- 
>> www.kamailioworld.com
> -- 
> Daniel-Constantin Mierla -- www.asipto.com
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio World Conference - April 27-29, 2020, in Berlin -- 
> www.kamailioworld.com

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - April 27-29, 2020, in Berlin -- 
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] How to use sdp_remove_media() ?

2019-11-01 Thread Daniel-Constantin Mierla
Hello,

probably you have to use the function that has the country code:

  -
https://kamailio.org/docs/modules/stable/modules/phonenum.html#phonenum.f.phonenum_match_cn

Because the number is not in international format.

Cheers,
Daniel

On 01.11.19 10:35, Daniel-Constantin Mierla wrote:
>
> Hello,
>
> run with debug=3 and what the logs to see if there are error/warning
> messages.
>
> Cheers,
> Daniel
>
> On 01.11.19 10:26, Denys Pozniak wrote:
>> Hello!
>>
>> I'm trying to remove m=video stream from incoming SIP/SDP request in
>> th way below:
>>
>> modparam("rtpengine", "read_sdp_pv", "$avp(read_sdp_pv)")
>> modparam("rtpengine", "write_sdp_pv", "$avp(write_sdp_pv)")
>> ...
>>   sdp_remove_media("video");
>>   msg_apply_changes();
>>   sdp_get("$avp(read_sdp_pv)");
>>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci| rb=/$rb/ \n");
>>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci|
>> avp(read_sdp_pv)=/$avp(read_sdp_pv)/ \n");
>>   rtpengine_manage("$avp(rtpengine_offer)");
>>   set_body("$avp(write_sdp_pv)", "application/sdp");
>>
>> But no luck, xlog shows m=video in $rb and $avp(rtp_sdp_read) as well.
>>
>> -- 
>>
>> BR,
>> Denys Pozniak
>>
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> -- 
> Daniel-Constantin Mierla -- www.asipto.com
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio World Conference - April 27-29, 2020, in Berlin -- 
> www.kamailioworld.com

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - April 27-29, 2020, in Berlin -- 
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] Phonenum module

2019-11-01 Thread Igor Olhovskiy
Tried with doublequotes and without em.

Log string is only
kamailio_1 | 10(17) exec: *** cfgtrace:request_route=[INITIAL_CHECK] 
c=[/etc/kamailio/kamailio.cfg] l=640 a=16 n=if
kamailio_1 | 9(16) DEBUG: phonenum [phonenum_pv.c:332]: phonenum_update_pv(): 
phonenum PV updated for: 380442459966 (0/none/Parsing number failed)
kamailio_1 | 9(16) exec: *** cfgtrace:request_route=[INITIAL_CHECK] 
c=[/etc/kamailio/kamailio.cfg] l=669 a=16 n=if
kamailio_1 | 9(16) exec: *** cfgtrace:request_route=[INITIAL_CHECK] 
c=[/etc/kamailio/kamailio.cfg] l=665 a=26 n=send_reply

On Nov 1 2019, at 10:31 am, Daniel-Constantin Mierla  wrote:
>
> Hello,
> can you try with the first parameter in between double quotes ("$fU")?
> Otherwise, set debug=3 and provide all log messages printed by kamailio when 
> executing the phonenum_match() function.
> Cheers,
> Daniel
>
>
> On 01.11.19 10:10, Igor Olhovskiy wrote:
> >
> > Hi!
> > I'm playing around libphonenum to get validation accross e.164 numbers.
> >
> > So, idea is simple
> > if (phonenum_match($fU, "src_num")) {
> > if ($phn(src_num=>valid) != 1) {
> > send_reply("400", "Invalid e.164 format");
> > xlog("L_ALERT","ALERT: FU: $fU is not e.164 number $phn(src_num=>error)\n");
> > exit;
> > }
> > }
> >
> > But on every (actually valid e.164 number like 380442459966 or 61388141397) 
> > I got Parsing number failed in error result.
> > Tried both phonenum_match($fU, "src_num") and phonenum_match("$fU", 
> > "src_num")
> > Actually phonenum_match("380442459966", "src_num") also not working
> > Debian 10 Buster
> > version: kamailio 5.2.5 (x86_64/linux)
> > libphonenumber7 is already the newest version (7.1.0-5+b4).
> >
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org 
> > (https://link.getmailspring.com/link/1d1df284-f963-4251-a8f1-c242a43a8...@getmailspring.com/0?redirect=mailto%3Asr-users%40lists.kamailio.org=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> >  
> > (https://link.getmailspring.com/link/1d1df284-f963-4251-a8f1-c242a43a8...@getmailspring.com/1?redirect=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> --
> Daniel-Constantin Mierla -- www.asipto.com 
> (https://link.getmailspring.com/link/1d1df284-f963-4251-a8f1-c242a43a8...@getmailspring.com/2?redirect=http%3A%2F%2Fwww.asipto.com=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)www.twitter.com/miconda
>  
> (https://link.getmailspring.com/link/1d1df284-f963-4251-a8f1-c242a43a8...@getmailspring.com/3?redirect=http%3A%2F%2Fwww.twitter.com%2Fmiconda=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
>  -- www.linkedin.com/in/miconda 
> (https://link.getmailspring.com/link/1d1df284-f963-4251-a8f1-c242a43a8...@getmailspring.com/4?redirect=http%3A%2F%2Fwww.linkedin.com%2Fin%2Fmiconda=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)
> Kamailio World Conference - April 27-29, 2020, in Berlin -- 
> www.kamailioworld.com 
> (https://link.getmailspring.com/link/1d1df284-f963-4251-a8f1-c242a43a8...@getmailspring.com/5?redirect=http%3A%2F%2Fwww.kamailioworld.com=c3ItdXNlcnNAbGlzdHMua2FtYWlsaW8ub3Jn)___
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 use sdp_remove_media() ?

2019-11-01 Thread Daniel-Constantin Mierla
Hello,

run with debug=3 and what the logs to see if there are error/warning
messages.

Cheers,
Daniel

On 01.11.19 10:26, Denys Pozniak wrote:
> Hello!
>
> I'm trying to remove m=video stream from incoming SIP/SDP request in
> th way below:
>
> modparam("rtpengine", "read_sdp_pv", "$avp(read_sdp_pv)")
> modparam("rtpengine", "write_sdp_pv", "$avp(write_sdp_pv)")
> ...
>   sdp_remove_media("video");
>   msg_apply_changes();
>   sdp_get("$avp(read_sdp_pv)");
>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci| rb=/$rb/ \n");
>   xlog("L_WARN","[$cfg(route)] *m=video removed* ci|
> avp(read_sdp_pv)=/$avp(read_sdp_pv)/ \n");
>   rtpengine_manage("$avp(rtpengine_offer)");
>   set_body("$avp(write_sdp_pv)", "application/sdp");
>
> But no luck, xlog shows m=video in $rb and $avp(rtp_sdp_read) as well.
>
> -- 
>
> BR,
> Denys Pozniak
>
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - April 27-29, 2020, in Berlin -- 
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] Phonenum module

2019-11-01 Thread Daniel-Constantin Mierla
Hello,

can you try with the first parameter in between double quotes ("$fU")?

Otherwise, set debug=3 and provide all log messages printed by kamailio
when executing the phonenum_match() function.

Cheers,
Daniel

On 01.11.19 10:10, Igor Olhovskiy wrote:
> Hi!
>
> I'm playing around libphonenum to get validation accross e.164 numbers.
>
>
> So, idea is simple
> if (phonenum_match($fU, "src_num")) {
>     if ($phn(src_num=>valid) != 1) {
>     send_reply("400", "Invalid e.164 format");
>     xlog("L_ALERT","ALERT: FU: $fU is not e.164 number
> $phn(src_num=>error)\n");
>     exit;
>     }
> }
>
> But on every (actually valid e.164 number like 380442459966 or
> 61388141397) I got  Parsing number failed in error result.
>
> Tried both phonenum_match($fU, "src_num") andphonenum_match("$fU",
> "src_num")
>
> Actually phonenum_match("380442459966", "src_num") also not working
>
> Debian 10 Buster
> version: kamailio 5.2.5 (x86_64/linux)
> libphonenumber7 is already the newest version (7.1.0-5+b4).
> Sent from Mailspring
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - April 27-29, 2020, in Berlin -- 
www.kamailioworld.com

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


[SR-Users] How to use sdp_remove_media() ?

2019-11-01 Thread Denys Pozniak
Hello!

I'm trying to remove m=video stream from incoming SIP/SDP request in th way
below:

modparam("rtpengine", "read_sdp_pv", "$avp(read_sdp_pv)")
modparam("rtpengine", "write_sdp_pv", "$avp(write_sdp_pv)")
...
  sdp_remove_media("video");
  msg_apply_changes();
  sdp_get("$avp(read_sdp_pv)");
  xlog("L_WARN","[$cfg(route)] *m=video removed* ci| rb=/$rb/ \n");
  xlog("L_WARN","[$cfg(route)] *m=video removed* ci|
avp(read_sdp_pv)=/$avp(read_sdp_pv)/ \n");
  rtpengine_manage("$avp(rtpengine_offer)");
  set_body("$avp(write_sdp_pv)", "application/sdp");

But no luck, xlog shows m=video in $rb and $avp(rtp_sdp_read) as well.

-- 

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


[SR-Users] Phonenum module

2019-11-01 Thread Igor Olhovskiy
Hi!

I'm playing around libphonenum to get validation accross e.164 numbers.

So, idea is simple
if (phonenum_match($fU, "src_num")) {
if ($phn(src_num=>valid) != 1) {
send_reply("400", "Invalid e.164 format");
xlog("L_ALERT","ALERT: FU: $fU is not e.164 number $phn(src_num=>error)\n");
exit;
}
}

But on every (actually valid e.164 number like 380442459966 or 61388141397) I 
got Parsing number failed in error result.
Tried both phonenum_match($fU, "src_num") and phonenum_match("$fU", "src_num")
Actually phonenum_match("380442459966", "src_num") also not working
Debian 10 Buster
version: kamailio 5.2.5 (x86_64/linux)
libphonenumber7 is already the newest version (7.1.0-5+b4).
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio on kubernetes

2019-11-01 Thread Sergey Safarov
This will work if you get static IP for kubernetes host.

https://github.com/kubernetes/kubernetes/issues/80122
https://github.com/aws/amazon-vpc-cni-k8s/issues/652
https://github.com/cbeneke/hcloud-fip-controller
https://docs.projectcalico.org/v3.10/networking/add-floating-ip

And then start kamailio container with host network

Also you can customize kubernetes nodegroup init scripts or image to
assign static IP at node boot procedure.
As example assign network interface with preconfigured private IP and
elastic for Amazon cloud.
https://github.com/awslabs/amazon-eks-ami
https://github.com/kamailio/kamailio/issues/2109

Sergey

On Fri, Nov 1, 2019 at 9:46 AM Gaurav Bmotra 
wrote:

> hello
> everyone i m working on a project kamailio on kubernetes
> for high availability and auto scalability
> but as i  m able to run it in side the cluster with using kubenetes
> feature
> but having issue to access the service form outside the cluster
>
> i m using the ingress in kubernetse to point  the service
> its flow like that
>
> domain.com:80
> --ingress-controlerkamailio-service:80:5060---
> POD(kamailio)5060
> ISSUE IS I M NOT GETING CONNECTION BITWEEN DOMAIN.COM TO POD(kamailio)
> is there any one ho can help me in this
>
> 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
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] kamailio on kubernetes

2019-11-01 Thread Gaurav Bmotra
hello
everyone i m working on a project kamailio on kubernetes
for high availability and auto scalability
but as i  m able to run it in side the cluster with using kubenetes feature
but having issue to access the service form outside the cluster

i m using the ingress in kubernetse to point  the service
its flow like that

domain.com:80
--ingress-controlerkamailio-service:80:5060---
POD(kamailio)5060
ISSUE IS I M NOT GETING CONNECTION BITWEEN DOMAIN.COM TO POD(kamailio)
is there any one ho can help me in this

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