<div>Hi,</div>
<div>thanks for replying my email.</div>
<div>i send you some parts of my script that may be need.</div>
<div>-------------------------<br>........<br>proc init_perCallVars { } {</div>
<div>
<p> global NumLangPrompt;<br> global NumCardPrompt;<br> global NumDestPrompt;<br> global PromptFlag;<br> global DestPromptFlag;<br> global NoPlayWarn;<br> global NoTimeLimit;<br> global SetupDone;
</p>
<p> set NumLangPrompt 0;<br> set NumCardPrompt 0;<br> set NumDestPrompt 0;<br> set PromptFlag 0;<br> set DestPromptFlag 0;<br> set NoPlayWarn 0;<br> set NoTimeLimit 0;<br> set SetupDone 0;</p>
<p> </p>
<p> return;</p>
<p>}<br>....<br>proc act_CardAuthorize { } {</p>
<p> global PromptFlag;<br> global NumCardPrompt;<br> global ParamForDest;<br> global ParamForCard;<br> global retryCnt;</p>
<p> set status [infotag get evt_status];<br> if {$status == "ao_000"} {</p>
<p>if {[infotag get aaa_avpair_exists h323-credit-amount]} {</p>
<p> set amt [infotag get aaa_avpair h323-credit-amount]<br> puts "\n***amount = $amt"<br> } else {<br> media play leg_incoming _no_aaa.au;<br> fsm setstate CALLDISCONNECT;<br> return;<br> }<br> fsm setstate DESTSELECTION;
<br> if {$amt <= 999999.99} {<br> media play leg_incoming _you_have.au %a$amt _enter_dest.au;<br> } else {<br> media play leg_incoming _enter_dest.au;<br> }</p>
<p> leg collectdigits leg_incoming ParamForDest;<br> return;<br> }</p>
<p> </p>
<p> if {[infotag get aaa_avpair_exists h323-return-code]} {<br> set return_code [infotag get aaa_avpair h323-return-code];<br> } else {<br> media play leg_incoming _no_aaa.au;<br> fsm setstate CALLDISCONNECT;<br> return;
<br> }</p>
<p> </p>
<p> incr NumCardPrompt;</p>
<p> if {$NumCardPrompt < $retryCnt} {</p>
<p> leg collectdigits leg_incoming ParamForCard;<br> act_PlayCardReturnCode $return_code;<br> } else {<br> act_GetCard;<br> }</p>
<p> return;</p>
<p>}<br>.<br>.<br>.<br>proc act_GetDestination { } {</p>
<p> global retryCnt;<br> global ParamForDest;<br> global DestPromptFlag;<br> global NumDestPrompt;</p>
<p> </p>
<p> if {$NumDestPrompt < $retryCnt} {</p>
<p>switch $DestPromptFlag {</p>
<p> 0 {media play leg_incoming _enter_dest.au; #Abortkey pressed}<br> 1 {media play leg_incoming _no_dest_entered.au; #Timeout -no digits entered}<br> 2 {media play leg_incoming _reenter_dest.au; #Not mutch to the dial plan}
</p>
<p> default {<br> media play leg_incoming _no_aaa.au;<br> fst setstate CALLDISCONNECT;<br> return;<br> }</p>
<p> }<br> leg collectdigits leg_incoming ParamForDest;<br> } else {<br> media play leg_incoming _dest_collect_fail.au;<br> fsm setstate CALLDISCONNECT;<br> }</p>
<p> return;</p>
<p>}</p>
<p>proc act_GotDestination { } {<br> global NumDestPrompt;<br> global DestPromptFlag;<br> global account;<br> global pin;<br> global destination;</p>
<p> </p>
<p> set status [infotag get evt_status];<br>switch $status {</p>
<p>"cd_001" {<br> incr NumDestPrompt;<br> set DestPromptFlag 1;<br> act_GetDestination;<br> return;<br> }</p>
<p>"cd_002" {</p>
<p> set DestPromptFlag 0;<br> act_GetDestination;<br> return;</p>
<p> }</p>
<p>"cd_004" {</p>
<p> set destination [infotag get evt_dcdigits];<br> puts "\n************dest_number = $destination";<br> aaa authorize $account $pin "" $destination leg_incoming;<br> return;</p>
<p> }</p>
<p>default {<br> incr NumDestPrompt;<br> set DestPromptFlag 2;<br> act_GetDestination;<br> return;</p>
<p> }</p>
<p> }<br> return;<br>}<br>...<br>proc act_CallAuthorize { } {</p>
<p> global NumDestPrompt;<br> global DestPromptFlag;<br> global WarnTime;<br> global NoPlayWarn;<br> global NoTimeLimit;<br> global creditTime;<br> global retryCnt;<br> global ParamForDest;<br> global param;
<br> <br> set status [infotag get evt_status];<br> set param(enableReporting) true;<br> set param(interruptPrompt) false;</p>
<p> </p>
<p> if {$status == "ao_000"} {</p>
<p> if {[infotag get aaa_avpair_exists h323-credit-time]} {<br> set creditTime [infotag get aaa_avpair h323-credit-time];<br> } else {<br> media play leg_incoming _no_aaa.au;<br> fsm setstate CALLDISCONNECT;<br> return;<br>
}</p>
<p> if {$creditTime <= $WarnTime} {set NoPlayWarn 1;}<br> if {$creditTime == "unlimited"} {set NoTimeLimit 1;}</p>
<p> media play leg_incoming _you_have.au %t$creditTime;<br> leg collectdigits leg_incoming param; #For Fast leg setup<br> fsm setstate PLACECALL;<br> return;<br> }</p>
<p> incr NumDestPrompt; #Call authorize failed</p>
<p> if {[infotag get aaa_avpair_exists h323-return-code]} {<br> set return_code [infotag get aaa_avpair h323-return-code];<br> } else {<br> media play leg_incoming no_aaa.au;<br> fsm setstate CALLDISCONNECT;<br> return;
<br> }</p>
<p> </p>
<p> if {$NumDestPrompt < $retryCnt} {<br> act_PlayDestReturnCode $return_code;<br> leg collectdigits leg_incoming ParamForDest;<br> } else {<br> act_GetDestination;<br> }<br> return;</p>
<p> }<br>.......<br>.......<br>proc act_CallWarnMedia { } {</p>
<p> global incoming;<br> global outgoing;</p>
<p> connection create $incoming $outgoing;<br> return;<br>}</p>
<p> </p>
<p>proc act_LongPound { } {</p>
<p> if {[infotag get evt_digit] != "#"} {<br> fsm setstate same_state;<br> return;<br> }</p>
<p> set duration [infotag get evt_digit_duration];</p>
<p> if {$duration < 300} {<br> fsm setstate same_state;<br> return;<br> }</p>
<p> connection destroy con_all;<br> return;<br>}<br>....<br>...<br>proc act_ConnDestroyed { } {</p>
<p> global account;<br> global pin;</p>
<p> leg disconnect leg_outgoing;<br> init_perCallVars;<br># act_GetDestination;<br> aaa authorize $account $pin "" "" leg_incoming;<br> fsm setstate CARDSELECTION;<br># fsm setstate DESTSELECTION;
</p>
<p> return;<br>}<br>#---------------<br>set ivr_fsm(CALLACTIVE,ev_digit_end) "act_LongPound CONNDESTROY";<br>set ivr_fsm(CONNDESTROY,ev_destroy_done) "act_ConnDestroyed same_state";<br>set ivr_fsm(CARDSELECTION,ev_authorize_done) "act_CardAuthorize same_state";
</p>
<p>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
</p>
<p>i look forward to hearing from you<br>thanks and have a nice day<br></p></div>