Re: [OpenSIPS-Users] OpenSIPS reseting issue with $T_fr_inv_timeout while forwarding

2017-09-01 Thread Ravi Patel
Dear Bogdan,

Apologize for the late reply.

I was checking my logic and your suggestions in lab.

Finally what my observation is,
1)
I set an avp variable in main route. say for example: $avp(test)=0

that I found it in failure_route and I am incrementing it by 1 and call
forwarded to OpenSIPS again.
Now in main route I am not able to get that variable, but yes when call
went again to failure_route on failure case , I got its value 1 and able to
increment it by 1.


2)
Second thing I found is:

Say for example my call scenarios is:
 -->  --Forward on No Answer-->  --Foraward on No Answer--> 

---

 ->  :  did not answer.
in Failure_route, I set append_hf("test: 1\r\n"); and call forwarded to
OpenSIPS again with $rU=.

 ->  :
In Main Route I am able to get its value.
* Now I use remove_hf("test"); before forwarding call to .
 did not pick up the call.
call lands on  failure_route.
in Failure_route, I set append_hf("test: 2\r\n"); and call forwarded to
OpenSIPS again with $rU=.

 ->  :
In Main Route when I fetch $hdr(test), I got the value 1 instead of 2. When
I check its SIP trace, I found two headers with name "test" with values 1
and 2.

--

So, remove_hf at * removes it from the OutBound SIP packet, but it is
not removed at failure_route.


I hope I explained well(It is a bit complex).

Let me know if you need anything else to debug it.

Regards,
Ravi Patel

On Wed, Aug 2, 2017 at 7:23 PM, Bogdan-Andrei Iancu 
wrote:

> Hi Ravi,
>
> I have to admit I did not understand your whole scenario, but you can read
> SIP headers in failure route, for sure. I think you are more fighting how
> the changes are done per-branch in OpenSIPS - whatever you change in
> request route (as changes) will be inherited by all branches/forks of that
> transaction. What you change in failure route will propagate only for that
> new branch.
>
> IF you want to count the number of serial forking attempts, better use an
> $avp(_name_) variable - you can init it to 0 in request route and increment
> it each time you do a new t_relay().
>
> Regards,
>
> Bogdan-Andrei Iancu
>   OpenSIPS Founder and Developer
>   http://www.opensips-solutions.com
>
> OpenSIPS Bootcamp 2017, Houston, US
>   http://opensips.org/training/OpenSIPS_Bootcamp_2017.html
>
> On 08/02/2017 11:46 AM, Ravi Patel wrote:
>
> Dear Bogdan and Ben,
> Thanks for your replies.
>
> Previously, I set t_on_failure() when forwarded call came back to
> OpenSIPS(not in failure_route) , Now after your suggestion I set
> *t_on_failure()* before *t_relay()* in *failure_route*.
>
> That Indeed solved the issue of forwarding and timeout, but faced another
> issue after this change.
>
> Here is the brief of issue:
>
> in failure_route, I fetched some *headers* from *SIP Message,* that
> checks the number of forwarding and if not exceeded max count, it proceed
> to forward the call(t_relay()).
> Now in this logic I added *t_on_failure()* before *t_relay()* , now here
> I am not able to get the headers from SIP Message in failure_route where I
> am checking the max forwarding count.
>
> Is there any way to get the headers in failure_route after using
> t_on_failure in failure_route ??
>
> Hope I explained well.
>
> Let me know If you need anything else from my side.
>
> Regards,
> Ravi Patel
>
> On Fri, Jul 28, 2017 at 9:09 PM, Ben Newlin 
> wrote:
>
>> Ravi,
>>
>>
>>
>> Are you sure you are arming the failure route after each step using
>> t_on_failure? It sounds like you are only doing this on the call to ,
>> which allows you to failover to . But when you send to  you have to
>> arm the failure route again.
>>
>>
>>
>> Ben Newlin
>>
>>
>>
>> *From: *Users  on behalf of Ravi Patel
>> 
>> *Reply-To: *OpenSIPS users mailling list 
>> *Date: *Friday, July 28, 2017 at 11:36 AM
>> *To: *Bogdan-Andrei Iancu 
>> *Cc: *OpenSIPS users mailling list 
>> *Subject: *Re: [OpenSIPS-Users] OpenSIPS reseting issue with
>> $T_fr_inv_timeout while forwarding
>>
>>
>>
>> Dear Bogdan,
>>
>> I am Grateful for your reply.
>>
>> I applied *$T_fr_inv_timeout* before doing each *t_relay().* by applying
>> it , I am able to achieve it at 1st forwarding but unfortunately not
>> working for 2nd forwarding.
>>
>> The scenario is:
>> 
>>  (fr_inv_timeout 10 sec)
>>  (fr_inv_timeout 5 sec)
>>  (fr_inv_timeout 20 sec)
>>
>> when  calls  : OpenSIPS generates CANCEL at 10 secs and forwards
>> call to 3333.
&

