Re: [SR-Users] The problem of get_aor_hash function

2018-07-19 Thread tyd
Hi, Danial

I had modified ims_usrloc_pcscf/udomain.c about hash function and related
codes.
ex. via_host replaces with aor

aorhash = get_aor_hash(_d, _info->aor, contact_info->via_port,
contact_info->via_prot);
//aorhash = get_aor_hash(_d, _info->via_host,
contact_info->via_port, contact_info->via_prot);
//aorhash = get_aor_hash(_d, _info->via_host,
contact_info->via_port, contact_info->via_prot);
//aorhash = get_aor_hash(_d, _info->via_host,
contact_info->via_port, contact_info->via_prot);

When PCSCF DB is empty, it's OK.
But if there are data in PCSCF DB, the PCSCF process was crashed.
Below is the gdb content.
Could you help to find the problem?
Thanks.

(gdb) bt full
#0  0x7f9a2c688fc3 in core_hash (s1=0x7f9a2c89e908 ,
s2=0x0, size=0)
at ../../hashes.h:276
p = 0x0
end = 0x0
v = 389295844
h = 0
#1  0x7f9a2c68ac01 in get_aor_hash (_d=0x7f9a173436e0,
via_host=0x7f9a2c89e908 , via_port=5080, via_proto=53877)
at usrloc.c:147
aorhash = 0
__FUNCTION__ = "get_aor_hash"
#2  0x7f9a2c68a8a9 in get_hash_slot (_d=0x7f9a173436e0,
via_host=0x7f9a2c89e908 , via_port=5080, via_proto=53877)
at usrloc.c:137
sl = 2000
__FUNCTION__ = "get_hash_slot"
#3  0x7f9a2c66e9f4 in lock_udomain (_d=0x7f9a173436e0,
via_host=0x7f9a2c89e908 , via_port=5080, via_proto=53877)
at udomain.c:273
sl = 0
#4  0x7f9a2c67994d in preload_udomain (_c=0x7f9a2e3162f8,
_d=0x7f9a173436e0)
at udomain.c:866
ci = 0x7f9a2c89e900 
row = 0x7f9a2e340210
columns = {0x7f9a2c89e2b0 , 0x7f9a2c89e2c0 ,
  0x7f9a2c89e2d0 , 0x7f9a2c89e2e0 ,
  0x7f9a2c89e2f0 , 0x7f9a2c89e300 ,
  0x7f9a2c89e310 , 0x7f9a2c89e320
,
  0x7f9a2c89e350 , 0x7f9a2c89e360
,
  0x7f9a2c89e370 , 0x7f9a2c89e390 ,
  0x7f9a2c89e380 , 0x7f9a2c89e3a0
,
  0x7f9a2c89e330 }
res = 0x7f9a2e33ff40
aor = {s = 0xb83059 "sip:d4173c5dcbdd1529@172.28.20.225:5080
;transport=udp",
  len = 53}
i = 0
n = 0
c = 0x7f9a2e335c20
__FUNCTION__ = "preload_udomain"
#5  0x7f9a2c68852d in child_init (_rank=1) at ul_mod.c:249
ptr = 0x7f9a17342c70
__FUNCTION__ = "child_init"
#6  0x005308c6 in init_mod_child (m=0x7f9a2e2fbcf0, rank=1) at
sr_module.c:921
__FUNCTION__ = "init_mod_child"
#7  0x005305e3 in init_mod_child (m=0x7f9a2e2fbfa0, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#8  0x005305e3 in init_mod_child (m=0x7f9a2e2fcc80, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#9  0x005305e3 in init_mod_child (m=0x7f9a2e2fd260, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#10 0x005305e3 in init_mod_child (m=0x7f9a2e2fd610, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#11 0x005305e3 in init_mod_child (m=0x7f9a2e2fdc40, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#12 0x005305e3 in init_mod_child (m=0x7f9a2e2fe158, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#13 0x005305e3 in init_mod_child (m=0x7f9a2e2fe460, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#14 0x005305e3 in init_mod_child (m=0x7f9a2e2fedc8, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#15 0x005305e3 in init_mod_child (m=0x7f9a2e2ff418, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#16 0x005305e3 in init_mod_child (m=0x7f9a2e2ffb48, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#17 0x005305e3 in init_mod_child (m=0x7f9a2e3000f0, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
---Type  to continue, or q  to quit---
#18 0x005305e3 in init_mod_child (m=0x7f9a2e300510, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#19 0x005305e3 in init_mod_child (m=0x7f9a2e301898, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#20 0x005305e3 in init_mod_child (m=0x7f9a2e302130, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#21 0x005305e3 in init_mod_child (m=0x7f9a2e3026d8, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#22 0x005305e3 in init_mod_child (m=0x7f9a2e302a50, rank=1) at
sr_module.c:918
__FUNCTION__ = "init_mod_child"
#23 0x00530bfe in init_child (rank=1) at sr_module.c:947
No locals.
#24 0x00485bd5 in fork_process (child_id=1,
desc=0x7ffe9c85acc0 "udp receiver child=0 sock=172.28.20.216:4060",
make_sock=1)
at pt.c:327
pid = 0
child_process_no = 1
ret = -1
new_seed1 = 570787820
new_seed2 = 1356713246
sockfd = {-1, -1}
__FUNCTION__ = "fork_process"
#25 0x0052024c in main_loop () at main.c:1586
i = 0
pid = 32766
si 

Re: [SR-Users] uri==myself

2018-07-19 Thread Karthik Srinivasan
So, i think i have determined the root cause of my issue:

Background info:
 - I have a request URI of an INVITE that contains no port number.
 - My application is not listening on the default port of 5060

The is_myself(...) function handles a 'no port in request uri' differently
than uri==myself.

By that i mean, is_myself(...) does not default the port to 5060 when
looking up aliases/(which ip addresses and ports the process is bound to);
it simply does not take port number into account (if no port exists in
request uri) when searching the alias list.  BUT,  uri==myself does default
to 5060 and hence tries to find an alias binding to 5060.

