« Back to TCL-API

can tcl access contents of sip message?

Combination View Flat View Tree View
Threads [ Previous | Next ]
Showing 1 - 20 of 27 results.
of 2
I have done a lot of research but I haven't found the answer.
I am trying to see if tcl can access sip cause code (200OK or 503 no circuit available as an example).
 
What I am trying to do is based on which sip cause code I get, I want script to play prompts.
so far, I don't think this is possible.
 
am i wrong?

Hi Steve,
 
Yes you are right.We can just get the headers from the INVITE message.AFAIK we cannot access the SIP Cause code through TCL.
 
Thanks
Vijay

if cisco API can get all headers from disconnect(which btw I did not see), it doesn't make sense to not be able to get
status code.
 
does future cisco have any plan to add that to API?
 
Can you also show me how to access all headers from disconnect?

Does anyone know the answer to this?

Hi Steve,
 
As mentioned in the TCL IVR programming guide for accessing the headers associated with the protocol we can make use of 'leg_proto_headers'
 
Syntax: infotag get leg_proto_headers [<attribute-name>]
 
where <attribute-name> is the name of the header to get.
 
But currently, only access to headers in SIP invite, subscribe, notify and H.323 setup messages are supported.
 
Also if <attribute-name> is not specified, all headers are returned in a concatenated string, with each header separated by a "&" symbol and if legID is not provided, the first incoming leg is applied.
 
And related to you question whether there are any future plans for adding this API, please let us share your requirments in detail so that we will pass it on to the marketing team and get back to you with their response.
 
Thanks,
Anusha

Hi Steve,
 
As mentioned in the TCL IVR programming guide for accessing the headers associated with the protocol we can make use of 'leg_proto_headers'
 
Syntax: infotag get leg_proto_headers [<attribute-name>]
 
where <attribute-name> is the name of the header to get.
 
But currently, only access to headers in SIP invite, subscribe, notify and H.323 setup messages are supported.
 
Also if <attribute-name> is not specified, all headers are returned in a concatenated string, with each header separated by a "&" symbol and if legID is not provided, the first incoming leg is applied.
 
And related to you question whether there are any future plans for adding this API, please let us share your requirments in detail so that we will pass it on to the marketing team and get back to you with their response.
 
Thanks,
Anusha

 
Hello, and thank you for your response.
It will be nice to see if API can access all sip messages(not just what you mentioned above) so that it can react to certain response code.(final response in sip. If not, do nothing).

I am having difficulty getting simple headers from the INVITE.
 
as5350xm
c5350-jk9su2_ivs-mz.150-1.M1.bin
 
Incoming leg is SIP, I can easily see the From and other headers with "sh debug ccsip mess"
 
I have tried both leg_proto_headers and evt_proto_headers
 
proc proc_setup_indication { } {

    leg proceeding leg_incoming
    leg alert leg_incoming -p 8
   
    set headersAll [infotag get leg_proto_headers]
    puts "************** headersAll: $headersAll    *********************\n\n"

   
    set headersAllLeg [infotag get leg_proto_headers leg_incoming]
    puts "************** headersAllLeg: $headersAllLeg    *********************\n\n"


    set headersFrom [infotag get leg_proto_headers "From"]
    puts "************** headersFrom: $headersFrom    *********************\n\n"

}
 
RESULTS from "debug voip app script":

May  4 20:23:53.706: //16492//TCL :/tcl_PutsObjCmd:
************** headersAll:     *********************

May  4 20:23:53.706:
May  4 20:23:53.706: //16492//TCL :/tcl_PutsObjCmd:
************** headersAllLeg:     *********************

May  4 20:23:53.706:
May  4 20:23:53.710: //16492//TCL :/tcl_PutsObjCmd:
************** headersFrom:     *********************
 
I have even tried moving these commands to later in the call, after the conference is connected.  Still, no output.
 
Thanks,
Travis

Hi Travis,
 
We will be able to retrieve the headers from the SIP invite message using both the leg_proto_headers as well as the evt_proto_headers. COuld you please share us the running config and the scripts you are trying to excute to drill down issue further? Also what is the dnis value you have when you are making the call?
 
Thanks,
Anusha.

router#show call application voice protoHeaderTest
Script Name : protoHeaderTest
       URL  : http://webserver/tcl/protoHeaderTest.tcl
       Type : Service
       State: Registered
       Life : Configured
       Exec Instances: 0

Script Code Begin:
--------------------------------

TCL Script version 2.2 or above

proc init { } {
}

