Announcement

Collapse
No announcement yet.

Help with caller announcement script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with caller announcement script

    Here is part of a command script that asks the caller to say the name of the person that they are calling and then their name and announces it over our speakers (I'm using a USB Hi-Phone). I'm new at scripting so it may not be the cleanest script (any suggestions would be greatly appreciated). The script works ok, but there are a couple things that don't work well. First, how do I detect if a phone picks up, so that I can stop the background music. Also, is there a better way of recording their name and the person they are calling (is there a way to detect silence so that if they don't say anything it doesn't announce)? Thanks

    LABEL:RECORD_PERSON_NAME
    WAIT_TIMEOUT:3 #A 3 second pause so that the wav file plays correctly
    WAIT_KEY:#
    IF:$TIMEOUT;NEXT:;NEXT:
    CLEAR_KEY:
    PLAY:01.wav #Asks caller to say the name of the person they are calling
    PLAY:BEEP.WAV
    RECORD:calling_for.wav
    WAIT_TIMEOUT:3 #Gives caller 3 seconds to record the persons name
    WAIT_KEY:#
    IF:$TIMEOUT;NEXT:;GOTO:RECORD_PERSON_NAME
    END_RECORD:
    LABEL:RECORD_CALLER_NAME
    CLEAR_KEY:
    PLAY:02.wav #Asks caller to say their name
    PLAY:BEEP.WAV
    RECORD:caller_name.wav
    WAIT_TIMEOUT:3 #Gives caller 3 seconds to record their name
    WAIT_KEY:#
    IF:$TIMEOUT;NEXT:;GOTO:RECORD_CALLER_NAME
    END_RECORD:
    LABEL:ANNOUNCE_CALLER
    CLEAR_KEY:
    PLAY:04.wav
    VBSCRIPT: hs.SetDeviceValue ("[9", 1);NEXT:;NEXT: #Turns ceiling speakers on
    VBSCRIPT:hs.WaitSecs (1);NEXT:;NEXT:
    VBSCRIPT:hs.SetVolume (20,20,6);NEXT:;NEXT: #Sets phone volume to max
    VBSCRIPT:hs.SetVolume (20,20,4);NEXT:;NEXT: #Sets soundcard volume to max
    VBSCRIPT:hs.playwavfileEx("c:\program files\homeseer\Don't Worry.wav",6,-1,false);NEXT:;NEXT: #phone background music
    VBSCRIPT:hs.playwavfile("c:\program files\homeseer\ToneAnnounce.wav");NEXT:;NEXT: #Plays announcement over speakers
    VBSCRIPT:hs.playwavfile("c:\program files\homeseer\calling_for.wav");NEXT:;NEXT:
    VBSCRIPT:hs.WaitSecs (1);NEXT:;NEXT:
    VBSCRIPT:hs.playwavfile("c:\program files\homeseer\YouHaveACallFrom.wav");NEXT:;NEXT:
    VBSCRIPT:hs.playwavfile("c:\program files\homeseer\caller_name.wav");NEXT:;NEXT:
    VBSCRIPT:hs.WaitSecs (3);NEXT:;NEXT:
    VBSCRIPT:hs.playwavfile("c:\program files\homeseer\calling_for.wav");NEXT:;NEXT: #Repeats announcement
    VBSCRIPT:hs.WaitSecs (1);NEXT:;NEXT:
    VBSCRIPT:hs.playwavfile("c:\program files\homeseer\YouHaveACallFrom.wav");NEXT:;NEXT:
    VBSCRIPT:hs.playwavfile("c:\program files\homeseer\caller_name.wav");NEXT:;NEXT:
    VBSCRIPT: hs.SetDeviceValue ("[9", 0);NEXT:;NEXT: #turns ceiling speakers off
    VBSCRIPT:hs.SetVolume (7,7,4);NEXT:;NEXT: #Returns soundcard volume to normal level
    LABEL:WAIT_FOR_CALL_PICKUP
    CLEAR_KEY:
    WAIT_TIMEOUT:6
    WAIT_KEY:#
    IF:$TIMEOUT;GOTO:AUTO_ATTENDANT;NEXT:
    VBSCRIPT:hs.playwavfileEx("c:\program files\homeseer\blank.wav",6,-1,false);NEXT:;NEXT: #turns off phone background music - just a blank wav file
    HANGUP:
Working...
X