cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2543
Views
0
Helpful
7
Replies

TCL - the media file repeats itself every 1 sec

preethamk
Level 1
Level 1

Hi we have a TCL script which outpulses account number as DTMF to an 800 number and while this outpulse occurs the inbound caller hears music. The music file does not play continuously instead repeats itself every 1 secs sounding like a broken record. The call flow is as follows

PSTN--> GW-->CVP-->ICM-->Xfer to 800XXXXXXX*123456-->inbound dial-peer on GW which invokes TCL-->outgoing pots dial-peer-->PSTN.

Everything else with this application works fine except for the music file.

Thanks for the help

Preetham

1 Accepted Solution

Accepted Solutions

Hi Preetham,

Attached the modified script.

Thanks,

Raghavendra

View solution in original post

7 Replies 7

Raghavendra G V
Cisco Employee
Cisco Employee

Hi Preetham,

When you say "music file does not play continuously" are you referring to incoming leg, from your script i see below code will run every time you play digit.

# playing music on hold to incoming

        media play $incoming flash:en_moh.au

you can you use below arguments for media play command to play digits or phone number.

– %pnum—Plays a phone number. The maximum number of digits is 64. This does not insert any

text, such as “the number is,” but it does put pauses between groups of numbers. It assumes

groupings as used in common numbering plans. For example, 18059613641 is read as 1 805 961

3641. The pauses between the groupings are 500 ms.

– %nnum—Plays a string of digits without pauses.

for more information please refer our TCL IVR programming guide in below location.

TCL IVR API Version 2.0 Programming Guide - Chapter 3 -- Command Reference [Cisco TCL Scripts for IOS Gateways] - Cisco

Thanks,

Raghavendra

Hi Raghavendra,

       The music is played to the incoming leg. The digits are played correctly, we have no issues there. It is just that the music file does not play continuously, it seems like it starts, plays for a sec then stops and starts again. This happens till all the digits are out pulsed. If you have any inputs to modify the way music is being played to the incoming leg so that it plays in continuity, please share.

Thanks

Preetham

I wonder if this has something to do with out pulsing the DTMF. Try play audio file to out leg instead of dtmf tone. I know this doesn't solve your issue but know the cause may help to find a solution.

Hi Preetham,

You are playing music to incoming leg every time you play digit to outgoing leg because of that it stops and starts again.

you can set playmoh  0 in act_Setup so that it play once.

if {$playmoh == 0} {

        # playing music on hold to incoming

        media play $incoming flash:en_moh.au

        set playmoh 1

   }

Thanks,

Raghavendra

Hi Raghavendra,

        I am not very familiar with TCL scripting, but I did attempt what you asked me to do. Here is the sample of what I did and I got the same result. Let me know if this is correct.

proc act_SendDigits { } {

  global account_num

  global currentDigit

  global stringLength

  global incoming

  global outgoing

  global playmoh

  set playmoh 0

   

      if {$playmoh == 0}  {

    # playing music on hold to incoming

        media play $incoming flash:en_moh.au

  set playmoh 1

      }

  set d [string index $account_num $currentDigit]

  puts "\n\n******* current = $currentDigit, length = $stringLength ********\n"

    if {$currentDigit < $stringLength}  {

       set prompt flash:en_$d.wav

   

              media play $outgoing  %s300 $prompt

       

              set currentDigit [expr {$currentDigit + 1}]

    } else {

  # stop music after finish playing DTMF

  fsm setstate SENDDIGITDONE

                media stop $incoming

  connection create $incoming $outgoing

   }

 

}

Hi Preetham,

Attached the modified script.

Thanks,

Raghavendra

Hi Raghavendra,

           Thank you for the script. The music plays continuously now. There is one behavior I am seeing where the music stops just before sending the last digit which in turn creates about 4secs of silence. Is there a way to have the music play till all the digits are sent. If we can't thats ok, but thank you very much for your help.

Thanks

Preetham