« Back to TCL-API

codec detection

Combination View Flat View Tree View
Threads [ Previous | Next ]
Is there a way to identify the codec that was negotiated for the leg_incoming leg? I am having a problem getting a prompt to play out on the inbound leg because of codec mismatches. I would like to be able to pull the codec for the inbound leg from an infotag, and then do either a switch or if/else statement to point a media play command to different files based on codec.

Thanks
Wes

I have also tried this:

set testa [infotag get leg_proto_headers leg_incoming]
puts "\n\n\ntesta=$testa\n\n"
set testb [infotag get evt_proto_headers]
puts "\n\n\ntesta=$testb\n\n"


but these both came back with an empty string:


Aug 4 17:48:22.871: //4551//TCL :/tcl_InfotagObjCmd: infotag get leg_proto_headers leg_incoming
Aug 4 17:48:22.871: //4551//TCL :/tcl_InfotagGetObjCmd: infotag get leg_proto_headers leg_incoming
Aug 4 17:48:22.871: //4551//AFW_:/vtr_lg_proto_headers: argc 3 argindex 2
Aug 4 17:48:22.871: //4551//TCL :/tcl_PutsObjCmd:


testa=


Aug 4 17:48:22.871:
Aug 4 17:48:22.871: //4551//TCL :/tcl_InfotagObjCmd: infotag get evt_proto_headers
Aug 4 17:48:22.871: //4551//TCL :/tcl_InfotagGetObjCmd: infotag get evt_proto_headers
Aug 4 17:48:22.871: //4551//AFW_:/vtr_ev_proto_headers: argc 2 argindex 2
Aug 4 17:48:22.871: //4551//TCL :/tcl_PutsObjCmd:


testb=


Aug 4 17:48:22.871:


and according to the documentation, if I do not specify an attribute in the infotag get command, all attributes are supposed to be returned in a single string seperated by the "&" character.

I don't think there is way Tcl API can detect what codec is negotiated.

Thanks !

I asked this question in 2003 and they told me it would be a lot of work and that I needed to make a business case. Because of this I have to filter all IP-IVR to G729. in rare situations where G723 is needed I use an prefix to select a different dial-peer which pulls different files.

this is much like the question of asking to be able to select a target IP from within TCL. Again ¿provide a business case¿. unless a large company like ATT or Bank of America wants something it won¿t become a new feature. Thinking like this is very short sighted.


Leon

From: Cisco Developer Community Forums
Sent: Thursday, August 04, 2011 2:39 PM
To: cdicuser@developer.cisco.com
Subject: New Message from WESLEY PHILLIPS in Voice Gateway API (VGAPI) - TCL-API: codec detection

WESLEY PHILLIPS has created a new message in the forum "TCL-API":

--------------------------------------------------------------
Is there a way to identify the codec that was negotiated for the leg_incoming leg? I am having a problem getting a prompt to play out on the inbound leg because of codec mismatches. I would like to be able to pull the codec for the inbound leg from an infotag, and then do either a switch or if/else statement to point a media play command to different files based on codec.

Thanks
Wes
--
To respond to this post, please click the following link:

<http://developer.cisco.com/web/vgapi/forums/-/message_boards/view_message/4322461>

or simply reply to this email.

I am thinking that I might be able to "cheat" this one. If this fails:

media play leg_incoming en_prompt.au

because the negotiated codec is g729, and the file is g711, then I should be able to do something like this(assuming that the files are in the proper formats):

media play leg_incoming en_prompt_g729.au
media play leg_incoming en_prompt_g711.au


Essentially one of the two will always fail and the other one will always play. If I have a codec class on the dial peer that has three preferecnces, then I would have to have three audio prompts, instead of two. My experience is that as soon as the TCL script fails a media play option because of codec mismatch, it simply moves on to the next command, so this should theoretically work.....



Wes