VoiceGuide IVR Software Main Page
Jump to content

Can I send SMS message to Phone (Variable)

Recommended Posts

Most common way of achieving this is to use a "Send Email" module to send an email to the email->sms service/gateway.

There are many of these services. Google "Email to SMS" to find one in your area.

If you know the mobile network that the phone is on then you can usually just send email to that network operators email->sms gateway for free.

 

Alternative approach for remote sites with no internet connection is to attach a GSM modem to the server and issue SMS send command to it using a "Run Program" module.

 

Share this post


Link to post

Dear Sir

I have already make attendence  script to record the attendence  for remote site staffs

 But How to send email or SMS to the confirm with each staffs  who just take attend (evidence)

 

Thanks

Share this post


Link to post

Dear Sir

I use below VBscript to add new record of IVRattenednece .txt ,

how to send mail with last record using Email modules ?

 

Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
set fso = CreateObject("Scripting.FileSystemObject")
set tsFile = fso.OpenTextFile("c:\Program Files\VoiceGuide\Scripts\Meter Reading\IVRattendence.txt", ForAppending, True)

If $RV_HH > 12 Then

  ihh =right("0" &cstr($RV_HH - 12),2)
  tsFile.WriteLine "20$RV_YY/$RV_MM/$RV_DD PM " & ihh & ":$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & vbTab & "$RV[GetID]"

Else

    If $RV_HH = 12 Then
           tsFile.WriteLine "20$RV_YY/$RV_MM/$RV_DD PM " & 12 & ":$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & vbTab & "$RV[GetID]"
     Else
          tsFile.WriteLine "20$RV_YY/$RV_MM/$RV_DD AM $RV_HH:$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & VbTab & "$RV[GetID]"

    End If

End If

 

 

tsFile.Close
set tsFile = Nothing
set fso = Nothing

 

Share this post


Link to post

Here is one way:

Change your script to this:
 

Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
set fso = CreateObject("Scripting.FileSystemObject")
set tsFile = fso.OpenTextFile("c:\Program Files\VoiceGuide\Scripts\Meter Reading\IVRattendence.txt", ForAppending, True)

If $RV_HH > 12 Then
  ihh =right("0" &cstr($RV_HH - 12),2)
  sDetails = "20$RV_YY/$RV_MM/$RV_DD PM " & ihh & ":$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & vbTab & "$RV[GetID]"
Else

  If $RV_HH = 12 Then
    sDetails = "20$RV_YY/$RV_MM/$RV_DD PM " & 12 & ":$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & vbTab & "$RV[GetID]"
  Else
    sDetails = "20$RV_YY/$RV_MM/$RV_DD AM $RV_HH:$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & VbTab & "$RV[GetID]"
  End If

End If

tsFile.WriteLine sDetails
tsFile.Close
set tsFile = Nothing
set fso = Nothing

set vg = CreateObject("vgServices.CommandLink")
vg.RvSet $RV_LINEID, "logged_details", sDetails
vg.Run_ResultReturn $RV_LINEID, "Success"
set vg = Nothing

and then in Send Email module you can use this $RV:

$RV[logged_details]

as part of the body of the email message sent.

 

 

Share this post


Link to post

Dear Sir

I don' t know where the location of code put in my script ?

set vg = CreateObject("vgServices.CommandLink")
vg.RvSet $RV_LINEID, "logged_details", sDetails
vg.Run_ResultReturn $RV_LINEID, "Success"
set vg = Nothing

 

Version=7.0
DefaultModuleDisplayHeight=
StartModule=Check Caller ID
RunAtHangup=
StartWithoutAnswer=1
CtmAsiName=

[Get Lang]
Type=Play
DispSize=69
Txt="Welcome hotline.  For Cantonese, please press 1.  For English, please press 3."
PlayFile1=get lang.wav
Replay=0,1
strTtsText=
on {1} goto [GetID]
on {2} goto [GetID]
on {3} goto [GetID]
on {4} goto [GetID]
on {5} goto [GetID]
on {6} goto [GetID]
on {7} goto [GetID]
on {8} goto [GetID]
on {9} goto [GetID]
on {0} goto [GetID]

Position=233,115

[GetID]
Type=Get Numbers
DispSize=69
Txt=Beep and get worker ID.
PlayFile1=C:\Program Files\VoiceGuide\Scripts\Meter Reading\playSTD.wav
PlayFile2=C:\Program Files\VoiceGuide\Scripts\Meter Reading\saystd.wav
PlayFile3=C:\Program Files\VoiceGuide\Scripts\Meter Reading\confirm_1.wav
PlayFile4=C:\Program Files\VoiceGuide\Scripts\Meter Reading\Playswrong.wav
Replay=10,4
GetNbrLen_Min=5
GetNbrLen_Max=5
Confirm=ON
VbScript=
VbsHoldPlay=
on {success} goto [ConfirmID]
on {timeout 2} goto [Hangup the Call]

Position=58,156

