[SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Yuriy Gorlichenko
Hi
I'm building some system with failover trunk
but my providers requires to set their doamin in domain part of To Header

so when I rewrite it at the my failure_route

$td = FAILOVER_PROVIDER
my To filed looks like
To: 
what i tried:
Move this change to BRANCH_ROUTE:
here tried as
$td =  as
uac_replace_to('',"newToFieldValue)

Move to the my custom route with both variants
But result is the same
kamailio 5.1

version: kamailio 5.1.5 (x86_64/linux) d06080
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024,
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: d06080
compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Mojtaba
The $td is read-only variable, and yoou could not change it's value.
If you want to change domain in To header, You should use testops
module in kamialio and replace domain in To header. for example:
subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
With Regards.Mojtaba

On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko  wrote:
>
> Hi
> I'm building some system with failover trunk
> but my providers requires to set their doamin in domain part of To Header
>
> so when I rewrite it at the my failure_route
>
> $td = FAILOVER_PROVIDER
> my To filed looks like
> To: 
> what i tried:
> Move this change to BRANCH_ROUTE:
> here tried as
> $td =  as
> uac_replace_to('',"newToFieldValue)
>
> Move to the my custom route with both variants
> But result is the same
> kamailio 5.1
>
> version: kamailio 5.1.5 (x86_64/linux) d06080
> flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 
> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, 
> Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, 
> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, 
> USE_DST_BLACKLIST, HAVE_RESOLV_RES
> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, 
> BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> id: d06080
> compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



-- 
--Mojtaba Esfandiari.S

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


Re: [SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Yuriy Gorlichenko
But I rewrites succesfully with request_route Flow.
Im rewriting it with out any issues

пн, 17 сент. 2018 г., 12:23 Mojtaba :

> The $td is read-only variable, and yoou could not change it's value.
> If you want to change domain in To header, You should use testops
> module in kamialio and replace domain in To header. for example:
> subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
> With Regards.Mojtaba
>
> On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko 
> wrote:
> >
> > Hi
> > I'm building some system with failover trunk
> > but my providers requires to set their doamin in domain part of To Header
> >
> > so when I rewrite it at the my failure_route
> >
> > $td = FAILOVER_PROVIDER
> > my To filed looks like
> > To: 
> > what i tried:
> > Move this change to BRANCH_ROUTE:
> > here tried as
> > $td =  as
> > uac_replace_to('',"newToFieldValue)
> >
> > Move to the my custom route with both variants
> > But result is the same
> > kamailio 5.1
> >
> > version: kamailio 5.1.5 (x86_64/linux) d06080
> > flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS,
> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
> Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
> USE_DST_BLACKLIST, HAVE_RESOLV_RES
> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024,
> BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> > id: d06080
> > compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> --
> --Mojtaba Esfandiari.S
>
> ___
> 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] issue with rewrite to domain in failure route

2018-09-17 Thread Alex Balashov
That is not a safe way to change the To header, since proxies aren't supposed 
to modify the To or From headers. 

The proper approach conceals the fact that modifications have taken place from 
the caller:

https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.f.uac_replace_to

--
Sent from mobile. Apologies for brevity and errors. 

-Original Message-
From: Mojtaba 
To: "Kamailio (SER) - Users Mailing List" 
Sent: Mon, 17 Sep 2018 5:23 AM
Subject: Re: [SR-Users] issue with rewrite to domain in failure route

The $td is read-only variable, and yoou could not change it's value.
If you want to change domain in To header, You should use testops
module in kamialio and replace domain in To header. for example:
subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
With Regards.Mojtaba

On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko  wrote:
>
> Hi
> I'm building some system with failover trunk
> but my providers requires to set their doamin in domain part of To Header
>
> so when I rewrite it at the my failure_route
>
> $td = FAILOVER_PROVIDER
> my To filed looks like
> To: 
> what i tried:
> Move this change to BRANCH_ROUTE:
> here tried as
> $td =  as
> uac_replace_to('',"newToFieldValue)
>
> Move to the my custom route with both variants
> But result is the same
> kamailio 5.1
>
> version: kamailio 5.1.5 (x86_64/linux) d06080
> flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 
> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, 
> Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, 
> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, 
> USE_DST_BLACKLIST, HAVE_RESOLV_RES
> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, 
> BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> id: d06080
> compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



-- 
--Mojtaba Esfandiari.S

___
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] issue with rewrite to domain in failure route

2018-09-17 Thread Yuriy Gorlichenko
I tried uac_replace_to()
But no luck

пн, 17 сент. 2018 г. в 12:28, Alex Balashov :

> That is not a safe way to change the To header, since proxies aren't
> supposed to modify the To or From headers.
>
> The proper approach conceals the fact that modifications have taken place
> from the caller:
>
>
> https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.f.uac_replace_to
>
> --
> Sent from mobile. Apologies for brevity and errors.
>
> -Original Message-
> From: Mojtaba 
> To: "Kamailio (SER) - Users Mailing List" 
> Sent: Mon, 17 Sep 2018 5:23 AM
> Subject: Re: [SR-Users] issue with rewrite to domain in failure route
>
> The $td is read-only variable, and yoou could not change it's value.
> If you want to change domain in To header, You should use testops
> module in kamialio and replace domain in To header. for example:
> subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
> With Regards.Mojtaba
>
> On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko 
> wrote:
> >
> > Hi
> > I'm building some system with failover trunk
> > but my providers requires to set their doamin in domain part of To Header
> >
> > so when I rewrite it at the my failure_route
> >
> > $td = FAILOVER_PROVIDER
> > my To filed looks like
> > To: 
> > what i tried:
> > Move this change to BRANCH_ROUTE:
> > here tried as
> > $td =  as
> > uac_replace_to('',"newToFieldValue)
> >
> > Move to the my custom route with both variants
> > But result is the same
> > kamailio 5.1
> >
> > version: kamailio 5.1.5 (x86_64/linux) d06080
> > flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS,
> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
> Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
> USE_DST_BLACKLIST, HAVE_RESOLV_RES
> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024,
> BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> > id: d06080
> > compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> --
> --Mojtaba Esfandiari.S
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Incoming call on Kamailio WebRTC

2018-09-17 Thread Adesh Pandey
Hi All,
We are trying to setup WebRTC with Kamailio as sip registrar and
dispatcher. We have succeed for outgoing calls but cannot attend incoming
calls to the Kamailio. It would be a great help if someone can provide a
sample config for webrtc + kamailio or blog for the same.

Thanking you all
-- 

Adesh Pandey

Sr. Software Developer
[image: phone]

+91 92129 92129 Ext: 56
[image: moible]

+91 8527384897
[image: Profile Pic]

[image: Facebook] [image: Twitter]
[image: Twitter]
[image: Linkedin]
[image: Google+]

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


Re: [SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Sergiu Pojoga
>From which route are you calling uac_replace_to(), failure_route?

"This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE"

On Mon, Sep 17, 2018 at 6:05 AM Yuriy Gorlichenko 
wrote:

> I tried uac_replace_to()
> But no luck
>
> пн, 17 сент. 2018 г. в 12:28, Alex Balashov :
>
>> That is not a safe way to change the To header, since proxies aren't
>> supposed to modify the To or From headers.
>>
>> The proper approach conceals the fact that modifications have taken place
>> from the caller:
>>
>>
>> https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.f.uac_replace_to
>>
>> --
>> Sent from mobile. Apologies for brevity and errors.
>>
>> -Original Message-
>> From: Mojtaba 
>> To: "Kamailio (SER) - Users Mailing List" 
>> Sent: Mon, 17 Sep 2018 5:23 AM
>> Subject: Re: [SR-Users] issue with rewrite to domain in failure route
>>
>> The $td is read-only variable, and yoou could not change it's value.
>> If you want to change domain in To header, You should use testops
>> module in kamialio and replace domain in To header. for example:
>> subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
>> With Regards.Mojtaba
>>
>> On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko 
>> wrote:
>> >
>> > Hi
>> > I'm building some system with failover trunk
>> > but my providers requires to set their doamin in domain part of To
>> Header
>> >
>> > so when I rewrite it at the my failure_route
>> >
>> > $td = FAILOVER_PROVIDER
>> > my To filed looks like
>> > To: 
>> > what i tried:
>> > Move this change to BRANCH_ROUTE:
>> > here tried as
>> > $td =  as
>> > uac_replace_to('',"newToFieldValue)
>> >
>> > Move to the my custom route with both variants
>> > But result is the same
>> > kamailio 5.1
>> >
>> > version: kamailio 5.1.5 (x86_64/linux) d06080
>> > flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
>> USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP,
>> PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
>> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
>> USE_DST_BLACKLIST, HAVE_RESOLV_RES
>> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE
>> 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
>> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>> > id: d06080
>> > compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
>> > ___
>> > Kamailio (SER) - Users Mailing List
>> > sr-users@lists.kamailio.org
>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>> --
>> --Mojtaba Esfandiari.S
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Yuriy Gorlichenko
No. Tried from branch route.

пн, 17 сент. 2018 г., 14:25 Sergiu Pojoga :

> From which route are you calling uac_replace_to(), failure_route?
>
> "This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE"
>
> On Mon, Sep 17, 2018 at 6:05 AM Yuriy Gorlichenko 
> wrote:
>
>> I tried uac_replace_to()
>> But no luck
>>
>> пн, 17 сент. 2018 г. в 12:28, Alex Balashov :
>>
>>> That is not a safe way to change the To header, since proxies aren't
>>> supposed to modify the To or From headers.
>>>
>>> The proper approach conceals the fact that modifications have taken
>>> place from the caller:
>>>
>>>
>>> https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.f.uac_replace_to
>>>
>>> --
>>> Sent from mobile. Apologies for brevity and errors.
>>>
>>> -Original Message-
>>> From: Mojtaba 
>>> To: "Kamailio (SER) - Users Mailing List" 
>>> Sent: Mon, 17 Sep 2018 5:23 AM
>>> Subject: Re: [SR-Users] issue with rewrite to domain in failure route
>>>
>>> The $td is read-only variable, and yoou could not change it's value.
>>> If you want to change domain in To header, You should use testops
>>> module in kamialio and replace domain in To header. for example:
>>> subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
>>> With Regards.Mojtaba
>>>
>>> On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko 
>>> wrote:
>>> >
>>> > Hi
>>> > I'm building some system with failover trunk
>>> > but my providers requires to set their doamin in domain part of To
>>> Header
>>> >
>>> > so when I rewrite it at the my failure_route
>>> >
>>> > $td = FAILOVER_PROVIDER
>>> > my To filed looks like
>>> > To: 
>>> > what i tried:
>>> > Move this change to BRANCH_ROUTE:
>>> > here tried as
>>> > $td =  as
>>> > uac_replace_to('',"newToFieldValue)
>>> >
>>> > Move to the my custom route with both variants
>>> > But result is the same
>>> > kamailio 5.1
>>> >
>>> > version: kamailio 5.1.5 (x86_64/linux) d06080
>>> > flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
>>> USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP,
>>> PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
>>> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
>>> USE_DST_BLACKLIST, HAVE_RESOLV_RES
>>> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE
>>> 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
>>> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>>> > id: d06080
>>> > compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
>>> > ___
>>> > Kamailio (SER) - Users Mailing List
>>> > sr-users@lists.kamailio.org
>>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>>
>>> --
>>> --Mojtaba Esfandiari.S
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Sergiu Pojoga
Ok, what are your UAC parameters?

On Mon, Sep 17, 2018 at 7:34 AM Yuriy Gorlichenko 
wrote:

> No. Tried from branch route.
>
> пн, 17 сент. 2018 г., 14:25 Sergiu Pojoga :
>
>> From which route are you calling uac_replace_to(), failure_route?
>>
>> "This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE"
>>
>> On Mon, Sep 17, 2018 at 6:05 AM Yuriy Gorlichenko 
>> wrote:
>>
>>> I tried uac_replace_to()
>>> But no luck
>>>
>>> пн, 17 сент. 2018 г. в 12:28, Alex Balashov :
>>>
 That is not a safe way to change the To header, since proxies aren't
 supposed to modify the To or From headers.

 The proper approach conceals the fact that modifications have taken
 place from the caller:


 https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.f.uac_replace_to

 --
 Sent from mobile. Apologies for brevity and errors.

 -Original Message-
 From: Mojtaba 
 To: "Kamailio (SER) - Users Mailing List" 
 Sent: Mon, 17 Sep 2018 5:23 AM
 Subject: Re: [SR-Users] issue with rewrite to domain in failure route

 The $td is read-only variable, and yoou could not change it's value.
 If you want to change domain in To header, You should use testops
 module in kamialio and replace domain in To header. for example:

 subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
 With Regards.Mojtaba

 On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko 
 wrote:
 >
 > Hi
 > I'm building some system with failover trunk
 > but my providers requires to set their doamin in domain part of To
 Header
 >
 > so when I rewrite it at the my failure_route
 >
 > $td = FAILOVER_PROVIDER
 > my To filed looks like
 > To: 
 > what i tried:
 > Move this change to BRANCH_ROUTE:
 > here tried as
 > $td =  as
 > uac_replace_to('',"newToFieldValue)
 >
 > Move to the my custom route with both variants
 > But result is the same
 > kamailio 5.1
 >
 > version: kamailio 5.1.5 (x86_64/linux) d06080
 > flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
 USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP,
 PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
 FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
 USE_DST_BLACKLIST, HAVE_RESOLV_RES
 > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE
 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
 > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
 > id: d06080
 > compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
 > ___
 > Kamailio (SER) - Users Mailing List
 > sr-users@lists.kamailio.org
 > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



 --
 --Mojtaba Esfandiari.S

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

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

>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> 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] how to catch attacker using bad request line?

2018-09-17 Thread Juha Heinanen
In order to be able to fail2ban an attacker that sends tons of SIP
requests with malformed request lines, it would need to be possible to
generate an appropriate syslog message from config file.

I didn't find any sanity module param value that would turn on checking
of request line syntax.  Any other ideas?

As an example, below is what comes to syslog when I send a request that
has syntax error on request line.

-- Juha

Sep 17 14:46:39 char /usr/bin/sip-proxy[9458]: ERROR:  
[core/parser/msg_parser.c:337]: parse_headers(): bad header field [(null)]
Sep 17 14:46:39 char /usr/bin/sip-proxy[9458]: WARNING:  
[core/receive.c:230]: receive_msg(): parsing relevant headers failed
Sep 17 14:46:43 char /usr/bin/sip-proxy[9458]: ERROR:  
[core/parser/msg_parser.c:337]: parse_headers(): bad header field [(null)]
Sep 17 14:46:43 char /usr/bin/sip-proxy[9458]: WARNING:  
[core/receive.c:230]: receive_msg(): parsing relevant headers failed

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


[SR-Users] how to catch attacker using bad request line?

2018-09-17 Thread Juha Heinanen
Juha Heinanen writes:

> I didn't find any sanity module param value that would turn on checking
> of request line syntax.  Any other ideas?

I added log message at the beginning of main route block:

route { # main route block (initial tasks)

xinfo("Here\n");

It was not printed when malformed request came in, which means that the
main route block was not executed at all.

Kamailio cannot be wide open to DoS attacks.  What is it that I'm
missing.

-- Juha

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


Re: [SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Yuriy Gorlichenko
all is default
Maybe I need to set up something there?
I jsut did not found anything about it at the docs

пн, 17 сент. 2018 г. в 14:42, Sergiu Pojoga :

> Ok, what are your UAC parameters?
>
> On Mon, Sep 17, 2018 at 7:34 AM Yuriy Gorlichenko 
> wrote:
>
>> No. Tried from branch route.
>>
>> пн, 17 сент. 2018 г., 14:25 Sergiu Pojoga :
>>
>>> From which route are you calling uac_replace_to(), failure_route?
>>>
>>> "This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE"
>>>
>>> On Mon, Sep 17, 2018 at 6:05 AM Yuriy Gorlichenko 
>>> wrote:
>>>
 I tried uac_replace_to()
 But no luck

 пн, 17 сент. 2018 г. в 12:28, Alex Balashov >>> >:

> That is not a safe way to change the To header, since proxies aren't
> supposed to modify the To or From headers.
>
> The proper approach conceals the fact that modifications have taken
> place from the caller:
>
>
> https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.f.uac_replace_to
>
> --
> Sent from mobile. Apologies for brevity and errors.
>
> -Original Message-
> From: Mojtaba 
> To: "Kamailio (SER) - Users Mailing List"  >
> Sent: Mon, 17 Sep 2018 5:23 AM
> Subject: Re: [SR-Users] issue with rewrite to domain in failure route
>
> The $td is read-only variable, and yoou could not change it's value.
> If you want to change domain in To header, You should use testops
> module in kamialio and replace domain in To header. for example:
>
> subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
> With Regards.Mojtaba
>
> On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko 
> wrote:
> >
> > Hi
> > I'm building some system with failover trunk
> > but my providers requires to set their doamin in domain part of To
> Header
> >
> > so when I rewrite it at the my failure_route
> >
> > $td = FAILOVER_PROVIDER
> > my To filed looks like
> > To: 
> > what i tried:
> > Move this change to BRANCH_ROUTE:
> > here tried as
> > $td =  as
> > uac_replace_to('',"newToFieldValue)
> >
> > Move to the my custom route with both variants
> > But result is the same
> > kamailio 5.1
> >
> > version: kamailio 5.1.5 (x86_64/linux) d06080
> > flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
> USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP,
> PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
> USE_DST_BLACKLIST, HAVE_RESOLV_RES
> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE
> 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> > id: d06080
> > compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> --
> --Mojtaba Esfandiari.S
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

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


[SR-Users] Can't get from cache: $sqlrows(asg)

2018-09-17 Thread David Villasmil
Hello guys,

i've got this in my config:

Module config:

modparam("sqlops","sqlcon","asg=>mysql://DB_USER:DB_PASS@DB_HOST/kamailio")

Route:
sql_query("asg", "insert ignore dispatcher (id, setid, destination,
flags, priority, attrs, description) values (NULL, $var(dispatcher_id),
'sip:$si:5080', 0, 0, 'weight=$var(new_weight);maxload=50', '$fU')");
xlog("L_ERR", "[ASG_ADD_TO_DISPATCHER] Affected rows:
$sqlrows(asg)\n");
if ($sqlrows(asg)>0) {
ds_reload();
} else {
xlog("L_ERR", "[ASG_ADD_TO_DISPATCHER] COULD NOT ADD THE NEW
GATEWAY WITH IP $si AND USERNAME $fU\n");
}

and i'm getting:

 0(3929) CRITICAL:  [core/cfg.y:3447]: yyerror_at(): parse error in
config file /etc/kamailio/kamailio.cfg, line 1261, column 20-32: Can't get
from cache: $sqlrows(asg)

I can't figure out where the problem might be.

Can anyone help?

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
ᐧ
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Record-Route Parameters

2018-09-17 Thread Duarte Rocha
Hey,

I need all of my kamailio's IPs in Record Routes and i can do that already.
What i want to do is add different parameters to each Record-Route. Is that
possible?

A sexta, 14/09/2018, 17:54, Duarte Rocha  escreveu:

> Greetings,
>
> My Kamailio has 2 IP's and, as such, it will generate two Record-Routes
> when the Request is relayed.
>
> I want to add one parameter to one of the Record Routes and another
> parameter to the other Record-Route. However, if i use add_rr_param() it
> will automatically add the parameters to the two Record-Route Headers.
>
> Is there a way to do what i want without me re-writing the headers
> directly ?
>
> Cheers,
>
> Duarte Rocha
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Record-Route Parameters

2018-09-17 Thread Juha Heinanen
Duarte Rocha writes:

> I need all of my kamailio's IPs in Record Routes and i can do that already.
> What i want to do is add different parameters to each Record-Route. Is that
> possible?

Yes, read rr module README.

-- Juha

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


Re: [SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Federico Cabiddu
Hi,
I didn't understand from your mail if you are calling uac_replace_to()  in
a branch route also for the first request or only when you hit the failure
route.
Just in case, you need to call it in a branch route for the initial request
too so to have a "clean" message when you run the failure route, otherwise
the effect will be the one you observed, kind of garbage in the header.

Best regards,

Federico

On Mon, Sep 17, 2018 at 2:32 PM Yuriy Gorlichenko 
wrote:

> all is default
> Maybe I need to set up something there?
> I jsut did not found anything about it at the docs
>
> пн, 17 сент. 2018 г. в 14:42, Sergiu Pojoga :
>
>> Ok, what are your UAC parameters?
>>
>> On Mon, Sep 17, 2018 at 7:34 AM Yuriy Gorlichenko 
>> wrote:
>>
>>> No. Tried from branch route.
>>>
>>> пн, 17 сент. 2018 г., 14:25 Sergiu Pojoga :
>>>
 From which route are you calling uac_replace_to(), failure_route?

 "This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE"

 On Mon, Sep 17, 2018 at 6:05 AM Yuriy Gorlichenko 
 wrote:

> I tried uac_replace_to()
> But no luck
>
> пн, 17 сент. 2018 г. в 12:28, Alex Balashov  >:
>
>> That is not a safe way to change the To header, since proxies aren't
>> supposed to modify the To or From headers.
>>
>> The proper approach conceals the fact that modifications have taken
>> place from the caller:
>>
>>
>> https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.f.uac_replace_to
>>
>> --
>> Sent from mobile. Apologies for brevity and errors.
>>
>> -Original Message-
>> From: Mojtaba 
>> To: "Kamailio (SER) - Users Mailing List" <
>> sr-users@lists.kamailio.org>
>> Sent: Mon, 17 Sep 2018 5:23 AM
>> Subject: Re: [SR-Users] issue with rewrite to domain in failure route
>>
>> The $td is read-only variable, and yoou could not change it's value.
>> If you want to change domain in To header, You should use testops
>> module in kamialio and replace domain in To header. for example:
>>
>> subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
>> With Regards.Mojtaba
>>
>> On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko <
>> ovoshl...@gmail.com> wrote:
>> >
>> > Hi
>> > I'm building some system with failover trunk
>> > but my providers requires to set their doamin in domain part of To
>> Header
>> >
>> > so when I rewrite it at the my failure_route
>> >
>> > $td = FAILOVER_PROVIDER
>> > my To filed looks like
>> > To: 
>> > what i tried:
>> > Move this change to BRANCH_ROUTE:
>> > here tried as
>> > $td =  as
>> > uac_replace_to('',"newToFieldValue)
>> >
>> > Move to the my custom route with both variants
>> > But result is the same
>> > kamailio 5.1
>> >
>> > version: kamailio 5.1.5 (x86_64/linux) d06080
>> > flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
>> USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP,
>> PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
>> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
>> USE_DST_BLACKLIST, HAVE_RESOLV_RES
>> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE
>> 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
>> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>> > id: d06080
>> > compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
>> > ___
>> > Kamailio (SER) - Users Mailing List
>> > sr-users@lists.kamailio.org
>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>> --
>> --Mojtaba Esfandiari.S
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

>>> ___
>>> 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.kam

Re: [SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Sergiu Pojoga
Yes you have to configure a few things, most importantly:

https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.p.restore_mode
https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.p.restore_dlg

You have two choices: either you set it to restore from RR or you treat
calls with dialog module.

On Mon, Sep 17, 2018 at 8:32 AM Yuriy Gorlichenko 
wrote:

> all is default
> Maybe I need to set up something there?
> I jsut did not found anything about it at the docs
>
> пн, 17 сент. 2018 г. в 14:42, Sergiu Pojoga :
>
>> Ok, what are your UAC parameters?
>>
>> On Mon, Sep 17, 2018 at 7:34 AM Yuriy Gorlichenko 
>> wrote:
>>
>>> No. Tried from branch route.
>>>
>>> пн, 17 сент. 2018 г., 14:25 Sergiu Pojoga :
>>>
 From which route are you calling uac_replace_to(), failure_route?

 "This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE"

 On Mon, Sep 17, 2018 at 6:05 AM Yuriy Gorlichenko 
 wrote:

> I tried uac_replace_to()
> But no luck
>
> пн, 17 сент. 2018 г. в 12:28, Alex Balashov  >:
>
>> That is not a safe way to change the To header, since proxies aren't
>> supposed to modify the To or From headers.
>>
>> The proper approach conceals the fact that modifications have taken
>> place from the caller:
>>
>>
>> https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.f.uac_replace_to
>>
>> --
>> Sent from mobile. Apologies for brevity and errors.
>>
>> -Original Message-
>> From: Mojtaba 
>> To: "Kamailio (SER) - Users Mailing List" <
>> sr-users@lists.kamailio.org>
>> Sent: Mon, 17 Sep 2018 5:23 AM
>> Subject: Re: [SR-Users] issue with rewrite to domain in failure route
>>
>> The $td is read-only variable, and yoou could not change it's value.
>> If you want to change domain in To header, You should use testops
>> module in kamialio and replace domain in To header. for example:
>>
>> subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
>> With Regards.Mojtaba
>>
>> On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko <
>> ovoshl...@gmail.com> wrote:
>> >
>> > Hi
>> > I'm building some system with failover trunk
>> > but my providers requires to set their doamin in domain part of To
>> Header
>> >
>> > so when I rewrite it at the my failure_route
>> >
>> > $td = FAILOVER_PROVIDER
>> > my To filed looks like
>> > To: 
>> > what i tried:
>> > Move this change to BRANCH_ROUTE:
>> > here tried as
>> > $td =  as
>> > uac_replace_to('',"newToFieldValue)
>> >
>> > Move to the my custom route with both variants
>> > But result is the same
>> > kamailio 5.1
>> >
>> > version: kamailio 5.1.5 (x86_64/linux) d06080
>> > flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
>> USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP,
>> PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
>> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
>> USE_DST_BLACKLIST, HAVE_RESOLV_RES
>> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE
>> 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
>> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>> > id: d06080
>> > compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
>> > ___
>> > Kamailio (SER) - Users Mailing List
>> > sr-users@lists.kamailio.org
>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>> --
>> --Mojtaba Esfandiari.S
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

>>> ___
>>> 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
>>
> ___
> K

[SR-Users] Dispatcher Active IP for specific SetID over xHTTP

2018-09-17 Thread Soltanici Ilie
How could I get the active IP from the dispatcher module for a specific setid 
by using xHTTP request?___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] issue with rewrite to domain in failure route

2018-09-17 Thread Yuriy Gorlichenko
hmm
Suppose you are correct
Makes sence
Yes I using on ly in the branch for the failure
Thx for tip

пн, 17 сент. 2018 г. в 15:58, Federico Cabiddu :

> Hi,
> I didn't understand from your mail if you are calling uac_replace_to()  in
> a branch route also for the first request or only when you hit the failure
> route.
> Just in case, you need to call it in a branch route for the initial
> request too so to have a "clean" message when you run the failure route,
> otherwise the effect will be the one you observed, kind of garbage in the
> header.
>
> Best regards,
>
> Federico
>
> On Mon, Sep 17, 2018 at 2:32 PM Yuriy Gorlichenko 
> wrote:
>
>> all is default
>> Maybe I need to set up something there?
>> I jsut did not found anything about it at the docs
>>
>> пн, 17 сент. 2018 г. в 14:42, Sergiu Pojoga :
>>
>>> Ok, what are your UAC parameters?
>>>
>>> On Mon, Sep 17, 2018 at 7:34 AM Yuriy Gorlichenko 
>>> wrote:
>>>
 No. Tried from branch route.

 пн, 17 сент. 2018 г., 14:25 Sergiu Pojoga :

> From which route are you calling uac_replace_to(), failure_route?
>
> "This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE"
>
> On Mon, Sep 17, 2018 at 6:05 AM Yuriy Gorlichenko 
> wrote:
>
>> I tried uac_replace_to()
>> But no luck
>>
>> пн, 17 сент. 2018 г. в 12:28, Alex Balashov <
>> abalas...@evaristesys.com>:
>>
>>> That is not a safe way to change the To header, since proxies aren't
>>> supposed to modify the To or From headers.
>>>
>>> The proper approach conceals the fact that modifications have taken
>>> place from the caller:
>>>
>>>
>>> https://kamailio.org/docs/modules/5.1.x/modules/uac.html#uac.f.uac_replace_to
>>>
>>> --
>>> Sent from mobile. Apologies for brevity and errors.
>>>
>>> -Original Message-
>>> From: Mojtaba 
>>> To: "Kamailio (SER) - Users Mailing List" <
>>> sr-users@lists.kamailio.org>
>>> Sent: Mon, 17 Sep 2018 5:23 AM
>>> Subject: Re: [SR-Users] issue with rewrite to domain in failure route
>>>
>>> The $td is read-only variable, and yoou could not change it's value.
>>> If you want to change domain in To header, You should use testops
>>> module in kamialio and replace domain in To header. for example:
>>>
>>> subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
>>> With Regards.Mojtaba
>>>
>>> On Mon, Sep 17, 2018 at 1:19 PM Yuriy Gorlichenko <
>>> ovoshl...@gmail.com> wrote:
>>> >
>>> > Hi
>>> > I'm building some system with failover trunk
>>> > but my providers requires to set their doamin in domain part of To
>>> Header
>>> >
>>> > so when I rewrite it at the my failure_route
>>> >
>>> > $td = FAILOVER_PROVIDER
>>> > my To filed looks like
>>> > To: 
>>> > what i tried:
>>> > Move this change to BRANCH_ROUTE:
>>> > here tried as
>>> > $td =  as
>>> > uac_replace_to('',"newToFieldValue)
>>> >
>>> > Move to the my custom route with both variants
>>> > But result is the same
>>> > kamailio 5.1
>>> >
>>> > version: kamailio 5.1.5 (x86_64/linux) d06080
>>> > flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
>>> USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP,
>>> PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
>>> FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
>>> USE_DST_BLACKLIST, HAVE_RESOLV_RES
>>> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE
>>> 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
>>> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>>> > id: d06080
>>> > compiled on 00:43:08 Aug 23 2018 with gcc 6.3.0
>>> > ___
>>> > Kamailio (SER) - Users Mailing List
>>> > sr-users@lists.kamailio.org
>>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>>
>>> --
>>> --Mojtaba Esfandiari.S
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
 

Re: [SR-Users] how to catch attacker using bad request line?

2018-09-17 Thread Daniel-Constantin Mierla
Hello,

try with event_route[core:receive-parse-error] { ... }

The variables related to sip message content (headers, body, ...) likely
not working there (should return null), but source IP/port should be good.

Cheers,
Daniel


On 17.09.18 14:24, Juha Heinanen wrote:
> Juha Heinanen writes:
>
>> I didn't find any sanity module param value that would turn on checking
>> of request line syntax.  Any other ideas?
> I added log message at the beginning of main route block:
>
> route { # main route block (initial tasks)
>
> xinfo("Here\n");
>
> It was not printed when malformed request came in, which means that the
> main route block was not executed at all.
>
> Kamailio cannot be wide open to DoS attacks.  What is it that I'm
> missing.
>
> -- Juha
>
> ___
> 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 -- www.kamailioworld.com
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.com


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


Re: [SR-Users] Record-Route Parameters

2018-09-17 Thread Duarte Rocha
Can you show me where? I've tried add_rr_param() but it still adds every
parameter to the two record-routes
___
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 catch attacker using bad request line?

2018-09-17 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> try with event_route[core:receive-parse-error] { ... }
> 
> The variables related to sip message content (headers, body, ...) likely
> not working there (should return null), but source IP/port should be good.

Thanks for the pointer.  I defined:

event_route[core:receive-parse-error] {  # Catch message parse errors

xnotice("Request from <$var(src_ip)> has invalid syntax\n");

}

but didn't get the notice to syslog.  Only these:

Sep 17 16:37:52 char /usr/bin/sip-proxy[23020]: ERROR:  
[core/parser/msg_parser.c:337]: parse_headers(): bad header field [(null)]
Sep 17 16:37:52 char /usr/bin/sip-proxy[23020]: WARNING:  
[core/receive.c:230]: receive_msg(): parsing relevant headers failed

-- Juha

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


Re: [SR-Users] Record-Route Parameters

2018-09-17 Thread Juha Heinanen
Duarte Rocha writes:

> Can you show me where? I've tried add_rr_param() but it still adds every
> parameter to the two record-routes.

I didn't quite understand your question.  Perhaps you need to add the
r-r headers using append_hf() function that allows you to customize them.

-- Juha

___
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 catch attacker using bad request line?

2018-09-17 Thread Daniel-Constantin Mierla
Can you send all log messages with debug=3?

Btw, the source ip variable is $si.

Cheers,
Daniel



On 17.09.18 15:42, Juha Heinanen wrote:
> Daniel-Constantin Mierla writes:
>
>> try with event_route[core:receive-parse-error] { ... }
>>
>> The variables related to sip message content (headers, body, ...) likely
>> not working there (should return null), but source IP/port should be good.
> Thanks for the pointer.  I defined:
>
> event_route[core:receive-parse-error] {  # Catch message parse errors
>
> xnotice("Request from <$var(src_ip)> has invalid syntax\n");
>
> }
>
> but didn't get the notice to syslog.  Only these:
>
> Sep 17 16:37:52 char /usr/bin/sip-proxy[23020]: ERROR:  
> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [(null)]
> Sep 17 16:37:52 char /usr/bin/sip-proxy[23020]: WARNING:  
> [core/receive.c:230]: receive_msg(): parsing relevant headers failed
>
> -- Juha

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference -- www.kamailioworld.com
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.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 catch attacker using bad request line?

2018-09-17 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> Can you send all log messages with debug=3?

Below.

> Btw, the source ip variable is $si.

Oh yes, I had just copied the statement from other part of config,
where $si has been assigned to $var(src_ip).

-- Juha

Sep 17 16:56:07 char /usr/bin/sip-proxy[24183]: INFO:  
[core/cfg/cfg_ctx.c:595]: cfg_set_now(): core.debug has been changed to 3
sip-proxy_ctl> Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
[core/ip_addr.c:229]: print_ip(): tcpconn_new: new tcp connection: 
192.168.43.107
Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
[core/tcp_main.c:999]: tcpconn_new(): on port 48636, type 2
Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
[core/tcp_main.c:1305]: tcpconn_add(): hashes: 1768:3207:3940, 1
Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
[core/io_wait.h:380]: io_watch_add(): DBG: io_watch_add(0x55839aa16da0, 67, 2, 
0x7fb01cc67930), fd_no=55
Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
[core/io_wait.h:602]: io_watch_del(): DBG: io_watch_del (0x55839aa16da0, 67, 
-1, 0x0) fd_no=56 called
Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
[core/tcp_main.c:4196]: handle_tcpconn_ev(): sending to child, events 1
Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
[core/tcp_main.c:3847]: send2child(): checking per-socket generic workers 
(24205/27..24230/34) [tcp:192.168.43.107:5060]
Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
[core/tcp_main.c:3875]: send2child(): selected tcp worker 0 27(24205) for 
activity on [tcp:192.168.43.107:5060], 0x7fb01cc67930
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/tcp_read.c:1759]: handle_io(): received n=8 con=0x7fb01cc67930, fd=12
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/parse_fline.c:249]: parse_first_line(): parse_first_line: bad 
request first line
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/parse_fline.c:251]: parse_first_line(): at line 0 char 35:
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/parse_fline.c:257]: parse_first_line(): parsed so far: 
REGISTERsip:test.tutpro.com SIP/2.0
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/parse_fline.c:262]: parse_first_line(): parse_first_line: bad 
message (offset: 35)
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/tcp_read.c:1560]: tcp_read_req(): content-length=0
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/parse_fline.c:249]: parse_first_line(): parse_first_line: bad 
request first line
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/parse_fline.c:251]: parse_first_line(): at line 0 char 35:
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/parse_fline.c:257]: parse_first_line(): parsed so far: 
REGISTERsip:test.tutpro.com SIP/2.0
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/parse_fline.c:262]: parse_first_line(): parse_first_line: bad 
message (offset: 35)
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/msg_parser.c:606]: parse_msg(): invalid message
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/msg_parser.c:681]: parse_msg(): ERROR: parse_msg: 
message=;expires=600;+sip.instance="";q=0.5;reg-id=1#015#012Max-Forwards:
 70#015#012Route: #015#012To: 
#015#012From: 
;tag=ab41d0eaaf619e81#015#012Call-ID: 
08f94737eec75885#015#012CSeq: 26277 REGISTER#015#012User-Agent: baresip v0.5.11 
(x86_64/linux)#015#012Supported: gruu, outbound, path#015#012Allow: 
INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY,SUBSCRIBE,INFO,MESSAGE#015#012Content-Length:
 0#015#012#015#012>
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/msg_parser.c:83]: get_hdr_field(): null buffer pointer
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/parser/msg_parser.c:279]: get_hdr_field(): error exit
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: ERROR:  
[core/parser/msg_parser.c:337]: parse_headers(): bad header field [(null)]
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: WARNING:  
[core/receive.c:230]: receive_msg(): parsing relevant headers failed
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/receive.c:232]: receive_msg(): --- received sip message - reply - 
call-id: [] - cseq: []
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
[core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)
Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  

Re: [SR-Users] how to catch attacker using bad request line?

2018-09-17 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> Can you send all log messages with debug=3?

I also started k with debug=3 to check that the event route is ok:

Sep 17 17:00:40 char sip-proxy: DEBUG:  [core/events.c:53]: 
sr_core_ert_init(): event_route[core:receive-parse-error] is defined

-- Juha

___
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 catch attacker using bad request line?

2018-09-17 Thread Daniel-Constantin Mierla
I guess you have some modules that registered to process non-sip
traffic, such as xhttp, xmlrpc, ... the parse_msg() throws error and in
such case the processing is delegated to non-sip message handling, if
all skipped, then ended up on trying going further as sip ...

I just pushed a patch to deal with it properly. Can you test? if all ok,
feel free to backport.

Cheers,
Daniel


On 17.09.18 15:59, Juha Heinanen wrote:
> Daniel-Constantin Mierla writes:
>
>> Can you send all log messages with debug=3?
> Below.
>
>> Btw, the source ip variable is $si.
> Oh yes, I had just copied the statement from other part of config,
> where $si has been assigned to $var(src_ip).
>
> -- Juha
>
> Sep 17 16:56:07 char /usr/bin/sip-proxy[24183]: INFO:  
> [core/cfg/cfg_ctx.c:595]: cfg_set_now(): core.debug has been changed to 3
> sip-proxy_ctl> Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
> [core/ip_addr.c:229]: print_ip(): tcpconn_new: new tcp connection: 
> 192.168.43.107
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
> [core/tcp_main.c:999]: tcpconn_new(): on port 48636, type 2
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
> [core/tcp_main.c:1305]: tcpconn_add(): hashes: 1768:3207:3940, 1
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
> [core/io_wait.h:380]: io_watch_add(): DBG: io_watch_add(0x55839aa16da0, 67, 
> 2, 0x7fb01cc67930), fd_no=55
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
> [core/io_wait.h:602]: io_watch_del(): DBG: io_watch_del (0x55839aa16da0, 67, 
> -1, 0x0) fd_no=56 called
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
> [core/tcp_main.c:4196]: handle_tcpconn_ev(): sending to child, events 1
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
> [core/tcp_main.c:3847]: send2child(): checking per-socket generic workers 
> (24205/27..24230/34) [tcp:192.168.43.107:5060]
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24255]: DEBUG:  
> [core/tcp_main.c:3875]: send2child(): selected tcp worker 0 27(24205) for 
> activity on [tcp:192.168.43.107:5060], 0x7fb01cc67930
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/tcp_read.c:1759]: handle_io(): received n=8 con=0x7fb01cc67930, fd=12
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/parse_fline.c:249]: parse_first_line(): parse_first_line: bad 
> request first line
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/parse_fline.c:251]: parse_first_line(): at line 0 char 35:
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/parse_fline.c:257]: parse_first_line(): parsed so far: 
> REGISTERsip:test.tutpro.com SIP/2.0
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/parse_fline.c:262]: parse_first_line(): parse_first_line: bad 
> message (offset: 35)
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/tcp_read.c:1560]: tcp_read_req(): content-length=0
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/parse_fline.c:249]: parse_first_line(): parse_first_line: bad 
> request first line
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/parse_fline.c:251]: parse_first_line(): at line 0 char 35:
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/parse_fline.c:257]: parse_first_line(): parsed so far: 
> REGISTERsip:test.tutpro.com SIP/2.0
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/parse_fline.c:262]: parse_first_line(): parse_first_line: bad 
> message (offset: 35)
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/msg_parser.c:606]: parse_msg(): invalid message
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/msg_parser.c:681]: parse_msg(): ERROR: parse_msg: 
> message= 192.168.43.107:40797;branch=z9hG4bK7a6e707b367651ed;rport#015#012Contact: 
> ;expires=600;+sip.instance="";q=0.5;reg-id=1#015#012Max-Forwards:
>  70#015#012Route: #015#012To: 
> #015#012From: 
> ;tag=ab41d0eaaf619e81#015#012Call-ID: 
> 08f94737eec75885#015#012CSeq: 26277 REGISTER#015#012User-Agent: baresip 
> v0.5.11 (x86_64/linux)#015#012Supported: gruu, outbound, path#015#012Allow: 
> INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY,SUBSCRIBE,INFO,MESSAGE#015#012Content-Length:
>  0#015#012#015#012>
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/msg_parser.c:83]: get_hdr_field(): null buffer pointer
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/parser/msg_parser.c:279]: get_hdr_field(): error exit
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: ERROR:  
> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [(null)]
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: WARNING:  
> [core/receive.c:230]: receive_msg(): parsing relevant headers failed
> Sep 17 16:56:16 char /usr/bin/sip-proxy[24205]: DEBUG:  
> [core/receive.c:232]: receive_msg(): --- received sip message - reply - 
> call-id: [] - cseq: []
>

