[Devel] possibility to access dst_uri
Daniel-Constantin Mierla
daniel at voice-system.ro
Fri Aug 26 20:33:03 CEST 2005
Hello,
latest openser version from cvs includes a set of new functions (core
and avpops) and pseudo-variable which allow to access and manage the
value of dst_uri.
The dst_uri field contains the address of the next hop, when the routing
does not follow R-URI address. Such cases are Route header driven
routing (dst_uri is set after loose_route() to the value of next Route
header), contacts behind nat (dst_uri is set to the address of nat after
lookup("location")) or dispatcher usage. The dst_uri has higher priority
in routing over R-URI but less than explicit parameters in relaying
functions (e.g., t_relay_to*()).
The field was invisible from the script but it proved in the discussions
on the mailing list to be important to access it. For example, to detect
whether the caller and callee are behind same nat. Also, it can be
checked in case of preloaded Route header to secure relaying to special
resources (e.g., pstn gateway). With the new branch_route the value of
dst_uri can be checked for each branch.
A short summary of what was added:
* core functions:
- setdsturi("uri") - set the value of dst_uri
- resetdsturi() - reset the value of dst_uri
- isdsturiset() - test if the value of dst_uri is null
* pseudo-variables
- $du - value of dst_uri (added long time ago)
- $dd - domain of dst_uri
- $dp - port of dst_uri
- $dP - transport protocol of dst_uri
* avpops changes
- avp_write() can read the value of dst_uri and write it in an avp
- avp_pushto() can write the value of an avp in dst_uri
Tutorials and dokuwiki will be updated soon.
Daniel
More information about the Devel
mailing list