Currently local_route doesn't allow the Request-URI not the destination URI to be changed, which is probably OK for many cases but I came across a case in which I can't solve a routing problem without setting the $du in the local_route.
Scenario is as follows:
Alice <--> P1 <--> P2 <--> Bob
Alice and Bob belong to the same domain and are both registered on P2. P2 alo has dialog ping feature enabled.
Alice happens to use GRUU, so her Contact header's URI looks like this: sip:email@example.com;gr=1234567890
When P2 generates the in-dialog OPTIONS request for Alice, it will contain Alice's GRUU as the RURI and P1 in a Route header. Because P2 is Alice's registrar, P1 will not know how to route that request.
A workaround for this situation which doesn't require (presumably) complex changes is to self-forward the OPTIONS request in P2, then in the main routing block to a lookup() to get the real location of Alice, and loose_route(). This way, P1 will get the packet with Alice's received contact in the RURI and will know how to route it.
Self forwarding could be avoided if lookup() was allowed in the local_route, but I didn't want to go that far.
The attached patch allows $ru and $du to be changed in the local_route to be able to deal with the scenario described above.
Saúl Ibarra Corretgé
Log in to post a comment.