Re: [OpenSIPS-Users] Pending OpenSIPS minor release

2017-08-29 Thread Ravi Patel
Hi Razvan,

Thanks for your reply.

Apologize for asking in another thread.
It doesnot solve by putting t_on_failure("missed_call");
I will continue on the initial thread with the outcome.

Regards,
Ravi Patel

On Tue, Aug 29, 2017 at 1:08 PM, Răzvan Crainea  wrote:

> Hi, Ravi!
>
> I think Bogdan already responded you in this thread related to your
> problem[1]. This doesn't seem a bug it's just that you need to arm failure
> route inside failure_route for sequential failovers. Simply add
> t_on_failure("missed_call") before t_relay().
>
> For further  discussions, please reply to the initial thread, to avoid
> poluting the release one.
>
> [1] http://lists.opensips.org/pipermail/users/2017-July/037813.html
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Solutionswww.opensips-solutions.com
>
> On 08/29/2017 09:26 AM, Ravi Patel wrote:
>
> Hi Team,
> I would like to add this issue to be taken care.
>
> I am facing issue with the Call Forwarding.
> I tried with the basic default config file of OpenSIPS.
>
> What I want to achieve is multi level forwarding.
> For EX:  --> (forward on NOANSWER) --> (Forward on NOANSWER)
> --> 
>
> Please find the below failure_route
> failure_route[missed_call] {
> if (t_was_cancelled()) {
> exit;
> }
>
> if($rU == "")
> {
> $ru = "sip:3...@xxx.xxx.xxx.xxx"
> ; # It will dial  when  fails
> }
> else
> {
> $ru = "sip:4...@xxx.xxx.xxx.xxx"
> ; # It will dial  when  fails
> }
> t_relay();
> }
>
>
> So, Here  --calls-->  --Forward on no answer -->  --Forward on
> no answer --> .
> default timeout is 30 secs.
>
>  to : NOANSWER at 30 sec forwarded to 
> to : NOANSWER at 30 sec forwarded to 
> to : immidiately CANCEL the request, does not wait for timeout.
>
> At SIP client I found a quick miss call only,Here Timeout fails.
>
> Is this the default behaviour of OpenSIPS??
> or Do I need to modify something in config to achieve 2nd level forwarding?
> I have tested it with OpenSIPS 2.2.3 and 2.3.0
>
> Please Guide.
>
>
> Thanks,
> Ravi Patel
>
> On Mon, Aug 28, 2017 at 8:10 PM, Liviu Chircu  wrote:
>
>> Hi all,
>>
>> An OpenSIPS 2.3 minor release bump has been scheduled for Thursday, Aug
>> 31st. If you happen to have any GitHub OpenSIPS issues or mailing list bug
>> threads that have not been answered yet, please let us know as soon as
>> possible so they make it onto the fix checklist.
>>
>> Best regards,
>>
>> --
>> Liviu Chircu
>> OpenSIPS Developer
>> http://www.opensips-solutions.com
>>
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Pending OpenSIPS minor release

2017-08-28 Thread Ravi Patel
Hi Team,
I would like to add this issue to be taken care.

I am facing issue with the Call Forwarding.
I tried with the basic default config file of OpenSIPS.

What I want to achieve is multi level forwarding.
For EX:  --> (forward on NOANSWER) --> (Forward on NOANSWER)
--> 

Please find the below failure_route
failure_route[missed_call] {
if (t_was_cancelled()) {
exit;
}

if($rU == "")
{
$ru = "sip:3...@xxx.xxx.xxx.xxx"; # It will dial  when
 fails
}
else
{
$ru = "sip:4...@xxx.xxx.xxx.xxx"; # It will dial  when
 fails
}
t_relay();
}


So, Here  --calls-->  --Forward on no answer -->  --Forward on
no answer --> .
default timeout is 30 secs.

 to : NOANSWER at 30 sec forwarded to 
to : NOANSWER at 30 sec forwarded to 
to : immidiately CANCEL the request, does not wait for timeout.

At SIP client I found a quick miss call only,Here Timeout fails.

