View previous topic :: View next topic |
Author |
Message |
mike Newbie
Joined: 22 Dec 2005 Posts: 7 Location: Glenside, PA
|
Posted: Tue Dec 27, 2005 5:43 pm Post subject: Updated "Mute While On Phone.js" fixes a problem |
|
|
In regards to the problem I had mentioned in an [url=http://www.salling.com/forums/viewtopic.php?t=3252]earlier post[/url] wherein if the system was already muted when the phone rang (or a call was made), hanging up the phone would still unmute the system, I have updated the Mute While On Phone.js to address this problem. This new version acts in a manner similar to the "Pause iTunes" scripts, where it first checks the status of the sytem mute and sets the code to either unmute or not at the end of the call accordingly.
The new code is as follows:
[code:1]var helper = new ActiveXObject("SCHelper.SECHelper");
var ShouldUnmute = false;
function CallStatusChanged( theTerminal, theCallStatus, thePhoneNumber, theCallType, theCID )
{
if( theCallStatus == 1 ) {
// Phone is idle
if( ShouldUnmute == true ) {
helper.systemMute = false;
}
} else if( theCallStatus == 2 || theCallStatus == 7 ) {
// Incoming or outgoing call
ShouldUnmute = false;
if( helper.systemMute == false ){
ShouldUnmute = true;
helper.systemMute = true;
}
}
}
[/code:1]
I have also attached the new .js file for easy download. Just download, unzip, and put it into the "C:\Program Files\Salling Software AB\Salling Clicker\Default Scripts\Mute While On Phone" folder, replacing the old script. I would recommend making a backup of the old .js file, just in case.
This was my first time programming in JS, so if there are any problems or if anyone sees an easier/better way to do what I did, feel free to make changes.
-Mike
Description: |
|
 Download |
Filename: |
Mute While On Phone.zip |
Filesize: |
408 Bytes |
Downloaded: |
855 Time(s) |
|
|
Back to top |
|
 |
salling Site Admin
Joined: 27 Jul 2004 Posts: 7498 Location: Stockholm, Sweden
|
Posted: Tue Dec 27, 2005 6:00 pm Post subject: |
|
|
Thanks!
One note:
If you instead duplicate and include the original XML file with your distribution, the fixed script can be installed by placing it in the "My Clicker Scripts" folder. This is preferable, as it won't cause problems in future software upgrades.
Scripts in the My Clicker Scripts folder takes precedence to default scripts when the UUIDs are the same.
Best.
--
Jonas
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|