Re: [SR-Users] how to catch attacker using bad request line?

2018-09-17 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> I guess you have some modules that registered to process non-sip
> traffic, such as xhttp, xmlrpc, ... the parse_msg() throws error and in
> such case the processing is delegated to non-sip message handling, if
> all skipped, then ended up on trying going further as sip ...

Yes, there is event_route [xhttp:request].
> 
> I just pushed a patch to deal with it properly. Can you test? if all ok,
> feel free to backport.

Now the event_route[core:receive-parse-error] was executed:

Sep 17 17:52:14 char /usr/bin/sip-proxy[18269]: NOTICE: Request from 
<192.168.43.107> has invalid syntax

and there was no ERROR/WARNING messages.

I'll backport to 5.1.

-- Juha

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


Re: [SR-Users] Record-Route Parameters

2018-09-17 Thread Duarte Rocha
When Kamailio receives the INVITE, it relays it with two Record-Route like
this :

 Record-Route:sip:IP1;ftag=;vst=xxx;vsf=xxx
 Record-Route:sip:IP2;ftag=;vst=xxx;vsf=xxx
What i want is :

 Record-Route:sip:IP1;ftag=;vst=xxx;vsf=xxx;NEW_PARAMETER=10
 Record-Route:sip:IP2;ftag=;vst=xxx;vsf=xxx;NEW_PARAMETER=20
