This document was generated from CDN thread
Created by: Yaw-Ming Chen on 04-01-2012 02:13:58 PM
In IOS 15.2(2)T a new option is introduced for infotag get leg_dnis and infotag get leg_ani
infotag get leg_dnis
infotag get leg_ani
This option services the following purposes:
1. Return number portion only for DNIS or ANI in SIP trunk
Without
this option we need to use regular expression to extract the number
portion after we use ¿infotag get¿ to get the ANI or DNIS
For example:
set dnis [infotag get leg_dnis]
regexp {[0-9]+} $dnis dnis
With using this option we don¿t need to use regular expression anymore. The command will return number only.
2.
In certain configuration if we use ¿voip-incoming translation-profile¿
then use after translation number to trigger Tcl script, the ¿infotag
get leg_dnis¿ command will return the number before translation.
For example:
The
incoming number is 7771234 and we need have it translated to 8881234
via ¿voip-incoming translation-profile¿ command. We will expect 8881234
to hit Tcl application in dial-peer for incoming 8881234. Script will be
triggered as expected but ¿infotag get leg_dnis¿ will return 7771234
but not 8881234. Use new option can fix this issue.
Subject: RE: New Tcl command option for "infotag get leg_dnis" and "infotag get leg_
Replied by: Keith Haugen on 01-06-2012 11:29:46 AM
I am not sure I am understanding -- so if I have the command translation-profile outgoing remove_prefix_89 in my dial peer, and the number dialed is 8912345, there is some way in my TCL IVR script that I can get the translated number (i.e., 12345)? How do I determine what the and options should be?
Subject: RE: New Tcl command option for "infotag get leg_dnis" and "infotag get leg_
Replied by: Yaw-Ming Chen on 01-06-2012 03:22:48 PM
Sorry that I didn't make it clear. The callnumner is a key word
The legID you can use default "leg_incoming or you can get it from evt_legs tag
set legIDs [infotag get evt_legs]
infotag get leg_dnis callnumber leg_incoming
infotag get leg_ani callnumber leg_incoming