[OpenSIPS-Devel] issue of get_redirects, serialize_branches and next_branche for rediect call scenarios
Răzvan Crainea
razvan at opensips.org
Tue Apr 24 08:20:07 EDT 2018
Hi, Di-Shi!
I don't think serialize_branches should still set the AVP, because it
will basically be a no-op. However, your logic is OK, and I agree this
is somehow hard to follow. But review-ing the code, I don't see why it
wouldn't work as it is... Are there any issues with the snippet below?
Because I think it should work just fine.
Best regards,
Răzvan
On 04/23/2018 06:03 PM, Di-Shi Sun via Devel wrote:
> All,
>
> We are testing OpenSIPS for simple redirect call scenarios. We expect
> OpenSIPS to try all Contact headers in the SIP 3xx respectively based on
> q value. For the SIP 3xx with multiple Contact headers, our
> configuration works fine. But for the SIP 3xx with one Contact header,
> it does not work.
>
> Configuration:
>
> failure_route[1] {
>
> if (t_check_status("3[0-9][0-9]")) {
>
> get_redirects("*");
>
> serialize_branches(1);
>
> next_branches();
>
> t_relay();
>
> }
>
> }
>
> From OpenSIPS source code, we know that
>
> 1. get_redirects puts the 1st Contact header URI into RURI,
> puts the 2nd Contact header URI into the 1st branch, etc.
>
> 2. serialize_branches sorts RURI and all branches, and puts
> them in a AVP.
>
> 3. next_branches extracts next hop from the AVP.
>
> When there are multiple Contact headers, all (get_redirects,
> serialize_branches and next_branch) work fine. When there is only one
> Contact header, get_redirects still works fine. But since there is not
> branch, serialize_branches does nothing especially does not set the AVP,
> then next_branches does nothing too since the AVP is empty.
>
> The questions are,
>
> 1. Should serialize_branches still set the AVP when there is
> one Contact header?
>
> 2. According the comments for next_branches, in failure
> route, all Contact headers should be mapped to branches. Then, is the
> behavior of get_redirects, which can only be called in failure route
> block, correct?
>
> If these are the designed behaviors, we can live on it. It is easy to
> write a working configuration.
>
> Thanks,
>
> Di-Shi Sun
>
> VoIP Routing, Accounting, Security
>
> www.TransNexus.com <http://www.transnexus.com/>
>
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
--
Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com
OpenSIPS Summit 2018
http://www.opensips.org/events/Summit-2018Amsterdam
More information about the Devel
mailing list