Is this the default behaviour of OpenSIPS??
or Do I need to modify something in config to achieve 2nd level forwarding?
I have tested it with OpenSIPS 2.2.3 and 2.3.0

Please Guide.


Thanks,
Ravi Patel

On Mon, Aug 28, 2017 at 8:10 PM, Liviu Chircu  wrote:

> Hi all,
>
> An OpenSIPS 2.3 minor release bump has been scheduled for Thursday, Aug
> 31st. If you happen to have any GitHub OpenSIPS issues or mailing list bug
> threads that have not been answered yet, please let us know as soon as
> possible so they make it onto the fix checklist.
>
> Best regards,
>
> --
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSIPS reseting issue with $T_fr_inv_timeout while forwarding

2017-08-02 Thread Ravi Patel
Dear Bogdan and Ben,
Thanks for your replies.

Previously, I set t_on_failure() when forwarded call came back to
OpenSIPS(not in failure_route) , Now after your suggestion I set
*t_on_failure()* before *t_relay()* in *failure_route*.

That Indeed solved the issue of forwarding and timeout, but faced another
issue after this change.

Here is the brief of issue:

in failure_route, I fetched some *headers* from *SIP Message,* that checks
the number of forwarding and if not exceeded max count, it proceed to
forward the call(t_relay()).
Now in this logic I added *t_on_failure()* before *t_relay()* , now here I
am not able to get the headers from SIP Message in failure_route where I am
checking the max forwarding count.

Is there any way to get the headers in failure_route after using
t_on_failure in failure_route ??

Hope I explained well.

Let me know If you need anything else from my side.

Regards,
Ravi Patel

On Fri, Jul 28, 2017 at 9:09 PM, Ben Newlin  wrote:

