Re: [OpenSIPS-Users] question about rtpengine_manage() in failure_route

2020-06-14 Thread William Jin
Hi Razvan,

Many thanks for your advice.

Yes, I can confirm the branch_route did the trick.

--
Regards,
William Jin

From: Users  on behalf of Răzvan Crainea 

Sent: Wednesday, 10 June 2020 5:59 PM
To: users@lists.opensips.org 
Subject: Re: [OpenSIPS-Users] question about rtpengine_manage() in failure_route


Hi, William!


Make sure you call rtpengine_manage() in branch route, not in the request 
route, otherwise all the changes will be inherited throughout all the branches 
further created.


Best regards,

Răzvan


On 6/9/20 7:04 AM, William Jin wrote:
Below is a short config example.

route {
...
setflag(CallFWD);
rtpengine_manage();  #say the first call attempt need rtpengine
t_on_failure("handle_failure");
r_relay();
...
}


failure_route[handle_failure] {
...
if (isflagset(CallFWD)){route(handle_callfwd);}
...
}

route[handle_callfwd]{
...
xlog("L_INFO","RB=$rb(application/sdp)");
if (t_relay()){
xlog("L_INFO","Stateful relay done. RB=$rb(application/sdp)");
}
...
}

Looks like the t_relay in the handle_callfwd will inherit the SDP info that 
rtpengine_manage entered in the first attempt.

Also, another interesting fact is that the SDP info is added while the t_relay 
is called. Looks like the t_relay is using its data in memory and re-write the 
SDP. the  $rb(application/sdp) is not changed until the t_relay is called.

How can I, for example, remove the rtpengine related SDP for the second INVITE 
generated by the failure_route?
I tried rtpengine_delete() in handle_callfwd or rtpengine_manage() in the 
failure_route which suppose to do rtpengine_delete also, but they don't work as 
expected.

Thanks in advance.


--
Regards,
William Jin

From: Users 
<mailto:users-boun...@lists.opensips.org> on 
behalf of William Jin <mailto:willi...@exetel.com.au>
Sent: Tuesday, 9 June 2020 9:09 AM
To: OpenSIPS users mailling list 
<mailto:users@lists.opensips.org>
Subject: [OpenSIPS-Users] question about rtpengine_manage() in failure_route

Hi All

May I know how can I rewrite the SDP (rtpengine) in the failure route?

The scenario is we use rtpengine_manage() in the first call attempt, if it 
fails, it uses failure_route, however, we want to change the SDP info.

For example, the call's first attempt is to an ipv6 UAC, when failed, we try 
ipv4 UAC. We need to change the rtpengine address-family to IP4 so the c= line 
can follow with an IPv4 address.

We tried to use rtpengine_manage("address-family=IP4"), but looks like the SDP 
still not changed.

Does anyone have any idea about this? Or is there any other way to achieve this?



--
Regards,
William Jin



___
Users mailing list
Users@lists.opensips.org<mailto: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] question about rtpengine_manage() in failure_route

2020-06-10 Thread Răzvan Crainea

Hi, William!


Make sure you call rtpengine_manage() in branch route, not in the 
request route, otherwise all the changes will be inherited throughout 
all the branches further created.



Best regards,

Răzvan


On 6/9/20 7:04 AM, William Jin wrote:

Below is a short config example.

route {
...
setflag(CallFWD);
rtpengine_manage();  #say the first call attempt need rtpengine
t_on_failure("handle_failure");
r_relay();
...
}


failure_route[handle_failure] {
...
if (isflagset(CallFWD)){route(handle_callfwd);}
...
}

route[handle_callfwd]{
...
xlog("L_INFO","RB=$rb(application/sdp)");
if (t_relay()){
xlog("L_INFO","Stateful relay done. RB=$rb(application/sdp)");
}
...
}

Looks like the t_relay in the handle_callfwd will inherit the SDP info 
that rtpengine_manage entered in the first attempt.


Also, another interesting fact is that the SDP info is added while the 
t_relay is called. Looks like the t_relay is using its data in memory 
and re-write the SDP. the $rb(application/sdp) is not changed until 
the t_relay is called.