[ConfirmID]
Type=Play
DispSize=69
Txt="Please press 1 if that's correct, or press 2 to re-enter."
Replay=0,0
strTtsText=
on {timeout 0} goto [Save Data to File VBS_7]
on {timeout 2} goto [Hangup the Call]

Position=58,260

[ThankA]
Type=Play
DispSize=69
Txt="Thank you.  Goodbye."
PlayFile1=saystdbye.wav
Replay=0,0
strTtsText=
on {success} goto [Hangup the Call]

Position=192,488

[Hangup the Call]
Type=Hangup the Call
DispSize=69
Txt=Hangup the call.

Position=445,536

[Save Data to File VBS_7]
Type=Run VB Script
DispSize=69
Txt=Save entered data to a file using VBScript
VbsFileToRun=
VbsWait=1
VbScript=
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
set fso = CreateObject("Scripting.FileSystemObject")
set tsFile = fso.OpenTextFile("c:\Program Files\VoiceGuide\Scripts\Meter Reading\IVRattendence.txt", ForAppending, True)

If $RV_HH > 12 Then

 

  ihh =right("0" &cstr($RV_HH - 12),2)

 

  tsFile.WriteLine "20$RV_YY/$RV_MM/$RV_DD PM " & ihh & ":$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & vbTab & "$RV[GetID]"

 

Else

  tsFile.WriteLine "20$RV_YY/$RV_MM/$RV_DD AM $RV_HH:$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & VbTab & "$RV[GetID]"

 

End If

 

 

tsFile.Close
set tsFile = Nothing
set fso = Nothing
VbsHoldPlay=
on {success} goto [ThankA]
on {fail} goto [ThankA]
on {timeout 0} goto [ThankA]

Position=63,365

[OLD Save Data to File_18]
Type=Run Program
DispSize=69
Txt=Echo the entered data to a file. This DOS Command line  approach will result in the saved data being mangled if more the one line writes to the file at precisely the same time.
ProgramToRun=command.com /c echo $RV[GetID] >> c:\Program Files\VoiceGuide\Scripts\Meter Reading\IVRAttendence.txt
RunHoldPlay=
RunMode=1
RunWait=1
on {success} goto [ThankA]
on {fail} goto [ThankA]
on {timeout 0} goto [ThankA]

Position=286,362

[Check Caller ID]
Type=Evaluate
DispSize=69
Txt=Evaluate the Result Variable specified, and select the path which matches the current value of the Result Variable
Expression="$RV_CIDNUMBER"
ExprNewRV=
ExprStoreRV=0
ExprStoreInGlobalRV=0
on {true} goto [Get Lang]
on {Private} goto [Play 2]
on {OUTOFAREA} goto [Play 2]
on { } goto [Play 2]

Position=325,15

[Play 2]
Type=Play
DispSize=69
Txt=Play a sound file, then await a response...
PlayFile1=C:\Program Files\VoiceGuide\System\Voice_1\beep1.wav
Replay=0,5
strTtsText=
on {timeout 2} goto [Save Data to File VBS_1]

Position=563,226

[Save Data to File VBS_1]
Type=Run VB Script
DispSize=69
Txt=Save entered data to a file using VBScript
VbsFileToRun=
VbsWait=1
VbScript=
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
set fso = CreateObject("Scripting.FileSystemObject")
set tsFile = fso.OpenTextFile("c:\Program Files\VoiceGuide\Scripts\Meter Reading\IVRPrivate.txt", ForAppending, True)

If $RV_HH > 12 Then

 

  ihh =right("0" &cstr($RV_HH - 12),2)

 

  tsFile.WriteLine "20$RV_YY/$RV_MM/$RV_DD PM " & ihh & ":$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & vbTab & "$RV[GetID]"

 

Else

  tsFile.WriteLine "20$RV_YY/$RV_MM/$RV_DD AM $RV_HH:$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & VbTab & "$RV[GetID]"

 

End If

 

 

tsFile.Close
set tsFile = Nothing
set fso = Nothing


VbsHoldPlay=
on {success} goto [Hangup the Call]
on {timeout 0} goto [Hangup the Call]
on {fail} goto [Hangup the Call]

Position=595,378

 

Share this post


Link to post

In the same 'Run VBS' module (module is: "Save Data to File VBS_7")

The entire quoted script from our post goes in the same one module.

 

Share this post


Link to post

Dear Sir

I have already send mail , BUT , Can I send different email address according to (GET ID ) staffs ?

 

Thanks

Share this post


Link to post

Yes. You can use a Result Variable for the "To:" destination field, and set that $RV to any email address(es).

Probably easiest to use an Evaluate Expression module to set the $RV:

https://www.voiceguide.com/vghelp/source/html/modevalexpr.htm

Have one Evaluate Expression module set $RV[dest_email] to one value and have another Evaluate Expression module set $RV[dest_email] to another value etc. Then have script run one module or another before calling the Send Email module, and in Send Email module use $RV[dest_email] in the "To:" field.

 

More information on Result Variables:

https://www.voiceguide.com/vghelp/source/html/resultvariables.htm

 

Send Email module:

https://www.voiceguide.com/vghelp/source/html/modsendemail.htm

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×