proc eventHandler { } {

        puts "\n************* EVENT:[infotag get evt_event]********\n"


        set callID [infotag get leg_proto_headers "Call-ID"]
        puts "\n\n************** callID: $callID    *********************\n\n"

        set headersAll [infotag get leg_proto_headers]
        puts "\n\n************** headersAll: $headersAll    *********************\n\n"

        set headersAllLeg [infotag get leg_proto_headers leg_incoming]
        puts "\n\n************** headersAllLeg: $headersAllLeg    *********************\n\n"


        set headersFrom [infotag get leg_proto_headers "From"]
        puts "\n\n************** headersFrom: $headersFrom    *********************\n\n"

  set AccountInfo [infotag get leg_proto_headers AccountInfo]
  puts "\n\n************** AccountInfo = $AccountInfo *********************\n\n"
 
        call close
}

requiredversion 2.1
init

set fsm(any_state,ev_any_event) "eventHandler,same_state"
fsm define fsm SINGLESTATE


--------------------------------


router#
router#term mon
router#

May  5 20:12:22.359: //31//TCL :/tcl_PutsObjCmd:
************* EVENT:ev_setup_indication********

May  5 20:12:22.359:
May  5 20:12:22.359: //31//TCL :/tcl_PutsObjCmd:

************** callID:     *********************


May  5 20:12:22.359:
May  5 20:12:22.359: //31//TCL :/tcl_PutsObjCmd:

************** headersAll:     *********************


May  5 20:12:22.359:
May  5 20:12:22.359: //31//TCL :/tcl_PutsObjCmd:

************** headersAllLeg:     *********************


May  5 20:12:22.359:
May  5 20:12:22.359: //31//TCL :/tcl_PutsObjCmd:

************** headersFrom:     *********************


May  5 20:12:22.359:
May  5 20:12:22.359: //31//TCL :/tcl_PutsObjCmd:

************** AccountInfo =  *********************

Hi Travis,
 
I had gone through the running configs that you had sent to me and found that you are missing the mandatory configs for headers passing. Please include the following configs and try it out.
 
sip
  header-passing 
 
 
Thanks,
Anusha

Worked like a charm !
 
Thanks you very much Anusha
 
Travis

Cannot read SIP cause code but those codes might equal to leg setup status that can we can get it when receive ev_setup_done
 
For example
 
200 OK for INVITE treat is as ls_000 and 503 is ls_xxx.
 
Thanks,
 
Yawming

Hi Travis,
 
I had gone through the running configs that you had sent to me and found that you are missing the mandatory configs for headers passing. Please include the following configs and try it out.
 
sip
  header-passing 
 
 
Thanks,
Anusha

 
Thanks a lot , this post was very helpful for me. I wanna know one more thing, like after i added header passing I could see 
 

Apr 14 07:53:22.345: //302713//TCL :/tcl_PutsObjCmd: CLI: sip:17607058888@voxbone.com instead of 17607058888. Can we control this.
 
Thanks

After I did this config change sip header passing, I could see cli is coming as : sip:username@domain instead of 17607058888.

Is there anyway so that CLI and CLD remains same.


Srikanth

After I did this config change sip header passing, I could see cli is coming as : sip:username@domain instead of 17607058888.

Is there anyway so that CLI and CLD remains same.


Srikanth

 
please anyone help me out

Hi Srikanth,

As per sip uri standards it is not possible to change, sip uri must contain username and domain .

Thanks,
raghavendra

Thanks a lot Raghavendra.

Does adding sip header-passing in config will have any negative affect on performance of AS5400. If yes, what percentage will it be.

And is there anything to be handled explicitily after this change.


Srikanth

Hi Srikanth,

I don't think there will be any platform specific issue due to the cli and no need to configure anything after configuring sip header-passing.

Thanks,
Raghavendra

RE: can tcl access contents of sip message?
Answer
4/19/11 12:54 PM as a reply to Raghavendra Gutty Veeranagappa.
Thanks a lot

Here is the issue i am facing with after I enabled sip header passing

I have a translation rule

voice translation-rule 7
rule 1 /\+/ //
!

this rule is applied through translation profile on dial-peer for incoming number

this rule is supposed to strip '+' from CLI

Example : CLI : +99999999999 it will come into script as 99999999999

right now CLI coming as sip:99999999999@domain.. so this rule is getting failed. How can I make a workaround so I could able to apply translation rule on CLI.

please help me out.

Thanks a lot

Hi Srikanth,

you mean to say that after configuring sip header-passing you are getting sip:99999999999@domain, before your getting sip:+99999999999@domain, if so could you please send us the logs and also explain breifly about your call flow.

Thanks,
Raghavendra

Showing 1 - 20 of 27 results.
of 2