How can I, for example, remove the rtpengine related SDP for the 
second INVITE generated by the failure_route?
I tried rtpengine_delete() in handle_callfwd or rtpengine_manage() in 
the failure_route which suppose to do rtpengine_delete also, but they 
don't work as expected.


Thanks in advance.


--
Regards,
William Jin

*From:* Users  on behalf of William 
Jin 

*Sent:* Tuesday, 9 June 2020 9:09 AM
*To:* OpenSIPS users mailling list 
*Subject:* [OpenSIPS-Users] question about rtpengine_manage() in 
failure_route

Hi All

May I know how can I rewrite the SDP (rtpengine) in the failure route?

The scenario is we use rtpengine_manage() in the first call attempt, 
if it fails, it uses failure_route, however, we want to change the SDP 
info.


For example, the call's first attempt is to an ipv6 UAC, when failed, 
we try ipv4 UAC. We need to change the rtpengine address-family to IP4 
so the c= line can follow with an IPv4 address.


We tried to use rtpengine_manage("address-family=IP4"), but looks like 
the SDP still not changed.


Does anyone have any idea about this? Or is there any other way to 
achieve this?




--
Regards,
William Jin

___
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] question about rtpengine_manage() in failure_route

2020-06-08 Thread William Jin
Below is a short config example.

route {
...
setflag(CallFWD);
rtpengine_manage();  #say the first call attempt need rtpengine
t_on_failure("handle_failure");
r_relay();
...
}


failure_route[handle_failure] {
...
if (isflagset(CallFWD)){route(handle_callfwd);}
...
}

route[handle_callfwd]{
...
xlog("L_INFO","RB=$rb(application/sdp)");
if (t_relay()){
xlog("L_INFO","Stateful relay done. RB=$rb(application/sdp)");
}
...
}

Looks like the t_relay in the handle_callfwd will inherit the SDP info that 
rtpengine_manage entered in the first attempt.

Also, another interesting fact is that the SDP info is added while the t_relay 
is called. Looks like the t_relay is using its data in memory and re-write the 
SDP. the  $rb(application/sdp) is not changed until the t_relay is called.

How can I, for example, remove the rtpengine related SDP for the second INVITE 
generated by the failure_route?
I tried rtpengine_delete() in handle_callfwd or rtpengine_manage() in the 
failure_route which suppose to do rtpengine_delete also, but they don't work as 
expected.

Thanks in advance.


--
Regards,
William Jin

From: Users  on behalf of William Jin 

Sent: Tuesday, 9 June 2020 9:09 AM
To: OpenSIPS users mailling list 
Subject: [OpenSIPS-Users] question about rtpengine_manage() in failure_route

Hi All

May I know how can I rewrite the SDP (rtpengine) in the failure route?

The scenario is we use rtpengine_manage() in the first call attempt, if it 
fails, it uses failure_route, however, we want to change the SDP info.

For example, the call's first attempt is to an ipv6 UAC, when failed, we try 
ipv4 UAC. We need to change the rtpengine address-family to IP4 so the c= line 
can follow with an IPv4 address.

We tried to use rtpengine_manage("address-family=IP4"), but looks like the SDP 
still not changed.

Does anyone have any idea about this? Or is there any other way to achieve this?



--
Regards,
William Jin
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] question about rtpengine_manage() in failure_route

2020-06-08 Thread William Jin
Hi All

May I know how can I rewrite the SDP (rtpengine) in the failure route?

The scenario is we use rtpengine_manage() in the first call attempt, if it 
fails, it uses failure_route, however, we want to change the SDP info.

For example, the call's first attempt is to an ipv6 UAC, when failed, we try 
ipv4 UAC. We need to change the rtpengine address-family to IP4 so the c= line 
can follow with an IPv4 address.

We tried to use rtpengine_manage("address-family=IP4"), but looks like the SDP 
still not changed.

Does anyone have any idea about this? Or is there any other way to achieve this?



--
Regards,
William Jin
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users