Modifying calling_sip_host Parameter in Routing Script
2 posters
Page 1 of 1
Modifying calling_sip_host Parameter in Routing Script
Hello everyone,
I hope this message finds you well.
I'm currently facing an issue with modifying the "calling_sip_host" parameter in the routing script. Despite following the documentation and attempting various approaches, I have been unable to achieve the desired result.
I've noticed that other parameters, such as "calling_display," are functioning correctly within the script (e.g., call = params[:call], call[:calling_display] = "xxxxxxxxx").
I'm utilizing the after_filter :method approach.
Could someone provide some guidance or suggestions on how to successfully modify the "calling_sip_host" parameter?
Your assistance in resolving this matter would be greatly appreciated.
Thank you in advance for your help.
I hope this message finds you well.
I'm currently facing an issue with modifying the "calling_sip_host" parameter in the routing script. Despite following the documentation and attempting various approaches, I have been unable to achieve the desired result.
I've noticed that other parameters, such as "calling_display," are functioning correctly within the script (e.g., call = params[:call], call[:calling_display] = "xxxxxxxxx").
I'm utilizing the after_filter :method approach.
Could someone provide some guidance or suggestions on how to successfully modify the "calling_sip_host" parameter?
Your assistance in resolving this matter would be greatly appreciated.
Thank you in advance for your help.
k.papadopoulos- Number of Messages : 1
Point : 3
Registration Date : 2024-04-12
Re: Modifying calling_sip_host Parameter in Routing Script
Please check the example below:
- Code:
module ManipulateOnRegisteredRoute
def init_extract_calling_sip_host params
end
def extract_calling_sip_host params
#log_trace 3, "call=" + params[:call].inspect
#log_trace 1, "naps=" + params[:naps].inspect
#log_trace 1, "out_calls=" + params[:out_calls].inspect
#log_trace 4, "Orignal_ROUTES=" + params[:routes].inspect
#log_trace 4, "original called number:" + params[:call][:called]
call = params[:call]
#out_calls = params[:out_calls]
routes = params[:routes]
calling_sip_host = call [:calling_sip_host]
calling_number = call [:calling]
log_trace 4, "calling_sip_host =: " + calling_sip_host
log_trace 4, "calling_number =: " + calling_number
if !(calling_sip_host.nil?) && !(calling_number.nil?)
routes = []
params[:routes].each do | route |
#log_trace 4, "check if it is registered user " + "#{route[:route_type]}"
if( route[:route_type] == :dynamic )
log_trace 4, "it's registered user"
reampped_calling = "sip:#{calling_number}@#{calling_sip_host} SIP/2.0"
route[:remapped_calling] = reampped_calling
log_trace 4, "Route remapped calling:" + route[:remapped_calling].inspect
routes << route
else
log_trace 4, "normal route"
# This is a 'normal' route
routes << route
end # if else
end # do
params[:routes] = routes
end #if !(calling_sip_host.nil?)
return params
end #def
end #module
Similar topics
» Script - Http Query to External Routing Engine in Get Format
» Routing script to add SIP header with incoming SIP IP
» Routing script to limit call duration
» Routing script to create a User-to-User Indication (UUI) based on the incoming called number
» Routing Script to disable route retry
» Routing script to add SIP header with incoming SIP IP
» Routing script to limit call duration
» Routing script to create a User-to-User Indication (UUI) based on the incoming called number
» Routing Script to disable route retry
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum