Bill:
Ok I have to start from the begining, and first to say is I am sorry if it seems I have waisted your time so far
. I am a person that likes to try to solve my own problems, and learn on the way and not have everything just handed to me. So that been said we are using your software to help us in our Ambulance Service, and at first we only used it to display the Name and Number of the caller because of time of emerency people forget to leave that kind of info.
Our service is located in a remote area and we do not have a dispatch service we use a answer machine/pagers system. As we look into all your software could do, our PCP started dream of things that would help us to respond to a call faster and more.
Ok enough of the background now the script.
When a call comes in the answer machine/pager pickup on the 2 ring but if we are already out on a call, then on the 3 ring it gets tranfser to our ambulance cell # and if we don't anwser it and get forward to an other service up the coast.
Code: Select all
//LANGUAGE=DWS
RunWait('C:/Documents and Settings/Owner/My Documents/Heartbeat/Recv.Call.php'); // #1
//if CallInfo.Rings = 2 then // # 2
//begin
// SendMail('911', 'xxxxx.com', 'Call from ' + CallInfo.Name + ' at ' + CallInfo.Number, ' Their was an Emerency Call while you were already out on a call from ' + CallInfo.Name + ' @ ' + CallInfo.Number + ' located at ' + CallInfo.Address + ' in ' + CallInfo.City + ' Http://www.xxxxx:8080');
// SendMail('911', 'xxxxx.com', // we have other staff members with their personal messages to their phone as a text also.
//end
//else
if CallInfo.Rings = 3 then // # 3
begin
SendMail('911', 'xxxxxx.com', 'Missed a call ? from ' + CallInfo.Name + ' at ' + CallInfo.Number, ' Their was an Emerency Call while you were already out on a call from ' + CallInfo.Name + ' @ ' + CallInfo.Number + ' located at ' + CallInfo.Address + ' in ' + CallInfo.City + ' Http://www.xxxxxx:8080');
SendMail('Joe', 'xxxxx.com', 'You have a call coming in from ' + CallInfo.Name + ' at ' + CallInfo.Number, ' Their was an Emerency Call while you were already out on a call from ' + CallInfo.Name + ' @ ' + CallInfo.Number + ' located at ' + CallInfo.Address + ' in ' + CallInfo.City + ' Http://www.xxxxx:8080');
Exit;
end;
SendMail('911', 'xxxxxxx.com', 'Call from ' + CallInfo.Name + ' at ' + CallInfo.Number, ' This is a Emerency Call from ' + CallInfo.Name + ' @ ' + CallInfo.Number + ' located at ' + CallInfo.Address + ' in ' + CallInfo.City + ' Http://www.xxxxxx:8080'); // # 4
RunWait('modem call back script.exe'); // # 5
SpeakWait('One Moment Please,'); // # 6
Sleep(2800);
SpeakWait('Thank You for waiting, This is a message from xxxxx Ambulance Service');
if (Time > StrToTime('1 am')) and (Time <StrToTime> StrToTime('12 pm')) and (Time < StrToTime('5 pm')) then
begin
Speakwait('Good afternoon');
end
else
begin
Speakwait('Good evening');
end;
//if CallInfo.FoundCaller or
// AnsiSameText(Trim(CallInfo.SpeakName), Trim(CallInfo.Number)) then
Speakwait('we have received your call of needing Medical Care, and have notify our staff, Thank you and Good Bye');
RunWait('C:\Program Files\Windows NT\Modem Hangup Local.exe'); // # 7
const FIREFOX='C:\Program Files\Mozilla Firefox\firefox.exe'; // # 8
RunWait(FIREFOX, 'http://www.bing.com/maps/?v=2&cp=' + CallInfo.County + '&lvl=17&dir=0&sty=h&sp=&where1=' + CallInfo.SpeakName);
RunWait('c:\reboot\reboot.bat'); // # 9
Exit; // # 10
I have number the beginning of each line script to try to make things easier to explain.
Line # 1 sends message to our screen located in our bay.
I did try line # 2 script , when a call has 2 ring do line #1,2,5,6,7,8,9 and 10 and yes I did remove the // in front of it. But it didn't work.
So then I remove line # 2 script and when a call came in with 2 rings it did line #1,4,5,6,7,8,9 and 10 and work perfect. The problem is when recv. a call with 3 rings it wouldn't just do Line # 1,3 and 10, it ran from line # 1,4 to 10.
I still don't understand why the line # 3 script doesn't work when a call comes in with only 3 rings but does work when you right click and select "test action" under the call tab of the main windows program that has 3 ring log assign to it, also I have remove the Hangup; like you say to do.
Code: Select all
if CallInfo.Rings = 3 then // # 3
begin
SendMail('911', 'xxxxxx.com', 'Missed a call ? from ' + CallInfo.Name + ' at ' + CallInfo.Number, ' Their was an Emerency Call while you were already out on a call from ' + CallInfo.Name + ' @ ' + CallInfo.Number + ' located at ' + CallInfo.Address + ' in ' + CallInfo.City + ' Http://www.xxxxxx:8080');
SendMail('Joe', 'xxxxx.com', 'You have a call coming in from ' + CallInfo.Name + ' at ' + CallInfo.Number, ' Their was an Emerency Call while you were already out on a call from ' + CallInfo.Name + ' @ ' + CallInfo.Number + ' located at ' + CallInfo.Address + ' in ' + CallInfo.City + ' Http://www.xxxxx:8080');
Exit;
end;
So this would be the perfect sitution ,when a call comes in with 2 rings it would do line # 1,2,5,6,7,8,9 and 10 and a call with 3 rings do line # 1,3,8,9 and 10. Second best would be on a call with 3 rings do line # 1,3,9 and 10.
A big reason why ( and there is so many ) we like this program, it fast when a call comes in we have recv. a text message of the callers info. even before they have hang up and would not like to sacrifice that speed with a script that requires waiting to long .
Maybe you shouldn't have said:
Scripting is an advanced feature, and will be not easy for non-programmers, so don't feel bad! I'm happy to help with scripting questions.
P.S Line # 5 and 7 runs our second modem attached to another phone to run a call back service and is separated from your software.