I’m trying to modify/add some logic for data returned from a sip redirect. I cant seem to locate which route script file processes the contact header and then routes the call.
Hi
You need to use the redirect_routing.rb script.
Yes I know, that will setup the routing to the redirect server. However, what actual script processes the contact header in the reply from the redirect server?
ın the script, starting from the following line process the contact header.
if (contact_index == 0)
The reply from the redirect will miss that block as contact_index will be populated. There is no “Else” in that file.
Hi
You can use something like following
if (contact_index >= 1)
This section will be called for each contact
We need to create a new set of routes and not modify the original one, thus the cloning
newroutes =
routes = clone_routes params[:routes]
log_trace 1, "AAA routes = " + routes.inspect
log_trace 1, "New contact = " + contacts.inspect
contact_info = contacts[:list][contact_index][:sip_uri]
log_trace 2, "This contact index = " + contact_info.inspect
Extract the IP or domain from the 302 (will be different for each contact)
ipaddress = contacts[:list][contact_index][:sip_uri].match(/@(.*)/)
log_trace 2, "IP address found = " + ipaddress[1].inspect
If you need more help on scripting, you need to go with ProSBC and but 9x5 Professional Support hours.
Thanks! I see what you did there.