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

enabling user=phone on sip invite

Go down

enabling user=phone on sip invite Empty enabling user=phone on sip invite

Post by Guest Thu Apr 22, 2021 4:27 am

Hi,

Please can you assist? One of our providers requested that we enable user=phone on our sip invite. We saw it is possible from TBwiki but cannot figure out where and how to enable it. We just need it for one NAP. The example they give looks like this:
enabling user=phone on sip invite 115

Our invite looking like this:
enabling user=phone on sip invite 213

Please can you assist?

Thanks.

Guest
Guest


Back to top Go down

enabling user=phone on sip invite Empty Re: enabling user=phone on sip invite

Post by Guest Thu Apr 22, 2021 4:29 am

Hi,

There is a new script “sip_header_params.rb” filter script in the routing scripts section in the web portal, that is available to add user=phone to RURI, for details you could take a look at the comments inside the script, for self-explanatory instructions.


Best regards,

Guest
Guest


Back to top Go down

enabling user=phone on sip invite Empty Re: enabling user=phone on sip invite

Post by Guest Thu Apr 22, 2021 4:45 am

Hi,

Sorry for the delay in reply.

I added the following to the forward_sip_domain.rb on the web portal as per https://docs.telcobridges.com/tbwiki/Routing_script_tutorial:Mini_Development_Guide

 call[:calling_parameters] ||= {} # Create a hash if not already present
 call[:calling_parameters][:uri_param] ||= "" # Create a string if not already present
 call[:calling_parameters][:uri_param] += ";" if call[:calling_parameters][:uri_param] != ""
 call[:calling_parameters][:uri_param] += "user=phone"

This is our forward_sip_domain.rb script now:

#
# Script version 1.0
#
# Version history:
#  1.0  Initial version of this script
#
# This filter is used to forward the domain name (or IP address and port) from the incoming call to outgoing call,
# for the following SIP headers:
#   - from                  (update call attribute :calling by appending :calling_sip_host and calling_sip_port)
#   - to                    (update call attribute :called by appending :called_sip_host and called_sip_port)
#   - P-asserted-identity   (update call attribute :private_address by appending :private_address_sip_host and private_address_sip_port)
#
# Installing this script:
#  - This script is installed as a "route_remap" filter. In your main routing script, you need to add the follownig lines
#    at appropriate places in the script:
#     - require 'forward_sip_domain' unless defined?(ForwardSipDomain)
#     - include ForwardSipDomain
#     - route_remap :method => :forward_sip_domain
#  - This script requires the routes to have a custom column named "forward_sip_domain", type boolean.
#    (custom route column can be created in the "Routes" section of the web portal under "Create New Route Column")
#
# Using this script:
#   In the WEB Portal, "forward_sip_domain" attribute is configured per route:
#     - Under "Routes" section of the web portal (then under "Custom Parameters").
#
#

module ForwardSipDomain

 # This function is automatically called at script initialization (called once when the configuration is applied)
 def init_forward_sip_domain params
   log_trace :always, "Using ForwardSipDomain"
 end

 # This function is called for every matching route for a call
 # If the route option "forward_sip_domain" is enabled, this function will update the
 # :called, :calling, and :private_address fields of the call to forward the sip domain
 # from the incoming call
 def forward_sip_domain( route, caf_call, nap_list, call )
   if route[ :forward_sip_domain ] && route[ :forward_sip_domain ].to_i != 0
     append_domain_port( call, :called )
     append_domain_port( call, :calling )
     append_domain_port( call, :private_address )
     append_domain_port( call, :contact )
     
     # Also forward SIP header parameters
     # Note: These parameters are forwarded to outgoing leg as soon as accessed (read) by the
     #       routing script, so the following lines simply do that (read the parameters to trigger forwarding)
     call[ :calling_parameters ]           = call[ :calling_parameters ]
     call[ :called_parameters  ]           = call[ :called_parameters  ]
     call[ :private_address_parameters ]   = call[ :private_address_parameters ]
     call[ :contact_parameters ]           = call[ :contact_parameters ]
     
     #Added RR 19/04/21
       call[:calling_parameters] ||= {} # Create a hash if not already present
       call[:calling_parameters][:uri_param] ||= "" # Create a string if not already present
       call[:calling_parameters][:uri_param] += ";" if call[:calling_parameters][:uri_param] != ""
       call[:calling_parameters][:uri_param] += "user=phone"
   end
   return call
 end

 # This function appens the corresponding host and port to the given field (like calling, or called)
 def append_domain_port( call, field )
   sip_host_field = ( field.to_s + "_sip_host" ).to_sym
   sip_port_field = ( field.to_s + "_sip_port" ).to_sym
   if call[ field ].to_s != "" && call[ sip_host_field ].to_s != ""
     call[ field ] = call[ field ] + "@" + call[ sip_host_field ]
     if( call[ sip_port_field ].to_s != "" && call[ sip_port_field ].to_i != 5060 )
       call[ field ] = call[ field ] + ":" + call[ sip_port_field ]
     end
   end
 end

end
----------------------------------------------------

I also enabled the “forward_sip_domain” on the route the calls take. Yet we don’t get the user=phone on the invite.

The actual fact is that it seems to be stripped by ProSBC as we have user=phone on the Incoming invite, but its not thereafter passing through.

See below invite before Prosbc:
enabling user=phone on sip invite 313

After passing through:
enabling user=phone on sip invite 413




Please can you assist?


Regards,

Guest
Guest


Back to top Go down

enabling user=phone on sip invite Empty Re: enabling user=phone on sip invite

Post by Guest Thu Apr 22, 2021 4:46 am

Hello,

You need to add sip_header_params.rb script to your main script. It is enough to send user=phone.

Please add the following to your main script (probably it is simple_routing_sbc.rb)

.
.
require 'sip_header_params' unless defined?(SipHeaderParams)
.
.
include SipHeaderParams
.
.
after_remap_filter :method => :sip_header_params, :headers_to_add => [
{
:documentation => "Add user=phone to user parameters of most SIP headers",
:type => :uri_param,
:contents => "user=phone",
:sip_headers => [
:calling,
:called,
:private_address,
:contact,
"Diversion"
]
},
]

And remove the changes you did on forward_sip_domain.rb script.

Best regards,

Guest
Guest


Back to top Go down

enabling user=phone on sip invite Empty Re: enabling user=phone on sip invite

Post by Guest Thu Apr 22, 2021 4:46 am

Thanks, but this will change it for all the routes? We only need it for the one so the enable of the “forward_sip_domain” on the specific route was a great go-to.

I don’t want to change it for all the providers and break something else.

Thanks.

Guest
Guest


Back to top Go down

enabling user=phone on sip invite Empty Re: enabling user=phone on sip invite

Post by Guest Thu Apr 22, 2021 4:46 am

Hello,

You can create a new route column named “add_sip_header_params”, type Boolean. This route column (attribute) will determine, per route, if the defined SIP headers must be added or not.

Best regards,

Guest
Guest


Back to top Go down

enabling user=phone on sip invite Empty Re: enabling user=phone on sip invite

Post by Guest Thu Apr 22, 2021 4:47 am

Thanks, Just to confirm we still need to do “add the following to your main script (probably it is simple_routing_sbc.rb)”?

Guest
Guest


Back to top Go down

enabling user=phone on sip invite Empty Re: enabling user=phone on sip invite

Post by Guest Thu Apr 22, 2021 4:47 am

Hi,

You need to call sip_header_params.rb script from your main script. Otherwise, it will not work. Please follow the procedure I sent you in the earlier comment.

Best regards,

Guest
Guest


Back to top Go down

Back to top

- Similar topics

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