sip_route_uri
Created by Ryan Harris, last modified on 2018.02.08
sip_route_uri
string This sets where the INVITE packet should actually be sent to.
This should normally be needed in situations where the TO field contains a hostname which points back at itself, and would cause an endless loop if this variable is not set.
See also: FS-5349 -Authenticate to see issue details
Usage
Very simple usage, set during bridge immediately before the endpoint to bridge to:
bridge {sip_route_uri=sip:USER@HOSTNAME.or.IP.ADDRESS}
A real-life example where this was needed. It changes the Request-URI
and sends the INVITE packet to the correct destination by looking up the contact details for the registered endpoint. This is used to send an incoming call to a registered endpoint (PBX in this case) but set a Request-URI
so the call can be routed by the receiving party. Without the sip_route_uri
variable set, the call would loop back to FreeSWITCH endlessly until the originating party cancels the call. The incoming number routes to another extension, and exports the original dialled DDI (as dialled_ddi) so this can be used with this bridge command.
bridge {sip_route_uri=sip:${sofia_contact(${dialed_extension}@${domain_name})},sip_invite_req_uri=sip:${dialled_ddi}@${domain_name}}user/${user_data(${dialed_extension}@${domain_name} attr id)}@${domain_name}