So, is_myself("$ru") passes in my case;  uri==myself fails.

Can you point me to the place in the source code where 5060 is being set as
default to the uri variable when request uri has no port number please?

I don't intend to change this defaulting behavior; I am just curious where
it is set.

Thanks,

Karthik

On Thu, Jul 19, 2018 at 3:37 PM, Karthik Srinivasan 
wrote:

> standby,  i have the debug mode spitting out tons of logs now.
>
> time for me to review.
>
> will let you know if i need help.
>
> thanks,
>
> karthik
>
> On Thu, Jul 19, 2018 at 3:15 PM, Karthik Srinivasan <
> ksriniva2...@gmail.com> wrote:
>
>> Unfortunately same result as before:
>>
>>  $var(myself) = 0;
>>if (uri =~ "" || uri == myself){
>>   $var(myself) = 1;
>>   xlog("L_INFO", "[$ci] in uri == myself check: var myself =
>> $var(myself)");
>>}
>>
>>if (uri =~ "" || is_myself("$ru")){
>>   $var(myself) = 1;
>>   xlog("L_INFO", "[$ci] in is_myself check: var myself =
>> $var(myself)");
>>}
>>
>> The only log that prints out is the one that says 'in is_myself check
>> ...'(the second if statement.)
>>
>> I have verified that if there's a regular expression match then both log
>> writes print.  Regular expression match happens when a SIP REGISTER request
>> comes across the pipe.
>>
>> Something odd is going on with the computation of  uri == myself vs
>> is_myself("$ru").
>>
>> Is there a way i can inspect what myself and uri have in them?
>>
>> Karthik
>>
>>
>>
>>
>> On Thu, Jul 19, 2018 at 2:18 PM, Daniel-Constantin Mierla <
>> mico...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> things are different that one may expect from evaluation of an
>>> expression compared with other established scripting/programming languages.
>>> One thing to be sure you are aware of are the return code evaluation:
>>>
>>>   - https://www.kamailio.org/wiki/tutorials/faq/main#how_is_the_
>>> function_return_cod
>>>
>>> To be sure of proper behaviour, you should do:
>>>
>>> if(uri =~ "" || uri == myself) {
>>>
>>> $var(myself) =1;
>>>
>>> } else {
>>>
>>> $var(myself) = 0;
>>>
>>> }
>>>
>>> Same with is_myself("$ru") instead of uri == myself.
>>>
>>> Try and see if you get different values for $var(myself).
>>> Cheers,
>>> Daniel
>>>
>>> On 19.07.18 19:09, Karthik Srinivasan wrote:
>>>
>>> Yes, they are used at the very same place. here is a code snippet of
>>> where i added it for testing purposes:
>>>
>>>
>>> route[INIT_VARS] {
>>>
>>> $var(myself) = uri =~ "" || uri == myself;
>>> //if i print $var(myself) it prints 0
>>> $var(myself) = uri =~ "" || is_myself("$ru");
>>> //if i print $var(myself) it prints 1
>>>
>>> // in both cases above the regex part isn't supposed to match and hence
>>> correctly returns false.
>>> ...
>>>
>>> }
>>>
>>> route{
>>>
>>>route(INIT_VARS);
>>>
>>> ...
>>> }
>>>
>>> Thanks,
>>>
>>> Karthik
>>>
>>> On Thu, Jul 19, 2018 at 11:46 AM, Daniel-Constantin Mierla <
>>> mico...@gmail.com> wrote:
>>>
 Hello,


 On 19.07.18 18:32, Karthik Srinivasan wrote:
 > Hello,
 >
 > Can someone explain to me why statement A returns True and statement B
 > returns False.
 >
 > Statement A:
 > is_myself("$ru")
 >
 > Statement B:
 > uri == myself
 >
 >
 > Isn't uri and $ru referencing the same data?
 >
 > With my current config i am expecting the is_myself to return True;  i
 > was expecting the same for Statement B but unfortunately it is
 > returning False.
 >
 they are supposed to be the same in this case.

 Are they used at the same place in config? Note that $ru can be changed
 by different functions such as those from registrar, dispatcher, lcr,
 ...

 Cheers,
 Daniel

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


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


Re: [SR-Users] dialog module : questions about dialog states

2018-07-19 Thread Abdoul Osséni
Thank you for your help.

We use TLS protocol from mobile networks.

In most cases we have no problems during the three way handshake (invite ->
200Ok -> ACK).

But sometimes, we didn't received the ACK of 200OK (the TCP connection
appears broken during the three way handshake per example). In this case,
we need to cancel the calls to avoid charging customers.

our goal is to use tpcops (tcp:closed, tcp:reset event routes), htable,
dialog and tmx modules to cancel (t_reply_callid) or terminate(dlg_bye)
these calls.

May be , is there a better solution?

Abdoul OSSENI
Ingénieur DevOps chez Néo-Soft
Co-Fondateur de ON SERVICES
Tél : +33 601 135 167

2018-07-19 21:21 GMT+02:00 Daniel-Constantin Mierla :

> If state < 0, then practically the INVITE transaction is active, it needs
> to be cancelled or replied with t_reply(...) and a code >=400.
>
> From where you need to terminate this ongoing INVITE, from kamailio.cfg or
> from external app?
>
> Cheers,
> Daniel
>
> On 19.07.18 19:20, Abdoul Osséni wrote:
>
> ERRATUM.
>
> What is the best way to end calls for states < 3 ?
>
> Abdoul OSSENI
> Ingénieur DevOps chez Néo-Soft
> Co-Fondateur de ON SERVICES
> Tél : +33 601 135 167
>
> 2018-07-19 19:19 GMT+02:00 Abdoul Osséni :
>
>> Thank you Daniel.
>> What is the best way to end calls for states 3 and 4 ?
>>
>> Regards
>>
>> Abdoul OSSENI
>> Ingénieur DevOps chez Néo-Soft
>> Co-Fondateur de ON SERVICES
>> Tél : +33 601 135 167
>>
>> 2018-07-19 18:49 GMT+02:00 Daniel-Constantin Mierla :
>>
>>> Hello,
>>>
>>>
>>> On 19.07.18 18:15, Abdoul Osséni wrote:
>>> > Hello list,
>>> >
>>> > When the dialog state for a call is < 4, is it possible to use
>>> > dlg_bye() function to end the call?
>>> >
>>> it should be possible to use it for states 3 and 4.
>>>
>>> Lower state than 3 means that the dialog was not answered yet (no 200ok
>>> received). While SIP allows BYE at that stage to end a particular branch
>>> of the call, dialog module needs the 200ok, as it operates at dialog
>>> level, not at transaction/branch level.
>>>
>>> Cheers,
>>> Daniel
>>>
>>> --
>>> Daniel-Constantin Mierla -- www.asipto.com
>>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>>> Kamailio World Conference -- www.kamailioworld.com
>>>
>>>
>>
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
> www.linkedin.com/in/miconda
> Kamailio World Conference -- www.kamailioworld.com
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] uri==myself