I hope this make sense now.

Thanks for your help

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


Re: [SR-Users] Record-Route Parameters

2018-09-17 Thread Alex Balashov
You want to add new parameters to someone else's Record-Routes, or
Kamailio's?

On Mon, Sep 17, 2018 at 03:59:14PM +0100, Duarte Rocha wrote:

> When Kamailio receives the INVITE, it relays it with two Record-Route like
> this :
> 
>  Record-Route:sip:IP1;ftag=;vst=xxx;vsf=xxx
>  Record-Route:sip:IP2;ftag=;vst=xxx;vsf=xxx
> What i want is :
> 
>  Record-Route:sip:IP1;ftag=;vst=xxx;vsf=xxx;NEW_PARAMETER=10
>  Record-Route:sip:IP2;ftag=;vst=xxx;vsf=xxx;NEW_PARAMETER=20
> I hope this make sense now.
> 
> Thanks for your help
> 
> >

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


-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.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 catch attacker using bad request line?

2018-09-17 Thread Juha Heinanen
Juha Heinanen writes:

> I'll backport to 5.1.

cherry-pick didn't work:

$ git cherry-pick -x f088d2afe4153b9e440a4293211c78f5a25af691
error: could not apply f088d2afe... core: if nosip msg hooks skip handling the 
packet, stop sip routing processing
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add ' or 'git rm '
hint: and commit the result with 'git commit'