> Ravi,
>
>
>
> Are you sure you are arming the failure route after each step using
> t_on_failure? It sounds like you are only doing this on the call to ,
> which allows you to failover to . But when you send to  you have to
> arm the failure route again.
>
>
>
> Ben Newlin
>
>
>
> *From: *Users  on behalf of Ravi Patel <
> ravi.pa...@ecosmob.com>
> *Reply-To: *OpenSIPS users mailling list 
> *Date: *Friday, July 28, 2017 at 11:36 AM
> *To: *Bogdan-Andrei Iancu 
> *Cc: *OpenSIPS users mailling list 
> *Subject: *Re: [OpenSIPS-Users] OpenSIPS reseting issue with
> $T_fr_inv_timeout while forwarding
>
>
>
> Dear Bogdan,
>
> I am Grateful for your reply.
>
> I applied *$T_fr_inv_timeout* before doing each *t_relay().* by applying
> it , I am able to achieve it at 1st forwarding but unfortunately not
> working for 2nd forwarding.
>
> The scenario is:
> 
>  (fr_inv_timeout 10 sec)
>  (fr_inv_timeout 5 sec)
>  (fr_inv_timeout 20 sec)
>
> when  calls  : OpenSIPS generates CANCEL at 10 secs and forwards
> call to .
> now -->  : OpenSIPS generates CANCEL at 5 secs but does not forward
> call to  instead it sends *408 to Caller()* and drops call.
>
> I am attaching packets where sip.client.com refers to the SIP clients and
> sip.server.com refers to the OpenSIPS Server.
>
> Also find the attached snapshots of the call flow.
>
> Please guide what can be done or where I am doing wrong ?
>
> Let me know if you need any other information.
>
> Best Regards,
>
> Ravi Patel
>
>
>
>
>
>
>
>
>
> On Tue, Jul 25, 2017 at 9:07 PM, Bogdan-Andrei Iancu 
> wrote:
>
> Hi Ravi,
>
> Before each t_rely() you have to set the your custom $T_fr_inv_timeout and
> $T_fr_timeout, otherwise the default values will be used.  As you have a
> serial forking scenario, you do a new t_relay() at each step.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
>   OpenSIPS Founder and Developer
>
>   http://www.opensips-solutions.com
>
>
>
> OpenSIPS Bootcamp 2017, Houston, US
>
>   http://opensips.org/training/OpenSIPS_Bootcamp_2017.html
>
> On 07/25/2017 05:34 PM, Ravi Patel wrote:
>
> Hi Team,
>
> What is the right way to reset timers *$T_fr_inv_timeout* and
> *$T_fr_timeout* ??
>
> I am using OpenSIPS-2.2 version
> The below scenario will help to understand issue,
>
> There are 4 SIP users,
> ,,,
>
> What I want to achieve is:
>  --->  (FORWARD ON NOANSWER) --->  (FORWARD ON NOANSWER) --->
> 
>
> *1st Test Case Scenario:*
>
> 
>  (fr_inv_timeout 20 sec)
>  (fr_inv_timeout 25 sec)
>  (fr_inv_timeout 30 sec)
>
>
> when  calls  : OpenSIPS generates CANCEL at 20 secs (thats working
> proper as expexted) and forwards call to  as per my configuration.
> so in -->  : OpenSIPS generates CANCEL at *20 secs instead of 25 secs*
> and send 408 to . and not processing the 2nd forwarding.
>
> *2nd Test Case Scenario:*
> 
>  (fr_inv_timeout 20 sec)
>  (fr_inv_timeout 15 sec)
>  (fr_inv_timeout 30 sec)
>
> when  calls  : OpenSIPS generates CANCEL at 20 secs (that is
> working proper as expexted) and forwards call to  as per my
> configuration.
> now -->  : OpenSIPS generates CANCEL at 15 secs and forwards the call
> to , Here OpenSIPS generates CANCEL *after 5 secs instead of 30 secs.*
>
>
> We set timeout by using $T_fr_inv_timeout.
> 
> route[ring_timeout]{
> xlog("L_INFO","--- RING_TIMEOUT
> ---\n");
> if (!is_method("

Re: [OpenSIPS-Users] OpenSIPS reseting issue with $T_fr_inv_timeout while forwarding

2017-08-01 Thread Ravi Patel
Dear Bogdan and Ben,
Thanks for your replies.

Previously, I set t_on_failure() when forwarded call came back to
OpenSIPS(not in failure_route) , Now after your suggestion I set
*t_on_failure()* before *t_relay()* in *failure_route*.

That Indeed solved the issue of forwarding and timeout, but faced another
issue after this change.

Here is the brief of issue:

in failure_route, I fetched some *headers* from *SIP Message,* that checks
the number of forwarding and if not exceeded max count, it proceed to
forward the call(t_relay()).
Now in this logic I added *t_on_failure()* before *t_relay()* , now here I
am not able to get the headers from SIP Message in failure_route where I am
checking the max forwarding count.

Is there any way to get the headers in failure_route after using
t_on_failure in failure_route ??

Hope I explained well.

Let me know If you need anything else from my side.

Regards,
Ravi Patel

On Fri, Jul 28, 2017 at 4:12 PM, Bogdan-Andrei Iancu 
wrote:

> Hello Ravi,
>
> It looks like the failed call to  has no failure route set (this is
> why you directly get the 408 default timeout, as there is no failure route
> to handle the timeout event). Are you sure you t_on_failure() for each call
> attempt (especially when handling the call failure to ) ?
>
> Best regards,
>
> Bogdan-Andrei Iancu
>   OpenSIPS Founder and Developer
>   http://www.opensips-solutions.com
>
> OpenSIPS Bootcamp 2017, Houston, US
>   http://opensips.org/training/OpenSIPS_Bootcamp_2017.html
>
> On 07/26/2017 04:35 PM, Ravi Patel wrote:
>
> Dear Bogdan,
>
> I am Grateful for your reply.
>
> I applied *$T_fr_inv_timeout* before doing each *t_relay().* by applying
> it , I am able to achieve it at 1st forwarding but unfortunately not
> working for 2nd forwarding.
>
> The scenario is:
> 
>  (fr_inv_timeout 10 sec)
>  (fr_inv_timeout 5 sec)
>  (fr_inv_timeout 20 sec)
>
> when  calls  : OpenSIPS generates CANCEL at 10 secs and forwards
> call to .
> now -->  : OpenSIPS generates CANCEL at 5 secs but does not forward
> call to  instead it sends *408 to Caller()* and drops call.
>
> I am attaching packets where sip.client.com refers to the SIP clients and
> sip.server.com refers to the OpenSIPS Server.
>
> Also find the attached snapshots of the call flow.
>
> Please guide what can be done or where I am doing wrong ?
> Let me know if you need any other information.
>
> Best Regards,
> Ravi Patel
>
>
>
>
> On Tue, Jul 25, 2017 at 9:07 PM, Bogdan-Andrei Iancu 
> wrote:
>
>> Hi Ravi,
>>
>> Before each t_rely() you have to set the your custom $T_fr_inv_timeout
>> and $T_fr_timeout, otherwise the default values will be used.  As you have
>> a serial forking scenario, you do a new t_relay() at each step.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>   OpenSIPS Founder and Developer
>>   http://www.opensips-solutions.com
>>
>> OpenSIPS Bootcamp 2017, Houston, US
>>   http://opensips.org/training/OpenSIPS_Bootcamp_2017.html
>>
>> On 07/25/2017 05:34 PM, Ravi Patel wrote:
>>
>> Hi Team,
>>
>> What is the right way to reset timers *$T_fr_inv_timeout* and
>> *$T_fr_timeout* ??
>>
>> I am using OpenSIPS-2.2 version
>> The below scenario will help to understand issue,
>>
>> There are 4 SIP users,
>> ,,,
>>
>> What I want to achieve is:
>>  --->  (FORWARD ON NOANSWER) --->  (FORWARD ON NOANSWER) --->
>> 
>>
>> *1st Test Case Scenario:*
>>
>> 
>>  (fr_inv_timeout 20 sec)
>>  (fr_inv_timeout 25 sec)
>>  (fr_inv_timeout 30 sec)
>>
>>
>> when  calls  : OpenSIPS generates CANCEL at 20 secs (thats
>> working proper as expexted) and forwards call to  as per my
>> configuration.
>> so in -->  : OpenSIPS generates CANCEL at *20 secs instead of 25
>> secs* and send 408 to . and not processing the 2nd forwarding.
>>
>> *2nd Test Case Scenario:*
>> 
>>  (fr_inv_timeout 20 sec)
>>  (fr_inv_timeout 15 sec)
>>  (fr_inv_timeout 30 sec)
>>
>> when  calls  : OpenSIPS generates CANCEL at 20 secs (that is
>> working proper as expexted) and forwards call to  as per my
>> configuration.
>> now -->  : OpenSIPS generates CANCEL at 15 secs and forwards the call
>> to , Here OpenSIPS generates CANCEL *after 5 secs instead of 30
>> secs.*
>>
>>
>> We set timeout by using $T_fr_inv_timeout.
>> 
>> route[ring_timeout]{
>> xlog("L_I

[OpenSIPS-Users] OpenSIPS reseting issue with $T_fr_inv_timeout while forwarding

2017-07-25 Thread Ravi Patel
Hi Team,

What is the right way to reset timers *$T_fr_inv_timeout* and
*$T_fr_timeout* ??

I am using OpenSIPS-2.2 version
The below scenario will help to understand issue,

There are 4 SIP users,
,,,

What I want to achieve is:
 --->  (FORWARD ON NOANSWER) --->  (FORWARD ON NOANSWER) --->


*1st Test Case Scenario:*


 (fr_inv_timeout 20 sec)
 (fr_inv_timeout 25 sec)
 (fr_inv_timeout 30 sec)


when  calls  : OpenSIPS generates CANCEL at 20 secs (thats working
proper as expexted) and forwards call to  as per my configuration.
so in -->  : OpenSIPS generates CANCEL at *20 secs instead of 25 secs*
and send 408 to . and not processing the 2nd forwarding.

*2nd Test Case Scenario:*

 (fr_inv_timeout 20 sec)
 (fr_inv_timeout 15 sec)
 (fr_inv_timeout 30 sec)

when  calls  : OpenSIPS generates CANCEL at 20 secs (that is
working proper as expexted) and forwards call to  as per my
configuration.
now -->  : OpenSIPS generates CANCEL at 15 secs and forwards the call
to , Here OpenSIPS generates CANCEL *after 5 secs instead of 30 secs.*


We set timeout by using $T_fr_inv_timeout.

route[ring_timeout]{
xlog("L_INFO","--- RING_TIMEOUT
---\n");
if (!is_method("INVITE"))
return;
avp_db_load("$rU","$avp(ringtimeout)/usr_preferences");
if($avp(ringtimeout)!=null)
{
$T_fr_inv_timeout = NULL;
xlog("L_INFO","$rU: Ring timeout :
$avp(ringtimeout)");
$T_fr_inv_timeout =$(avp(ringtimeout){s.int}) ;
xlog("L_INFO","$rU: Ring timeout is setted:
[$T_fr_inv_timeout]");
}
else
{
xlog("L_INFO","$rU: Ring timeout is NOT setted");
}
}
--

>From both the scenarios what we found, it sticks to the first timeout of
,that is 20secs in our case.
In first scenario it generates CANCEL on  at 20 secs instead of 25 that
is 's Timeout.
In second scenario it generates CANCEL on  at 15sec and on  at 5
sec (15 + 5 = 20 sec) that is also 's timeout.


Can I know the right method to set $T_fr_inv_timeout ?

Let me know if any other information is needed.


Thanks,
Ravi
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users