Telcobridges - Session Border Controllers
Would you like to react to this message? Create an account in a few clicks or log in to continue.

What script processes the contact headers returned from a redirect request?

2 posters

Go down

What script processes the contact headers returned from a redirect request?   Empty What script processes the contact headers returned from a redirect request?

Post by irubado Thu Mar 03, 2022 9:14 pm

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.

irubado

Number of Messages : 4
Point : 6
Registration Date : 2022-02-24

Back to top Go down

What script processes the contact headers returned from a redirect request?   Empty Re: What script processes the contact headers returned from a redirect request?

Post by Admin Fri Mar 04, 2022 1:32 am

Hi

You need to use the redirect_routing.rb script.

Admin
Admin

Number of Messages : 470
Point : 1119
Registration Date : 2017-11-27

http://freesbc.yetkinforum.com

Back to top Go down

What script processes the contact headers returned from a redirect request?   Empty Re: What script processes the contact headers returned from a redirect request?

Post by irubado Fri Mar 04, 2022 1:40 am

Admin wrote: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?

irubado

Number of Messages : 4
Point : 6
Registration Date : 2022-02-24

Back to top Go down

What script processes the contact headers returned from a redirect request?   Empty Re: What script processes the contact headers returned from a redirect request?

Post by Admin Fri Mar 04, 2022 1:43 am

ın the script, starting from the following line process the contact header.

if (contact_index == 0)

Admin
Admin

Number of Messages : 470
Point : 1119
Registration Date : 2017-11-27

http://freesbc.yetkinforum.com

Back to top Go down

What script processes the contact headers returned from a redirect request?   Empty Re: What script processes the contact headers returned from a redirect request?

Post by irubado Fri Mar 04, 2022 2:00 am

Admin wrote:ı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.

irubado

Number of Messages : 4
Point : 6
Registration Date : 2022-02-24

Back to top Go down

What script processes the contact headers returned from a redirect request?   Empty Re: What script processes the contact headers returned from a redirect request?

Post by Admin Fri Mar 04, 2022 2:21 am

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.

Admin
Admin

Number of Messages : 470
Point : 1119
Registration Date : 2017-11-27

http://freesbc.yetkinforum.com

Back to top Go down

What script processes the contact headers returned from a redirect request?   Empty Re: What script processes the contact headers returned from a redirect request?

Post by irubado Fri Mar 04, 2022 2:41 am

Admin wrote:Hi

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. Very Happy

irubado

Number of Messages : 4
Point : 6
Registration Date : 2022-02-24

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum