04-24-2015 03:38 AM
Hi Raghavendra,
We are using below command to get data from http server.
::httpios::geturl <url> -command getEndCallResponse -timeout
getEndCallResponse is another proc which retrieves the data. However we are not able to understand how to use the data returned.
we want to reference to that data ( Possibly by storing it in variable) and update the DNIS of Sip Header. Both Invite and To Filed.
Can you please help.
Thanks
Ashish
Solved! Go to Solution.
04-30-2015 04:57 AM
You need to add "global resp" in your function as below.
proc getHTTPiosResponse {token} {
global resp
Thanks,
Raghavendra
04-24-2015 03:58 AM
Hi Ashish,
Please refer SIP Headers section in TCL ivr programming guide from below link.
https://developer.cisco.com/site/voice-gateway/documentation/
Thanks,
Raghavendra
04-24-2015 04:28 AM
Thanks Raghavendra,
Looking at the guide.
Another question . We are trying to not answer the call in tcl script but just use "leg proceeding leg_incoming"
Update the sip header with new DNIS and then release the call from .tcl script and let carry on its normal route. I.e hit the next dial peer in gateway.
is this do able ? and any pointers will help.
Thanks
Ashish
04-24-2015 04:43 AM
I am not sure, But headers need to be passed to leg setup command.
set callinfo(protoHeaders) headers
Thanks,
Raghavendra
04-24-2015 06:26 AM
Hi Raghavendra,
We are not able to store data returned by http in variable to use it later.
we have tried to define global variables or even tried to use token but not able to refer to the data.
we can see the data in log but not sure how to refer to it.
Any idea?
Thanks
Ashish
04-24-2015 10:08 AM
I don't understand why you can't refer the data, could you share code how you are trying to refer the data.
Thanks,
Raghavendra
04-30-2015 04:39 AM
Hi Raghavendra,
Apologies for late reply. Due to some other work we had to drop this development for a while.
Below is my code. However we have found that we need to use function
httpios:data to retrieve output from url ?
getHTTPiosResponse is proc we use in - command.
Thanks
Ashish
proc getHTTPiosResponse {token} {
# Get response data
puts "***** In getHTTPiosResponse: start"
# Declare variables
variable resp
if {![ string compare [ ::httpios::status $token ] "ok" ]} {
puts "***** In getHTTPiosResponse: http status ok "
set resp [ httpios::data $token ]
puts "***** In getHTTPiosResponse: Response - $resp"
} else {
puts stderr [ ::httpios::error $token ]
}
httpios::cleanup $token
04-30-2015 04:57 AM
You need to add "global resp" in your function as below.
proc getHTTPiosResponse {token} {
global resp
Thanks,
Raghavendra
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide