IVR Script Help need
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > WebserverTalk Community > Voice Over IP > Voice over IP Cisco > IVR Script Help need




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    IVR Script Help need  
Mehdi Eskandari


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-24-07 12:11 PM

Hi,
my problem is still not solved.
if anyone can help me in my script please answer me;)
the problem is when user press # key script cannot say the remaining credit.
i send you some parts of my script that may be need.
-------------------------
........
proc init_perCallVars { } {

global NumLangPrompt;
global NumCardPrompt;
global NumDestPrompt;
global PromptFlag;
global DestPromptFlag;
global NoPlayWarn;
global NoTimeLimit;
global SetupDone;

set NumLangPrompt 0;
set NumCardPrompt 0;
set NumDestPrompt 0;
set PromptFlag 0;
set DestPromptFlag 0;
set NoPlayWarn 0;
set NoTimeLimit 0;
set SetupDone 0;



return;

}
....
proc act_CardAuthorize { } {

global PromptFlag;
global NumCardPrompt;
global ParamForDest;
global ParamForCard;
global retryCnt;

set status [infotag get evt_status];
if {$status == "ao_000"} {

if {[infotag get aaa_avpair_exists h323-credit-amount]} {

set amt [infotag get aaa_avpair h323-credit-amount]
puts "\n***amount = $amt"
} else {
media play leg_incoming _no_aaa.au;
fsm setstate CALLDISCONNECT;
return;
}
fsm setstate DESTSELECTION;
if {$amt <= 999999.99} {
media play leg_incoming _you_have.au %a$amt _enter_dest.au;
} else {
media play leg_incoming _enter_dest.au;
}

leg collectdigits leg_incoming ParamForDest;
return;
}



if {[infotag get aaa_avpair_exists h323-return-code]} {
set return_code [infotag get aaa_avpair h323-return-code];
} else {
media play leg_incoming _no_aaa.au;
fsm setstate CALLDISCONNECT;
return;
}



incr NumCardPrompt;

if {$NumCardPrompt < $retryCnt} {

leg collectdigits leg_incoming ParamForCard;
act_PlayCardReturnCode $return_code;
} else {
act_GetCard;
}

return;

}
.
.
.
proc act_GetDestination { } {

global retryCnt;
global ParamForDest;
global DestPromptFlag;
global NumDestPrompt;



if {$NumDestPrompt < $retryCnt} {

switch $DestPromptFlag {

0 {media play leg_incoming _enter_dest.au; #Abortkey pressed}
1 {media play leg_incoming _no_dest_entered.au; #Timeout -no digits
entered}
2 {media play leg_incoming _reenter_dest.au; #Not mutch to the dial pla
n}

default {
media play leg_incoming _no_aaa.au;
fst setstate CALLDISCONNECT;
return;
}

}
leg collectdigits leg_incoming ParamForDest;
} else {
media play leg_incoming _dest_collect_fail.au;
fsm setstate CALLDISCONNECT;
}

return;

}

proc act_GotDestination { } {
global NumDestPrompt;
global DestPromptFlag;
global account;
global pin;
global destination;



set status [infotag get evt_status];
switch $status {

"cd_001" {
incr NumDestPrompt;
set DestPromptFlag 1;
act_GetDestination;
return;
}

"cd_002" {

set DestPromptFlag 0;
act_GetDestination;
return;

}

"cd_004" {

set destination [infotag get evt_dcdigits];
puts "\n************dest_number = $destination";
aaa authorize $account $pin "" $destination leg_incoming;
return;

}

default {
incr NumDestPrompt;
set DestPromptFlag 2;
act_GetDestination;
return;

}

}
return;
}
...
proc act_CallAuthorize { } {

global NumDestPrompt;
global DestPromptFlag;
global WarnTime;
global NoPlayWarn;
global NoTimeLimit;
global creditTime;
global retryCnt;
global ParamForDest;
global param;

set status [infotag get evt_status];
set param(enableReporting) true;
set param(interruptPrompt) false;



if {$status == "ao_000"} {

if {[infotag get aaa_avpair_exists h323-credit-time]} {
set creditTime [infotag get aaa_avpair h323-credit-time];
} else {
media play leg_incoming _no_aaa.au;
fsm setstate CALLDISCONNECT;
return;
}

if {$creditTime <= $WarnTime} {set NoPlayWarn 1;}
if {$creditTime == "unlimited"} {set NoTimeLimit 1;}

media play leg_incoming _you_have.au %t$creditTime;
leg collectdigits leg_incoming param; #For Fast leg setup
fsm setstate PLACECALL;
return;
}

incr NumDestPrompt; #Call authorize failed

if {[infotag get aaa_avpair_exists h323-return-code]} {
set return_code [infotag get aaa_avpair h323-return-code];
} else {
media play leg_incoming no_aaa.au;
fsm setstate CALLDISCONNECT;
return;
}



if {$NumDestPrompt < $retryCnt} {
act_PlayDestReturnCode $return_code;
leg collectdigits leg_incoming ParamForDest;
} else {
act_GetDestination;
}
return;

}
.......
.......
proc act_CallWarnMedia { } {

global incoming;
global outgoing;

connection create $incoming $outgoing;
return;
}



proc act_LongPound { } {

if {[infotag get evt_digit] != "#"} {
fsm setstate same_state;
return;
}

set duration [infotag get evt_digit_duration];

if {$duration < 300} {
fsm setstate same_state;
return;
}

connection destroy con_all;
return;
}
....
...
proc act_ConnDestroyed { } {

global account;
global pin;

leg disconnect leg_outgoing;
init_perCallVars;
#    act_GetDestination;
aaa authorize $account $pin "" ""  leg_incoming;
fsm setstate CARDSELECTION;
#    fsm setstate DESTSELECTION;

return;
}
#---------------
set ivr_fsm(CALLACTIVE,ev_digit_end) "act_LongPound CONNDESTROY";
set ivr_fsm(CONNDESTROY,ev_destroy_done) "act_ConnDestroyed same_state";
set  ivr_fsm(CARDSELECTION,ev_authorize_done)
 "act_CardAuthorize same_state";


the important part is proc act_ConnDestroyed. when two line(that i
commented) are invoked the script is good and wait for new destination but
when other two line(aaa and cardselect) are invoked the radius return 0 for
Credit-Time

i look forward to hearing from you
thanks and have a nice day






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:10 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register