I'm not sure if I dare to do manual edit.

-- Juha

___
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 catch attacker using bad request line?

2018-09-17 Thread Daniel-Constantin Mierla
I will check the cherry pick conflict and do the backport manually if
needed once. Going to be a bit later today.

Cheers,
Daniel

On Mon, 17 Sep 2018, 17:05 Juha Heinanen,  wrote:

> Juha Heinanen writes:
>
> > I'll backport to 5.1.
>
> cherry-pick didn't work:
>
> $ git cherry-pick -x f088d2afe4153b9e440a4293211c78f5a25af691
> error: could not apply f088d2afe... core: if nosip msg hooks skip handling
> the packet, stop sip routing processing
> hint: after resolving the conflicts, mark the corrected paths
> hint: with 'git add ' or 'git rm '
> hint: and commit the result with 'git commit'
>
> I'm not sure if I dare to do manual edit.
>
> -- Juha
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Record-Route Parameters

2018-09-17 Thread Duarte Rocha
I want to add to Kamailio's. This INVITE arrives at Kamailio with no
Record-Route. It leaves Kamailio with two Record-Routes since i'm using one
IP for receiving and another for sending.
___
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 catch attacker using bad request line?

2018-09-17 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> I will check the cherry pick conflict and do the backport manually if
> needed once. Going to be a bit later today.