2018-07-19 Thread Karthik Srinivasan
standby,  i have the debug mode spitting out tons of logs now.

time for me to review.

will let you know if i need help.

thanks,

karthik

On Thu, Jul 19, 2018 at 3:15 PM, Karthik Srinivasan 
wrote:

> Unfortunately same result as before:
>
>  $var(myself) = 0;
>if (uri =~ "" || uri == myself){
>   $var(myself) = 1;
>   xlog("L_INFO", "[$ci] in uri == myself check: var myself =
> $var(myself)");
>}
>
>if (uri =~ "" || is_myself("$ru")){
>   $var(myself) = 1;
>   xlog("L_INFO", "[$ci] in is_myself check: var myself =
> $var(myself)");
>}
>
> The only log that prints out is the one that says 'in is_myself check
> ...'(the second if statement.)
>
> I have verified that if there's a regular expression match then both log
> writes print.  Regular expression match happens when a SIP REGISTER request
> comes across the pipe.
>
> Something odd is going on with the computation of  uri == myself vs
> is_myself("$ru").
>
> Is there a way i can inspect what myself and uri have in them?
>
> Karthik
>
>
>
>
> On Thu, Jul 19, 2018 at 2:18 PM, Daniel-Constantin Mierla <
> mico...@gmail.com> wrote:
>
>> Hello,
>>
>> things are different that one may expect from evaluation of an expression
>> compared with other established scripting/programming languages. One thing
>> to be sure you are aware of are the return code evaluation:
>>
>>   - https://www.kamailio.org/wiki/tutorials/faq/main#how_is_the_
>> function_return_cod
>>
>> To be sure of proper behaviour, you should do:
>>
>> if(uri =~ "" || uri == myself) {
>>
>> $var(myself) =1;
>>
>> } else {
>>
>> $var(myself) = 0;
>>
>> }
>>
>> Same with is_myself("$ru") instead of uri == myself.
>>
>> Try and see if you get different values for $var(myself).
>> Cheers,
>> Daniel
>>
>> On 19.07.18 19:09, Karthik Srinivasan wrote:
>>
>> Yes, they are used at the very same place. here is a code snippet of
>> where i added it for testing purposes:
>>
>>
>> route[INIT_VARS] {
>>
>> $var(myself) = uri =~ "" || uri == myself;
>> //if i print $var(myself) it prints 0
>> $var(myself) = uri =~ "" || is_myself("$ru");
>> //if i print $var(myself) it prints 1
>>
>> // in both cases above the regex part isn't supposed to match and hence
>> correctly returns false.
>> ...
>>
>> }
>>
>> route{
>>
>>route(INIT_VARS);
>>
>> ...
>> }
>>
>> Thanks,
>>
>> Karthik
>>
>> On Thu, Jul 19, 2018 at 11:46 AM, Daniel-Constantin Mierla <
>> mico...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>>
>>> On 19.07.18 18:32, Karthik Srinivasan wrote:
>>> > Hello,
>>> >
>>> > Can someone explain to me why statement A returns True and statement B
>>> > returns False.
>>> >
>>> > Statement A:
>>> > is_myself("$ru")
>>> >
>>> > Statement B:
>>> > uri == myself
>>> >
>>> >
>>> > Isn't uri and $ru referencing the same data?
>>> >
>>> > With my current config i am expecting the is_myself to return True;  i
>>> > was expecting the same for Statement B but unfortunately it is
>>> > returning False.
>>> >
>>> they are supposed to be the same in this case.
>>>
>>> Are they used at the same place in config? Note that $ru can be changed
>>> by different functions such as those from registrar, dispatcher, lcr, ...
>>>
>>> Cheers,
>>> Daniel
>>>
>>> --
>>> Daniel-Constantin Mierla -- www.asipto.com
>>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>>> Kamailio World Conference -- www.kamailioworld.com
>>>
>>>
>>
>> --
>> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
>> www.linkedin.com/in/miconda
>> Kamailio World Conference -- www.kamailioworld.com
>>
>>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] uri==myself

2018-07-19 Thread Karthik Srinivasan
Unfortunately same result as before:

 $var(myself) = 0;
   if (uri =~ "" || uri == myself){
  $var(myself) = 1;
  xlog("L_INFO", "[$ci] in uri == myself check: var myself =
$var(myself)");
   }

   if (uri =~ "" || is_myself("$ru")){
  $var(myself) = 1;
  xlog("L_INFO", "[$ci] in is_myself check: var myself = $var(myself)");
   }

The only log that prints out is the one that says 'in is_myself check
...'(the second if statement.)

I have verified that if there's a regular expression match then both log
writes print.  Regular expression match happens when a SIP REGISTER request
comes across the pipe.

Something odd is going on with the computation of  uri == myself vs
is_myself("$ru").

Is there a way i can inspect what myself and uri have in them?

Karthik




On Thu, Jul 19, 2018 at 2:18 PM, Daniel-Constantin Mierla  wrote:

> Hello,
>
> things are different that one may expect from evaluation of an expression
> compared with other established scripting/programming languages. One thing
> to be sure you are aware of are the return code evaluation:
>
>   - https://www.kamailio.org/wiki/tutorials/faq/main#how_is_the_
> function_return_cod
>
> To be sure of proper behaviour, you should do:
>
> if(uri =~ "" || uri == myself) {
>
> $var(myself) =1;
>
> } else {
>
> $var(myself) = 0;
>
> }
>
> Same with is_myself("$ru") instead of uri == myself.
>
> Try and see if you get different values for $var(myself).
> Cheers,
> Daniel
>
> On 19.07.18 19:09, Karthik Srinivasan wrote:
>
> Yes, they are used at the very same place. here is a code snippet of where
> i added it for testing purposes:
>
>
> route[INIT_VARS] {
>
> $var(myself) = uri =~ "" || uri == myself;
> //if i print $var(myself) it prints 0
> $var(myself) = uri =~ "" || is_myself("$ru");
> //if i print $var(myself) it prints 1
>
> // in both cases above the regex part isn't supposed to match and hence
> correctly returns false.
> ...
>
> }
>
> route{
>
>route(INIT_VARS);
>
> ...
> }
>
> Thanks,
>
> Karthik
>
> On Thu, Jul 19, 2018 at 11:46 AM, Daniel-Constantin Mierla <
> mico...@gmail.com> wrote:
>
>> Hello,
>>
>>
>> On 19.07.18 18:32, Karthik Srinivasan wrote:
>> > Hello,
>> >
>> > Can someone explain to me why statement A returns True and statement B
>> > returns False.
>> >
>> > Statement A:
>> > is_myself("$ru")
>> >
>> > Statement B:
>> > uri == myself
>> >
>> >
>> > Isn't uri and $ru referencing the same data?
>> >
>> > With my current config i am expecting the is_myself to return True;  i
>> > was expecting the same for Statement B but unfortunately it is
>> > returning False.
>> >
>> they are supposed to be the same in this case.
>>
>> Are they used at the same place in config? Note that $ru can be changed
>> by different functions such as those from registrar, dispatcher, lcr, ...
>>
>> Cheers,
>> Daniel
>>
>> --
>> Daniel-Constantin Mierla -- www.asipto.com
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio World Conference -- www.kamailioworld.com
>>
>>
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
> www.linkedin.com/in/miconda
> Kamailio World Conference -- www.kamailioworld.com
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dialog module : questions about dialog states

2018-07-19 Thread Daniel-Constantin Mierla
If state < 0, then practically the INVITE transaction is active, it
needs to be cancelled or replied with t_reply(...) and a code >=400.

>From where you need to terminate this ongoing INVITE, from kamailio.cfg
or from external app?

Cheers,
Daniel


On 19.07.18 19:20, Abdoul Osséni wrote:
> ERRATUM.
>
> What is the best way to end calls for states < 3 ?
>
> Abdoul OSSENI
> Ingénieur DevOps chez Néo-Soft
> Co-Fondateur de ON SERVICES
> Tél : +33 601 135 167
>
> 2018-07-19 19:19 GMT+02:00 Abdoul Osséni  >:
>
> Thank you Daniel.
> What is the best way to end calls for states 3 and 4 ?
>
> Regards
>
> Abdoul OSSENI
> Ingénieur DevOps chez Néo-Soft
> Co-Fondateur de ON SERVICES
> Tél : +33 601 135 167
>
> 2018-07-19 18:49 GMT+02:00 Daniel-Constantin Mierla
> mailto:mico...@gmail.com>>:
>
> Hello,
>
>
> On 19.07.18 18:15, Abdoul Osséni wrote:
> > Hello list,
> >
> > When the dialog state for a call is < 4, is it possible to use
> > dlg_bye() function to end the call?
> >
> it should be possible to use it for states 3 and 4.
>
> Lower state than 3 means that the dialog was not answered yet
> (no 200ok
> received). While SIP allows BYE at that stage to end a
> particular branch
> of the call, dialog module needs the 200ok, as it operates at
> dialog
> level, not at transaction/branch level.
>
> Cheers,
> Daniel
>
> -- 
> Daniel-Constantin Mierla -- www.asipto.com 
> www.twitter.com/miconda  --
> www.linkedin.com/in/miconda 
> Kamailio World Conference -- www.kamailioworld.com
> 
>
>
>

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

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


Re: [SR-Users] uri==myself

2018-07-19 Thread Daniel-Constantin Mierla
Hello,

things are different that one may expect from evaluation of an
expression compared with other established scripting/programming
languages. One thing to be sure you are aware of are the return code
evaluation:

  -
https://www.kamailio.org/wiki/tutorials/faq/main#how_is_the_function_return_cod

To be sure of proper behaviour, you should do:

if(uri =~ "" || uri == myself) {

$var(myself) =1;

} else {

$var(myself) = 0;

}

Same with is_myself("$ru") instead of uri == myself.

Try and see if you get different values for $var(myself).

Cheers,
Daniel

On 19.07.18 19:09, Karthik Srinivasan wrote:
> Yes, they are used at the very same place. here is a code snippet of
> where i added it for testing purposes:
>
>
> route[INIT_VARS] {
>
> $var(myself) = uri =~ "" || uri == myself;
> //if i print $var(myself) it prints 0 
> $var(myself) = uri =~ "" || is_myself("$ru");
> //if i print $var(myself) it prints 1 
>
> // in both cases above the regex part isn't supposed to match and
> hence correctly returns false.
> ...
>
> }
>
> route{
>
>    route(INIT_VARS);
>
> ...
> }
>
> Thanks,
>
> Karthik
>
> On Thu, Jul 19, 2018 at 11:46 AM, Daniel-Constantin Mierla
> mailto:mico...@gmail.com>> wrote:
>
> Hello,
>
>
> On 19.07.18 18:32, Karthik Srinivasan wrote:
> > Hello,
> >
> > Can someone explain to me why statement A returns True and
> statement B
> > returns False.
> >
> > Statement A:
> > is_myself("$ru")
> >
> > Statement B:
> > uri == myself
> >
> >
> > Isn't uri and $ru referencing the same data?   
> >
> > With my current config i am expecting the is_myself to return
> True;  i
> > was expecting the same for Statement B but unfortunately it is
> > returning False.
> >
> they are supposed to be the same in this case.
>
> Are they used at the same place in config? Note that $ru can be
> changed
> by different functions such as those from registrar, dispatcher,
> lcr, ...
>
> Cheers,
> Daniel
>
> -- 
> Daniel-Constantin Mierla -- www.asipto.com 
> www.twitter.com/miconda  --
> www.linkedin.com/in/miconda 
> Kamailio World Conference -- www.kamailioworld.com
> 
>
>

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

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


Re: [SR-Users] uri==myself

2018-07-19 Thread Karthik Srinivasan
Also,  the INIT_VARS route is the very first thing that executes within the
main routing block.

The case that i am interested in that results in one statement returning
false and the other true is for an INVITE.

I tried printing the uri variable but was unsuccessful in doing so.  Maybe
if that's the next best step, i can pursue that with some advice on how to
print that variable.

Thanks,

Karthik

On Thu, Jul 19, 2018 at 12:09 PM, Karthik Srinivasan  wrote:

> Yes, they are used at the very same place. here is a code snippet of where
> i added it for testing purposes:
>
>
> route[INIT_VARS] {
>
> $var(myself) = uri =~ "" || uri == myself;
> //if i print $var(myself) it prints 0
> $var(myself) = uri =~ "" || is_myself("$ru");
> //if i print $var(myself) it prints 1
>
> // in both cases above the regex part isn't supposed to match and hence
> correctly returns false.
> ...
>
> }
>
> route{
>
>route(INIT_VARS);
>
> ...
> }
>
> Thanks,
>
> Karthik
>
> On Thu, Jul 19, 2018 at 11:46 AM, Daniel-Constantin Mierla <
> mico...@gmail.com> wrote:
>
>> Hello,
>>
>>
>> On 19.07.18 18:32, Karthik Srinivasan wrote:
>> > Hello,
>> >
>> > Can someone explain to me why statement A returns True and statement B
>> > returns False.
>> >
>> > Statement A:
>> > is_myself("$ru")
>> >
>> > Statement B:
>> > uri == myself
>> >
>> >
>> > Isn't uri and $ru referencing the same data?
>> >
>> > With my current config i am expecting the is_myself to return True;  i
>> > was expecting the same for Statement B but unfortunately it is
>> > returning False.
>> >
>> they are supposed to be the same in this case.
>>
>> Are they used at the same place in config? Note that $ru can be changed
>> by different functions such as those from registrar, dispatcher, lcr, ...
>>
>> Cheers,
>> Daniel
>>
>> --
>> Daniel-Constantin Mierla -- www.asipto.com
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio World Conference -- www.kamailioworld.com
>>
>>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dialog module : questions about dialog states

2018-07-19 Thread Abdoul Osséni
ERRATUM.

What is the best way to end calls for states < 3 ?

Abdoul OSSENI
Ingénieur DevOps chez Néo-Soft
Co-Fondateur de ON SERVICES
Tél : +33 601 135 167

2018-07-19 19:19 GMT+02:00 Abdoul Osséni :

> Thank you Daniel.
> What is the best way to end calls for states 3 and 4 ?
>
> Regards
>
> Abdoul OSSENI
> Ingénieur DevOps chez Néo-Soft
> Co-Fondateur de ON SERVICES
> Tél : +33 601 135 167
>
> 2018-07-19 18:49 GMT+02:00 Daniel-Constantin Mierla :
>
>> Hello,
>>
>>
>> On 19.07.18 18:15, Abdoul Osséni wrote:
>> > Hello list,
>> >
>> > When the dialog state for a call is < 4, is it possible to use
>> > dlg_bye() function to end the call?
>> >
>> it should be possible to use it for states 3 and 4.
>>
>> Lower state than 3 means that the dialog was not answered yet (no 200ok
>> received). While SIP allows BYE at that stage to end a particular branch
>> of the call, dialog module needs the 200ok, as it operates at dialog
>> level, not at transaction/branch level.
>>
>> Cheers,
>> Daniel
>>
>> --
>> Daniel-Constantin Mierla -- www.asipto.com
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio World Conference -- www.kamailioworld.com
>>
>>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] uri==myself

2018-07-19 Thread Karthik Srinivasan
Yes, they are used at the very same place. here is a code snippet of where
i added it for testing purposes:


route[INIT_VARS] {

$var(myself) = uri =~ "" || uri == myself;
//if i print $var(myself) it prints 0
$var(myself) = uri =~ "" || is_myself("$ru");
//if i print $var(myself) it prints 1

// in both cases above the regex part isn't supposed to match and hence
correctly returns false.
...

}

route{

   route(INIT_VARS);

...
}

Thanks,

Karthik

On Thu, Jul 19, 2018 at 11:46 AM, Daniel-Constantin Mierla <
mico...@gmail.com> wrote:

> Hello,
>
>
> On 19.07.18 18:32, Karthik Srinivasan wrote:
> > Hello,
> >
> > Can someone explain to me why statement A returns True and statement B
> > returns False.
> >
> > Statement A:
> > is_myself("$ru")
> >
> > Statement B:
> > uri == myself
> >
> >
> > Isn't uri and $ru referencing the same data?
> >
> > With my current config i am expecting the is_myself to return True;  i
> > was expecting the same for Statement B but unfortunately it is
> > returning False.
> >
> they are supposed to be the same in this case.
>
> Are they used at the same place in config? Note that $ru can be changed
> by different functions such as those from registrar, dispatcher, lcr, ...
>
> Cheers,
> Daniel
>
> --
> Daniel-Constantin Mierla -- www.asipto.com
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio World Conference -- www.kamailioworld.com
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dialog module : questions about dialog states

2018-07-19 Thread Daniel-Constantin Mierla
Hello,


On 19.07.18 18:15, Abdoul Osséni wrote:
> Hello list,
>
> When the dialog state for a call is < 4, is it possible to use
> dlg_bye() function to end the call?
>
it should be possible to use it for states 3 and 4.

Lower state than 3 means that the dialog was not answered yet (no 200ok
received). While SIP allows BYE at that stage to end a particular branch
of the call, dialog module needs the 200ok, as it operates at dialog
level, not at transaction/branch level.

Cheers,
Daniel

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


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


Re: [SR-Users] uri==myself

2018-07-19 Thread Daniel-Constantin Mierla
Hello,


On 19.07.18 18:32, Karthik Srinivasan wrote:
> Hello,
>
> Can someone explain to me why statement A returns True and statement B
> returns False.
>
> Statement A:
> is_myself("$ru")
>
> Statement B:
> uri == myself
>
>
> Isn't uri and $ru referencing the same data?   
>
> With my current config i am expecting the is_myself to return True;  i
> was expecting the same for Statement B but unfortunately it is
> returning False.
>
they are supposed to be the same in this case.

Are they used at the same place in config? Note that $ru can be changed
by different functions such as those from registrar, dispatcher, lcr, ...

Cheers,
Daniel

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


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


Re: [SR-Users] Locking htable entries

2018-07-19 Thread Daniel-Constantin Mierla
Yes.

Daniel


On 19.07.18 14:18, Alex Balashov wrote:
> Oh, I see. So, if I understood correctly, the primary intended use-case is 
> really to make operations consisting of multiple accesses/writes atomic? 
>
> -- Alex
>
> --
> Sent via mobile, please forgive typos and brevity. 
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

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


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


[SR-Users] dialog module : questions about dialog states

2018-07-19 Thread Abdoul Osséni
Hello list,

When the dialog state for a call is < 4, is it possible to use dlg_bye()
function to end the call?

Best regards

Abdoul OSSENI
Ingénieur DevOps chez Néo-Soft
Co-Fondateur de ON SERVICES
Tél : +33 601 135 167
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] No cdr after Kamailio 5.0.4 and 5.2 dev restart

