Giter VIP home page Giter VIP logo

Comments (5)

sauwming avatar sauwming commented on June 14, 2024 1

@TheQue42 , your explanation makes sense.

Based on the above description, I have tried to create a PR to fix the issue in #3823.

from pjproject.

andreas-wehrmann avatar andreas-wehrmann commented on June 14, 2024 1

So I've been running some more tests; the issues are:

  • Service-Route headers previously added are not removed if a subsequent response doesn't contain Service-Route headers. That is because of the check here:

    if (uri_cnt == 0)

    I believe this check can be removed altogether?

  • The other issue is: update_service_route() is only called if the request returns with a 2XX code, which means the Service-Route headers aren't cleared in case of an error response either; see:

    } else if (PJSIP_IS_STATUS_IN_CLASS(param->code, 200)) {

Also, thanks for your explanation @TheQue42
In my case the service provider seems to use the header to direct traffic towards certain proxies, but only under certain conditions which are out of my control.

from pjproject.

sauwming avatar sauwming commented on June 14, 2024

According to the RFC (https://datatracker.ietf.org/doc/html/rfc3608.html#section-6.1), you are correct:

If
   the UA refreshes the registration, the stored value of the Service-
   Route is updated according to the Service-Route header field of the
   latest 200 class response.  If there is no Service-Route header field
   in the response, the UA clears any service route for that address-
   of-record previously stored by the UA.  If the re-registration
   request is refused or if an existing registration expires and the UA
   chooses not to re-register, the UA SHOULD discard any stored service
   route for that address-of-record.

And we already did more or less the above, with the exception that we don't clear the outbound proxies:
https://github.com/pjsip/pjproject/blob/master/pjsip/src/pjsua-lib/pjsua_acc.c#L1993

  • /* Find and parse Service-Route headers */
  • /* Update account's route set
  • /* First remove all routes which are not the outbound proxies */
  • /* Then append the Service-Route URIs */

Not sure if we should remove the outbound proxies here.

from pjproject.

TheQue42 avatar TheQue42 commented on June 14, 2024

IMHO, since the Service-Route and outbound proxy config are two separate functions, I don't see why you would want to clear the outbound routes. At least since the original purpose of the service-route was to find the S-CSCF in an IMS network, and that shouldn't mean that you should all-of-sudden disregard the configuration on how to get "out of the local network", (since in IMS you must pass through the P-CSCF).

In my mind, if a "roaming" client received a "SIP default route" from a local/roaming network via DHCP, then that is the local network saying "you have to use this to get out of this network", and then having the home network(which shouldnt be able to know to much about a roaming network) override this with a service-route, seems counter-intuitive.

from pjproject.

sauwming avatar sauwming commented on June 14, 2024

Thank you @andreas-wehrmann . I have updated the PR based on your findings.

from pjproject.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.