I did it.  There was only one small conflict.

-- Juha

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


Re: [SR-Users] Record-Route Parameters

2018-09-17 Thread Juha Heinanen
Duarte Rocha writes:

> When Kamailio receives the INVITE, it relays it with two Record-Route like
> this :
> 
>  Record-Route:sip:IP1;ftag=;vst=xxx;vsf=xxx
>  Record-Route:sip:IP2;ftag=;vst=xxx;vsf=xxx
> What i want is :
> 
>  Record-Route:sip:IP1;ftag=;vst=xxx;vsf=xxx;NEW_PARAMETER=10
>  Record-Route:sip:IP2;ftag=;vst=xxx;vsf=xxx;NEW_PARAMETER=20

If you now call record_route(), try calling record_route_preset(string
[,string2]).

-- Juha

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


Re: [SR-Users] Record-Route Parameters

2018-09-17 Thread Duarte Rocha
Thanks for all your help.

With record_route_preset(string[,string2]) i can place the parameters as i
want. The only problem is that using record_route_preset, it doesn't add
all the parameters that it usually does, like "vst", vsf" and "r2", only
the ftag.

However, it might be possible get those values as a variable in order to
mannually add them to the Record-Route.
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Incoming call on Kamailio WebRTC

2018-09-17 Thread Henning Westerholt
Am Montag, 17. September 2018, 12:21:50 CEST schrieb Adesh Pandey:
> We are trying to setup WebRTC with Kamailio as sip registrar and
> dispatcher. We have succeed for outgoing calls but cannot attend incoming
> calls to the Kamailio. It would be a great help if someone can provide a
> sample config for webrtc + kamailio or blog for the same.

