[cisco-voip] Catch Cisco AVPair by TCL IVR Script (corrected)
Dennis Kisilyov
dennis at infoleak.com
Tue Nov 15 11:29:12 EST 2005
Mozilla Thunderbird cut and pase erros, please excuse corrcted reporst
Mehdi Torki wrote:
> Hi all
>
> I have a Cisco AS5350 and I writed a custom TCL IVR script for voice
> application. When a call occures, then my script collects a 10 digit
> number and sends it for radius server (freeradius) by below command:
>
> aaa authorize $collectednumber "" "" "" leg_incoming
>
> Then Radius server sends a Access-Accept message to router that
> contains a Cisco AVPair attribute.
>
> debug output is:
>
> ROUTER#ss [4] 6 192.168.230.111 <http://192.168.230.111>
> 4w5d: RADIUS: NAS-Port-Type [61] 6 Async
> [0]
> 4w5d: RADIUS: User-Name [1] 11 "100592177"
> 4w5d: RADIUS: Vendor, Cisco [26] 56
> 4w5d: RADIUS: Conf-Id [24] 50 "h323-conf-id=5CD14012
> D98311D3 815
> CA79B A96CBA23"
> 4w5d: RADIUS: User-Password [2] 18 *
> 4w5d: RADIUS: Vendor, Cisco [26] 37
> 4w5d: RADIUS: Cisco AVpair [1] 31
> "h323-ivr-out=transactionID:27"
> 4w5d: RADIUS:
> ROUTER#Received from id 42 192.168.230.110:1645
> <http://192.168.230.110:1645>, Access-Accept, len 56
>
> 4w5d: RADIUS: authenticator 06 3A 4D BB 2C AA 28 B8 - B7 11 CE DA B0
> 66 B2 66
> 4w5d: RADIUS: Vendor, Cisco [26] 24
> 4w5d: RADIUS: Cisco AVpair [1] 18 "h323-ivr-in=A:B"
> 4w5d: RADIUS: Service-Type [6] 6 Framed
> [2]
> 4w5d: RADIUS: Framed-Protocol [7] 6 PPP
> [1]
>
>
> BUT my TCL script could not catch h323-ivr-in from Accept message.
> TCL code is:
>
> if { $status == "ao_000" } {
> if { [infotag get aaa_avpair_exists h323-ivr-in] } {
> puts "****FOUND REPLY MESSAGE****" set cs [infotag get
> aaa_avpair h323-ivr-in]
> # Card number exists and should be check status
> # puts "h323-return-code =3D $cr "
> puts "REPLY MESSAGE === $cs"
> media play leg_incoming tftp://192.168.230.110/sounds/success.au
> } else {
> puts "****NOT FOUND REPLY MESSAGE****" media play
> leg_incoming tftp://192.168.230.110/sounds/cardnotfound.au
> }
> } else {
> if {$status == "ao_001"} {
> puts "****Authorization Failed****" media play
> leg_incoming tftp://192.168.230.110/sounds/cardnotfound.au
> } else {
> # $status == "ao_002" Authorization Error puts
> "****Authorization Error****" }
> }
> script debug output:
>
> 4w5d: "****NOT FOUND REPLY MESSAGE****"
If you turn on
"debug ivr voice" - (in the enabled mode - this enables basic) IVR
debugging
When any aaa command is issued during TCL execution -
you should see all the AV pairs returned by your RADIUS fly by.
This looks like a fragment of debitcard.tcl that you're trying to
mod. If so.
during fristAuthorize you should see
1d09h: TclPopulateRadiusVSA: h323-credit-amount x.xx
1d09h: TclPopulateRadiusVSA: h323-billing-model 1
1d09h: TclPopulateRadiusVSA: h323-ivr-in A:B
1d09h: TclPopulateRadiusVSA: h323-return-code 0
In the debug voice ivr output:
If you're trying to use ivr-in to play amount best thing to do is
to use "%a[set Variable]" to play amount where your radius server returns h323-credit-amount attribute
and attach a tts tcl module for that language, so it can announce amounts in proper syntax for the
language.
I can see you're not naming your samples as a language
eg. en_cardnotfound.au (english)
sp_cardnotfound.au (spanish)
languages that are not supported directly can be coded around with a TTS TCL script.
If you were, then you could just set the tftp URL once for that language in
your NAS config like so.
---
call application voice [appname] language 1 en
call application voice [appname] set-location en 0 tftp://<hostname/directory/
---
if your case it would look something like this
---
call appliaction voice [appname] set-location en 0 tftp://192.168.230.110/sounds/
---
then go and rename cardnotfound.au to en_cardnotfound.au
then use this line of code for media playback:
media play leg_incoming _cardnotfound.au
Your NAS will automatically pull en_cardnotfound.au from the tftp server.
If you dont want to use IP's. you can also do this in the NAS config
----
ip host voicetftp 192.168.230.110
!
call appliaction voice [appname] set-location en 0 tftp://voicetftp/sounds/
----
I suggest not mucking with the debitcard.tcl and rolling your own from scratch.
Also please see TCL 2.0 Programming Guide (available in HTML/PDF on the vendor c website)
To also clarify even status coming from ev_authorize_done on FSM are
ao_000 - Success + h323-return-code (reason) Accepted Account Number + gave a reason
ao_001 - Authorization ERROR (you should not get this one too often) - default debitcard.tcl does not even trap this.
ao_002 - Authorization Failure + h323-return-code(reason) Radius Declined the Account Number + gave a reason
(Your code treats them in reverese ao_001/ao_002)
Thanks
-DK
>
> Please help me.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
>
More information about the cisco-voip
mailing list