2018-07-19 Thread Kordován Szabolcs
Hello,

I have a test environment with Kamailio 5.1.4  where I can investigate the
bug.
After restart 'kamctl dialog show' command shows the present dialog. After
hangup kamailio does an insert into acc table and makes delete from dialog
and dialog_vars tables.

Any idea?

Thanks,
Szabolcs

Daniel-Constantin Mierla  ezt írta (időpont: 2017. dec.
4., H, 10:20):

> Hello,
>
> after restart, if you list the dialogs via rpc command, do you see them in
> what is returned?
>
> Cheers,
> Daniel
>
> On 29.11.17 20:52, Kordován Szabolcs wrote:
>
> Hi All,
>
> In March there was a discus about this issue.
>
> We tested the new 5.2 dev and 5.0.4 version of Kamailio and we experience
> that If we restart Kamailio during the call the cdr won't be stored in
> table acc_cdrs but the data will be inserted to table acc and data will be
> deleted from table dialog and dialog_vars.
> Did I omit the fix for it?
>
> Thanks for your help.
> Best regards,
> Szabolcs
>
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training - www.asipto.com
> Kamailio World Conference - May 14-16, 2018 - 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] Locking htable entries

2018-07-19 Thread Alex Balashov
Oh, I see. So, if I understood correctly, the primary intended use-case is 
really to make operations consisting of multiple accesses/writes atomic? 