Hello Adesh,

with a quick google search I found this:

- https://github.com/havfo/WEBRTC-to-SIP
- http://caruizdiaz.com/2014/02/26/webrtc-kamailio/

Best regards,

Henning

-- 
Henning Westerholt
https://skalatan.de/blog/

___
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 get from cache: $sqlrows(asg)

2018-09-17 Thread Henning Westerholt
Am Montag, 17. September 2018, 14:40:43 CEST schrieb David Villasmil:
> Module config:
> modparam("sqlops","sqlcon","asg=>mysql://DB_USER:DB_PASS@DB_HOST/kamailio")
> Route:
> sql_query("asg", "insert ignore dispatcher (id, setid, destination,
> flags, priority, attrs, description) values (NULL, $var(dispatcher_id),
> 'sip:$si:5080', 0, 0, 'weight=$var(new_weight);maxload=50', '$fU')");
> xlog("L_ERR", "[ASG_ADD_TO_DISPATCHER] Affected rows:
> $sqlrows(asg)\n");
> if ($sqlrows(asg)>0) {
> ds_reload();
> } else {
> xlog("L_ERR", "[ASG_ADD_TO_DISPATCHER] COULD NOT ADD THE NEW
> GATEWAY WITH IP $si AND USERNAME $fU\n");
> }
> 
> and i'm getting:
> 
>  0(3929) CRITICAL:  [core/cfg.y:3447]: yyerror_at(): parse error in
> config file /etc/kamailio/kamailio.cfg, line 1261, column 20-32: Can't get
> from cache: $sqlrows(asg)

Hi David,

do you get this error during startup or during run-time? Is this the only 
error that you get?

Best regards,

Henning

-- 
Henning Westerholt
https://skalatan.de/blog/

___
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 get from cache: $sqlrows(asg)

2018-09-17 Thread David Villasmil
Hello,

During startup, i only get that one.
I really appreciate your help

David

On Mon, Sep 17, 2018, 21:04 Henning Westerholt  wrote:

> Am Montag, 17. September 2018, 14:40:43 CEST schrieb David Villasmil:
> > Module config:
> > modparam("sqlops","sqlcon","asg=>mysql://DB_USER:DB_PASS@DB_HOST
> /kamailio")
> > Route:
> > sql_query("asg", "insert ignore dispatcher (id, setid,
> destination,
> > flags, priority, attrs, description) values (NULL, $var(dispatcher_id),
> > 'sip:$si:5080', 0, 0, 'weight=$var(new_weight);maxload=50', '$fU')");
> > xlog("L_ERR", "[ASG_ADD_TO_DISPATCHER] Affected rows:
> > $sqlrows(asg)\n");
> > if ($sqlrows(asg)>0) {
> > ds_reload();
> > } else {
> > xlog("L_ERR", "[ASG_ADD_TO_DISPATCHER] COULD NOT ADD THE NEW
> > GATEWAY WITH IP $si AND USERNAME $fU\n");
> > }
> >
> > and i'm getting:
> >
> >  0(3929) CRITICAL:  [core/cfg.y:3447]: yyerror_at(): parse error in
> > config file /etc/kamailio/kamailio.cfg, line 1261, column 20-32: Can't
> get
> > from cache: $sqlrows(asg)
>
> Hi David,
>
> do you get this error during startup or during run-time? Is this the only
> error that you get?
>
> Best regards,
>
> Henning
>
> --
> Henning Westerholt
> https://skalatan.de/blog/
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Where does location ruid come from?

2018-09-17 Thread David Cunningham
Hello,

We are debugging an issue with location records having duplicate "ruid"
values, which aren't allowed by the table index. Can anyone tell us where
the "ruid" value comes from? Is it a function of some other variable?

Thanks in advance,

-- 
David Cunningham, Voisonics Limited
http://voisonics.com/
USA: +1 213 221 1092
New Zealand: +64 (0)28 2558 3782
___
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 get from cache: $sqlrows(asg)

2018-09-17 Thread Daniel-Constantin Mierla
Hello,

run with debug=3 in kamailio.cfg and see in the logs if you get more
hints about happens.

Cheers,
Daniel

On 18.09.18 00:37, David Villasmil wrote:
>
> Hello,
>
> During startup, i only get that one.
> I really appreciate your help
>
> David
>
>
> On Mon, Sep 17, 2018, 21:04 Henning Westerholt  > wrote:
>
> Am Montag, 17. September 2018, 14:40:43 CEST schrieb David Villasmil:
> > Module config:
> >
> 
> modparam("sqlops","sqlcon","asg=>mysql://DB_USER:DB_PASS@DB_HOST/kamailio")
> > Route:
> >         sql_query("asg", "insert ignore dispatcher (id, setid,
> destination,
> > flags, priority, attrs, description) values (NULL,
> $var(dispatcher_id),
> > 'sip:$si:5080', 0, 0, 'weight=$var(new_weight);maxload=50',
> '$fU')");
> >         xlog("L_ERR", "[ASG_ADD_TO_DISPATCHER] Affected rows:
> > $sqlrows(asg)\n");
> >         if ($sqlrows(asg)>0) {
> >             ds_reload();
> >         } else {
> >             xlog("L_ERR", "[ASG_ADD_TO_DISPATCHER] COULD NOT ADD
> THE NEW
> > GATEWAY WITH IP $si AND USERNAME $fU\n");
> >         }
> >
> > and i'm getting:
> >
> >  0(3929) CRITICAL:  [core/cfg.y:3447]: yyerror_at(): parse
> error in
> > config file /etc/kamailio/kamailio.cfg, line 1261, column 20-32:
> Can't get
> > from cache: $sqlrows(asg)
>
> Hi David,
>
> do you get this error during startup or during run-time? Is this
> the only
> error that you get?
>
> Best regards,
>
> Henning
>
> -- 
> Henning Westerholt
> https://skalatan.de/blog/
>
>
>
> ___
> 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 -- www.kamailioworld.com
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.com

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