cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1233
Views
1
Helpful
5
Replies

tcl app error

AshG
Level 4
Level 4

Hello,

We have created a simple tcl script to extract data from db server.

if we run the script via tcl shell on cube it runs fine. However if we configure it as an application and apply to dial peer we get error

Application drd in dial-peer 31 not found.  Handing callid 26664983 to the alternate app .


Any Idea or pointers someone can give us?

its very simple script as below:

proc init {} {

if {[ catch {package require http} ]} { source "tmpsys:lib/tcl/http.tcl" }

set Key "30000"

set url "http://172.29.15.57/test_tcl?sql=execute+rinfo+@Key=$Key"

set token [ http::geturl $url ]

http::wait $token

if {![ string compare [ http::status $token ] "ok" ]} {

    puts [ http::data $token ]

} else {

    puts stderr [ http::error $token ]

}

http::cleanup $token

}

init

1 Accepted Solution

Accepted Solutions

Hi Ashish,

Good to know that you got sorted it out.

-command callback  (To invoke callback after the HTTP transaction completes)

Thanks,

Raghavendra

View solution in original post

5 Replies 5

Raghavendra G V
Cisco Employee
Cisco Employee

Hi Ashish,

you can define fsm state as below and move your http code into act_Setup procedure


set TopFSM(any_state,ev_disconnected) "act_Cleanup,same_state"
set TopFSM(CALL_INIT,ev_setup_indication) "act_Setup same_state"
fsm define TopFSM CALL_INIT


Please refer programming guide in below link for sample scripts.

https://developer.cisco.com/site/voice-gateway/overview/


Thanks,

Raghavendra

Thanks Raghavendra,It helped but we are now getting this error..!

227710: Apr 22 15:15:36.179: //26703711/42EFE35F84F9/AFW_:/AFW_Leg_UpdateStats: Updating stats for ID 1DE type 1

227711: Apr 22 15:15:36.179: //26703711//PACK:/tcl_packageObjCmd:  package require http

227712: Apr 22 15:15:36.179: //26703711//PACK:/PkgRequire:  name(http) version() exact(0) rootScript(drd)

227713: Apr 22 15:15:36.179: //-1//PACK:/find_global_package_entry:  pkgName(http) exact(0)

227714: Apr 22 15:15:36.179: //26703711//PACK:/PkgRequire:  can't find package http

227715: Apr 22 15:15:36.179: //26703711//AFW_:/AFW_FSM_Drive: Tcl_Eval to drive FSM inside Tcl modulespace. code=1 code=ERROR

227716: Apr 22 15:15:36.179: TCL script failure

        Result:

                         invalid command name "source"

227717: Apr 22 15:15:36.179:    TCL script failure errorInfo:

                        invalid command name "source"

    while executing

"source "tmpsys:lib/tcl/http.tcl" "

    (procedure "act_CallSetup" line 11)

    invoked from within

"act_CallSetup"

Hi Raghvendra,

Thanks for your help so far , we are moving slowly.

The command you suggested first time to use package ::httpios:geturl is right if we want to iuse tcl ivr script.

However we are getting below error now

241297: Apr 22 19:31:26.144: TCL script failure

        Result:

                         invalid command name "getEndCallResponse"

241298: Apr 22 19:31:26.144:    TCL script failure errorInfo:

                        invalid command name "getEndCallResponse"

    while executing

"getEndCallResponse ::httpios::httpios_5"

This was part of your command. if I remove these parameter then I get error "missing parameters".

Is there a list of valid parameter we can use with httpios::geturl command?

Thanks

Ashish

Hi Raghvendra,


In the end we got it sorted. We understand that -command is the Proc defined with in the script to retrieve data.


As I said moving slowly...!


Thanks for your help and I will post again if needed further help.


Thanks

Ashish

Hi Ashish,

Good to know that you got sorted it out.

-command callback  (To invoke callback after the HTTP transaction completes)

Thanks,

Raghavendra