-- Alex

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

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


Re: [SR-Users] Locking htable entries

2018-07-19 Thread Daniel-Constantin Mierla
... worth mentioning that locking for htable is re-entrant, so it is not
ending into a deadlock when doing:

 - lock slot for $sht(x=>y)

 - read/write $sht(x=>y)

 - unlock slot for $sht(x=>y)

But always do unlock if doing the lock explicitly.

Cheers,
Daniel

On 19.07.18 14:08, Daniel-Constantin Mierla wrote:
> Hello,
>
> readn and write operations are safe, done under mutex locking. So it is
> always safe to do:
>
> $sht(x=>y) = $var(y);
>
> or:
>
> $var(y) = $sht(x=>y);
>
> But there could be operations where you want that the value is not
> changed by another process while doing some operations, like: get the
> value from hash table, test it against some limit and act in different
> ways. For example, you keep active calls per user:
>
> if($sht(ac=>$fU) < 10) {
>    $sht(ac=>$fU) = $sht(ac=>$fU) + 1;
> } else {
>   sl_send_reply("403", "Too many calls");
> }
>
> From the moment you read for IF condition till the moment of increment,
> the CPU can be given to another kamailio process which does same
> operation, reading same value and at the end it gets incremented with 1
> instead with 2, obviously if the value was 9, then one call is allowed
> when it shouldn't be.
>
> So you have to protect the above example by locking the slot for
> $sht(ac=>$fU).
>
> This was a rather simple example, but hopefully clarifies when explicit
> sht lock/unlock is needed.
>
> Cheers,
> Daniel
>
> On 19.07.18 13:50, Alex Balashov wrote:
>> Hi,
>>
>> Sorry if this question has been answered before, but I'm rather puzzled
>> as to the intent behind sht_lock() / sht_unlock().
>>
>> Presumably, "thread"-safe / shm mutex locking is already implemented in
>> htable query and mutation operations, otherwise htable would be unusable in
>> a route script context. 
>>
>> So what is the purpose of this higher-level lock? Is it to create a way
>> to block config script execution in multiple processes as to serialise
>> operations? Why would one want to do this under any ordinary
>> circumstances? Perhaps it is a failure of my imagination...
>>
>> Thanks,
>>
>> -- Alex
>>

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


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


Re: [SR-Users] Locking htable entries

2018-07-19 Thread Daniel-Constantin Mierla
Hello,

readn and write operations are safe, done under mutex locking. So it is
always safe to do:

$sht(x=>y) = $var(y);

or:

$var(y) = $sht(x=>y);

But there could be operations where you want that the value is not
changed by another process while doing some operations, like: get the
value from hash table, test it against some limit and act in different
ways. For example, you keep active calls per user:

if($sht(ac=>$fU) < 10) {
   $sht(ac=>$fU) = $sht(ac=>$fU) + 1;
} else {
  sl_send_reply("403", "Too many calls");
}

From the moment you read for IF condition till the moment of increment,
the CPU can be given to another kamailio process which does same
operation, reading same value and at the end it gets incremented with 1
instead with 2, obviously if the value was 9, then one call is allowed
when it shouldn't be.

So you have to protect the above example by locking the slot for
$sht(ac=>$fU).

This was a rather simple example, but hopefully clarifies when explicit
sht lock/unlock is needed.

Cheers,
Daniel

On 19.07.18 13:50, Alex Balashov wrote:
> Hi,
>
> Sorry if this question has been answered before, but I'm rather puzzled
> as to the intent behind sht_lock() / sht_unlock().
>
> Presumably, "thread"-safe / shm mutex locking is already implemented in
> htable query and mutation operations, otherwise htable would be unusable in
> a route script context. 
>
> So what is the purpose of this higher-level lock? Is it to create a way
> to block config script execution in multiple processes as to serialise
> operations? Why would one want to do this under any ordinary
> circumstances? Perhaps it is a failure of my imagination...
>
> Thanks,
>
> -- Alex
>

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


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


[SR-Users] Locking htable entries

2018-07-19 Thread Alex Balashov
Hi,

Sorry if this question has been answered before, but I'm rather puzzled
as to the intent behind sht_lock() / sht_unlock().

Presumably, "thread"-safe / shm mutex locking is already implemented in
htable query and mutation operations, otherwise htable would be unusable in
a route script context. 

So what is the purpose of this higher-level lock? Is it to create a way
to block config script execution in multiple processes as to serialise
operations? Why would one want to do this under any ordinary
circumstances? Perhaps it is a failure of my imagination...

Thanks,

-- Alex

-- 
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] Module RTPPROXY param Timeout_Socket not Working

2018-07-19 Thread Hamid Hashmi
I started the RTPproxy with the following command.


/usr/bin/rtpproxy -u root -A [PUBLIC IP] -F -f -T 45 -i -2 -l 192.168.3.22 -b 
-m 35000 -M 65000 -s udp:127.0.0.1:7722 -n tcp:127.0.0.1:8000 -d DBUG



Regards


Hamid R. Hashmi

__

www.hrhashmi.blogspot.com

Mobile: +92 300 968 22 85 ; +92 322 636 32 66
Email: hamid.hashmi...@gmail.com; 
hamid2kv...@hotmail.com

Sype:  hamidrhashmi


From: sr-users  on behalf of Hamid Hashmi 

Sent: Thursday, July 19, 2018 12:59 PM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Module RTPPROXY param Timeout_Socket not Working


Kamailio didn't start listening on IP mentioned in Module RTPPROXY parameter 
Timeout_Socket.

Below is my configuration file.

loadmodule "rtpproxy.so"
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
modparam("rtpproxy", "rtpproxy_tout", 1)
modparam("rtpproxy", "rtpproxy_retr", 2)
modparam("rtpproxy", "timeout_socket", "xmlrpc:http://127.0.0.1:8000/RPC2;)

loadmodule "xmlrpc.so"
modparam("xmlrpc", "route", "XMLRPC");
modparam("xmlrpc", "mode", 1)
modparam("xmlrpc", "url_match", "^/RPC2")

when I type a command

$ netstat -nlp

it only shows SIP listening ports. Kamailio should also start listening on 
127.0.0.1:8000.

 Below are the RTPproxy logs, RTPproxy is also unable to bridge the media


DBUG:get_command:GLOBAL: received command "19083_4 Uc120,101 
9a1060af660d4202976c419ab5300470 58.65.176.42 4000 
1ea06d1eb0a8443697a08e568045598c;1"
INFO:rtpp_command_ul_handle:GLOBAL: new session 
9a1060af660d4202976c419ab5300470, tag 1ea06d1eb0a8443697a08e568045598c;1 
requested, type strong
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: new session on a 
port 35012 created, tag 1ea06d1eb0a8443697a08e568045598c;1
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: pre-filling 
caller's address with 58.65.176.42:4000
DBUG:rtpc_doreply:GLOBAL: sending reply "35012 51.38.201.3
"
DBUG:get_command:GLOBAL: received command "19083_5 Uc120,101 
9a1060af660d4202976c419ab5300470 58.65.176.42 4022 
9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq;1 1ea06d1eb0a8443697a08e568045598c;1 
xmlrpc:http://127.0.0.1:8000/RPC2;
INFO:rtpp_command_ul_handle:GLOBAL: new session 
9a1060af660d4202976c419ab5300470, tag 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq;1 
requested, type strong
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: new session on a 
port 35014 created, tag 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq;1
ERR:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: invalid socket 
name 1ea06d1eb0a8443697a08e568045598c;1
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: pre-filling 
caller's address with 58.65.176.42:4022
DBUG:rtpc_doreply:GLOBAL: sending reply "35014 51.38.201.3
"

DBUG:get_command:GLOBAL: received command "19086_4 D 
9a1060af660d4202976c419ab5300470 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq 
1ea06d1eb0a8443697a08e568045598c"
INFO:handle_delete:9a1060af660d4202976c419ab5300470: forcefully deleting 
session 1 on ports 35012/0
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTP stats: 0 in from 
callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTCP stats: 0 in from 
callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: session on ports 35012/0 
is cleaned up
INFO:handle_delete:9a1060af660d4202976c419ab5300470: forcefully deleting 
session 1 on ports 35014/0
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTP stats: 0 in from 
callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTCP stats: 0 in from 
callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: session on ports 35014/0 
is cleaned up
DBUG:rtpc_doreply:GLOBAL: sending reply "0
"
DBUG:get_command:GLOBAL: received command "19086_5 D 
9a1060af660d4202976c419ab5300470 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq 
1ea06d1eb0a8443697a08e568045598c"
INFO:handle_command:GLOBAL: delete request failed: session 
9a1060af660d4202976c419ab5300470, tags 
9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq/1ea06d1eb0a8443697a08e568045598c not found
DBUG:rtpc_doreply:GLOBAL: sending reply "E50

But if I comment out the param "Timeout_Socket" then there is no issue in 
bridging the media.


Regards

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


Re: [SR-Users] Options for SIP traffic duplicating to third party tcp port

2018-07-19 Thread Henning Westerholt
Am Mittwoch, 18. Juli 2018, 20:16:37 CEST schrieb Максим Баранов:
>  Hello, what are the options for duplicating sip traffic to arbitrary tcp
> port in Kamailio?

Hello,

have you already looked into the sipcapture module? From the README:

  "The sipcapture module stores incoming/outgoing SIP messages in 
  database. 

  Kamailio can capture SIP messages in three modes 
* IPIP encapsulation. (ETHHDR+IPHDR+IPHDR+UDPHDR). 
* Monitoring/mirroring port. 
* Homer encapsulation protocol mode (HEP v1, v2, v3)."

Best regards,

Henning


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


[SR-Users] Module RTPPROXY param Timeout_Socket not Working

2018-07-19 Thread Hamid Hashmi
Kamailio didn't start listening on IP mentioned in Module RTPPROXY parameter 
Timeout_Socket.

Below is my configuration file.

loadmodule "rtpproxy.so"
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
modparam("rtpproxy", "rtpproxy_tout", 1)
modparam("rtpproxy", "rtpproxy_retr", 2)
modparam("rtpproxy", "timeout_socket", "xmlrpc:http://127.0.0.1:8000/RPC2;)

loadmodule "xmlrpc.so"
modparam("xmlrpc", "route", "XMLRPC");
modparam("xmlrpc", "mode", 1)
modparam("xmlrpc", "url_match", "^/RPC2")

when I type a command

$ netstat -nlp

it only shows SIP listening ports. Kamailio should also start listening on 
127.0.0.1:8000.

 Below are the RTPproxy logs, RTPproxy is also unable to bridge the media


DBUG:get_command:GLOBAL: received command "19083_4 Uc120,101 
9a1060af660d4202976c419ab5300470 58.65.176.42 4000 
1ea06d1eb0a8443697a08e568045598c;1"
INFO:rtpp_command_ul_handle:GLOBAL: new session 
9a1060af660d4202976c419ab5300470, tag 1ea06d1eb0a8443697a08e568045598c;1 
requested, type strong
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: new session on a 
port 35012 created, tag 1ea06d1eb0a8443697a08e568045598c;1
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: pre-filling 
caller's address with 58.65.176.42:4000
DBUG:rtpc_doreply:GLOBAL: sending reply "35012 51.38.201.3
"
DBUG:get_command:GLOBAL: received command "19083_5 Uc120,101 
9a1060af660d4202976c419ab5300470 58.65.176.42 4022 
9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq;1 1ea06d1eb0a8443697a08e568045598c;1 
xmlrpc:http://127.0.0.1:8000/RPC2;
INFO:rtpp_command_ul_handle:GLOBAL: new session 
9a1060af660d4202976c419ab5300470, tag 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq;1 
requested, type strong
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: new session on a 
port 35014 created, tag 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq;1
ERR:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: invalid socket 
name 1ea06d1eb0a8443697a08e568045598c;1
INFO:rtpp_command_ul_handle:9a1060af660d4202976c419ab5300470: pre-filling 
caller's address with 58.65.176.42:4022
DBUG:rtpc_doreply:GLOBAL: sending reply "35014 51.38.201.3
"

DBUG:get_command:GLOBAL: received command "19086_4 D 
9a1060af660d4202976c419ab5300470 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq 
1ea06d1eb0a8443697a08e568045598c"
INFO:handle_delete:9a1060af660d4202976c419ab5300470: forcefully deleting 
session 1 on ports 35012/0
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTP stats: 0 in from 
callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTCP stats: 0 in from 
callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: session on ports 35012/0 
is cleaned up
INFO:handle_delete:9a1060af660d4202976c419ab5300470: forcefully deleting 
session 1 on ports 35014/0
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTP stats: 0 in from 
callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: RTCP stats: 0 in from 
callee, 0 in from caller, 0 relayed, 0 dropped
INFO:remove_session:9a1060af660d4202976c419ab5300470: session on ports 35014/0 
is cleaned up
DBUG:rtpc_doreply:GLOBAL: sending reply "0
"
DBUG:get_command:GLOBAL: received command "19086_5 D 
9a1060af660d4202976c419ab5300470 9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq 
1ea06d1eb0a8443697a08e568045598c"
INFO:handle_command:GLOBAL: delete request failed: session 
9a1060af660d4202976c419ab5300470, tags 
9RPsEBbcZSA23MmWAw0hfXzJ-bG1GYDq/1ea06d1eb0a8443697a08e568045598c not found
DBUG:rtpc_doreply:GLOBAL: sending reply "E50

But if I comment out the param "Timeout_Socket" then there is no issue in 
bridging the media.


Regards

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


[SR-Users] Options for SIP traffic duplicating to third party tcp port

2018-07-19 Thread Максим Баранов
 Hello, what are the options for duplicating sip traffic to arbitrary tcp
port in Kamailio?
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users