|
|
| Upgrading the BankHoliday with time (Switzerland) |
|
|
Hi there
I have a question regarding the BankHoliday Script. Here in Switzerland we have some part-time holidays as well (for ecampel a holiday where the company is closed from 8:00 untill 13:00 o'clock). Is ist possible to enhance the script for those part-time holidays?
I thought about using the script more then once, but it would be nicer to have it all in one script. |
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Germany) |
|
|
Hi Beni,
that would be possible with a minor modification of the existing script and txt file from the original kb article.
First you would have to extend the dates in the txt file. My following modification would except single date as also date/time ranges. E.g. something like this:
01.11.2007
24.12.2007 08:00;24.12.2007 14:00
25.12.2007;26.12.2007
31.12.2007 08:00;31.12.2007 14:00
Please note, that start end end date of a range are separated by a semicolon.
You can enter single dates per line, date ranges without any time or also date ranges including times.
Now you need to modify the existing script a little bit:
---------------
Dim bRange, aRange, vStart, vEnd
...
do while (not (file.AtEndOfStream)) and (not bReturn)
sLine = file.ReadLine
bRange = False
aRange = Split(sLine, ";")
if IsDate(aRange(0)) then
vStart = CDate(aRange(0))
if UBound(aRange) > 0 then
if IsDate(aRange(1)) then
bRange = True
vStart = CDate(aRange(1))
end if
end if
if not bRange then
if (DateDiff("d", vDate, vStart) = 0) then bReturn = True
else
if (DateDiff("n", vStart, vDate) > 0) and _
(DateDiff("n", vEnd, vDate) < 0) then bReturn = True
end if
end if
loop
---------------
Beni, I haven't tested this, but it should work. Once you have created a running ecr script from it I would like to ask you to upload it here so it will available for all other users as well.
Tom Wellige
(Lead Solution Consultant, Swyx)
I learned very early the difference between knowing the name of something and knowing something.
Richard P. Feynman
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Switzerland) |
|
|
I tested it and it seems to work. Thank you very much. |
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Germany) |
|
|
Thanks for uploading the updated script 
Tom Wellige
(Lead Solution Consultant, Swyx)
I learned very early the difference between knowing the name of something and knowing something.
Richard P. Feynman
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Switzerland) |
|
|
Sorry to bring this old Topic up again. Sadly, I got some problems with the Script. If I activate a timerange in the text file, for exampel:
30.11.2007 08:00;30.11.2007 18:00
That's the according part from the trace of the server:
SPBXScript::OutputTrace () IsBankHoliday(Now)
SPBXCtlFSM::StopFSMTimers () stopped BusyInfo timer
SPBXCtlFSM::ProcessEvent ()
~ResolvedMediaA BusyInfo Result: 0 NewSt: ResolvedMediaA
SPBXCall::~SPBXCall ()
STclCall::~STclCall ()
SwSIPCall::ActionOn3xx4xx5xx6xx () Could not send SwTCL Disconnect, result: 1
SFsm::OnProcessEvent () Calling evt3xx4xx5xx6xx Result: 0 NewSt: Disconnected
SwSIPCall::EnterStateDisconnected(1) SEND SwTCL Disconnect(ResultCallDisconnected)
SScrServer::UserDataFolderReq () returning C:\DOKUMENTE UND EINSTELLUNGEN\ALL USERS\ANWENDUNGSDATEN\SWYX\SHARE\user\benjamin
SwSIPCall::EnterStateDisconnected(1) Erase this call from list of calls.
SwSIPEndpoint::EraseCall () Search for call with Call-ID '593cea566a72a576@Y3NlcjAwMjYuY3JvcG1hcmsuY2g.' ...
SwSIPEndpoint::EraseCall () Erased Call with Call-ID '593cea566a72a576@Y3NlcjAwMjYuY3JvcG1hcmsuY2g.' from list of calls!
SwSIPCall::ClearInvitesList () Clear list of SIP INVITE messages...
SwSIPCall::ClearInvitesList () Delete SIP INVITE message with CSeq '1'
SBaseCall::~SBaseCall ()
SPBXScript::OutputTrace () --> gseEvaluateEx(Falsch)
SPBXScript::OutputTrace () <-- gseEvaluateEx, rc = 35 [gseStateEvaluateNoMatch]
SScrServer::CallIsOrigDiscRq () returning no
SPBXScript::OutputTrace () case [Skip2]
SPBXScript::OutputTrace () Rule result: Falsch
SPBXScript::OutputTrace () End GSE Script (Rule: ruleBHextended)
Any Idea what goes wrong?
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Germany) |
|
|
Hi Beni,
immediately after the function IsBankHoliday is called, the call will be disconnected. While the disconnect is propagated through the system the script still continues and reads the bank holiday file from the user folder. It doesn't matter what content this file have, the disconnect has been initiated already and sooner or later the call will be gone.
So, from my point of view it's not a problem of the script, at least not from the bank holiday function.
Tom.
Tom Wellige
(Lead Solution Consultant, Swyx)
I learned very early the difference between knowing the name of something and knowing something.
Richard P. Feynman
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Switzerland) |
|
|
Hm.. That's strange.. Because I don't get dissconnected :(
Ok, thanks for the hint's I'll see what I can find out. |
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Germany) |
|
|
So, what is the problem then ?
Tom Wellige
(Lead Solution Consultant, Swyx)
I learned very early the difference between knowing the name of something and knowing something.
Richard P. Feynman
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Netherlands) |
|
|
Hello Tom,
I am trying to get this script to work. But i get the following error:
~Code: 0
~Src: Runtimefout Microsoft VBScript
~Desc: Het subscript valt buiten het bereik: '[number: 0]'
~RetVal: 800a0009
~Line: 15409
~Column: 10
~Source code:
~
Our server is in the dutch language and the date is shown like this 03-12-2007.
Is that the problem ?
I use the downloaded script.
Pieter Eijkmans
Intratel B.V.
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Germany) |
|
|
How does your txt file look like ?
Tom Wellige
(Lead Solution Consultant, Swyx)
I learned very early the difference between knowing the name of something and knowing something.
Richard P. Feynman
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Netherlands) |
|
|
Tom,
This is the txt file:
27-02-2006
28-02-2006
17-04-2006
25-05-2006
26-05-2006
05-06-2006
25-12-2006
26-12-2006
01-01-2007
19-02-2007
20-02-2007
09-04-2007
30-04-2007
17-05-2007
18-05-2007
28-05-2007
25-12-2007
26-12-2007
01-01-2008 Pieter Eijkmans
Intratel B.V.
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Switzerland) |
|
|
Tom Wellige wrote
01.11.2007
24.12.2007 08:00;24.12.2007 14:00
25.12.2007;26.12.2007
31.12.2007 08:00;31.12.2007 14:00
Please note, that start end end date of a range are separated by a semicolon.
You can enter single dates per line, date ranges without any time or also date ranges including times.
|
I think you'd have to split your date by a dot.
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Netherlands) |
|
|
In the Netherlands we use a - as seperation mark not a dot. Pieter Eijkmans
Intratel B.V.
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Germany) |
|
|
So you have the regioal settings configured this way (03-12-2007) on the SwyxServe machine ?
Hm, do you have just the error trace or also a standard server trace from this situation ?
The runtime error message tells more or less nothing, except "index out of range"...
Tom Wellige
(Lead Solution Consultant, Swyx)
I learned very early the difference between knowing the name of something and knowing something.
Richard P. Feynman
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Netherlands) |
|
|
Ton,
Here is a part of the trace
2007/12/04 10:49:01 0096b8 Info SrvScript 05753250 00000055 SPBXScript::OutputTrace () Begin GSE Script (Rule: ruleBankHolidayextended)
2007/12/04 10:49:01 000c78 Inf3 SwTCL 08F31590 00000055 STclCallHub::OnRemoveCall (08EE3EC0) numCalls (before erase)= 2
2007/12/04 10:49:01 0096b8 Info SrvScript 05753250 00000055 SPBXScript::OutputTrace () GSEVersion: 6.0.2.121
2007/12/04 10:49:01 000c78 Inf3 SwTCL 08EE3EC0 00000055 STclCall::SetCallHub (00000000)
2007/12/04 10:49:01 0096b8 Info SrvScript 05753250 00000055 SPBXScript::OutputTrace () case [Start0]
2007/12/04 10:49:01 000c78 Inf3 SwTCL 08EE3EC0 00000055 STclCall::SetCallHub (00000000) remove old callhub 08F31590
2007/12/04 10:49:01 0096b8 Info SrvScript 05753250 00000055 SPBXScript::OutputTrace () --> gseStart()
2007/12/04 10:49:01 000c78 Inf3 SwTCL 08EE3EC0 00000055 STclCall::SetCallHub () callhub gone, remove reference to SBaseCall 08ED3300
2007/12/04 10:49:01 0096b8 Info SrvScript 05753250 00000055 SPBXScript::OutputTrace () <-- gseStart, rc = 1 [gseStateStarted]
2007/12/04 10:49:01 0096b8 Info SrvScript 05753250 00000055 SPBXScript::OutputTrace () case [Evaluate4]
2007/12/04 10:49:01 0096b8 Info SrvScript 05753250 00000055 SPBXScript::OutputTrace () IsBankHoliday(Now)
2007/12/04 10:49:01 000c78 Inf3 SrvPBXCtl 08EE2C70 00000055 SPBXCtlFSM::StopFSMTimers () stopped BusyInfo timer
2007/12/04 10:49:01 000c78 Info SrvPBXCtl 08EE2C70 00000055 SPBXCtlFSM::ProcessEvent ()
~ResolvedMediaA BusyInfo Result: 0 NewSt: ResolvedMediaA
2007/12/04 10:49:01 000c78 Inf3 SrvPBXCtl 08EE3EC0 00000055 SPBXCall::~SPBXCall ()
2007/12/04 10:49:01 000c78 Inf3 SwTCL 08EE3EC0 00000055 STclCall::~STclCall ()
2007/12/04 10:49:01 009634 Info SwSIP 08ED3300 00000055 SwSIPCall::ActionOn3xx4xx5xx6xx () Could not send SwTCL Disconnect, result: 1
2007/12/04 10:49:01 009634 Info SwSIP 08ED332C 00000055 SFsm::OnProcessEvent () Calling evt3xx4xx5xx6xx Result: 0 NewSt: Disconnected
2007/12/04 10:49:01 009634 Info SwSIP 08ED3300 00000055 SwSIPCall::EnterStateDisconnected(1) SEND SwTCL Disconnect(ResultCallDisconnected)
2007/12/04 10:49:01 0096b8 Info SrvPBXCtl 08F315B8 00000055 SScrServer::UserDataFolderReq () returning C:\DOCUMENTS AND SETTINGS\ALL USERS\APPLICATION DATA\SWYX\SHARE\user\pieter eijkmans
2007/12/04 10:49:01 009634 Info SwSIP 08ED3300 00000055 SwSIPCall::EnterStateDisconnected(1) Erase this call from list of calls.
2007/12/04 10:49:01 009634 Info SwSIP 011252E0 00000000 SwSIPEndpoint::EraseCall () Search for call with Call-ID '932d305952694524@c2VydmVyMDEudHJpbWF4eC5sb2NhbA..' ...
2007/12/04 10:49:01 009634 Info SwSIP 011252E0 00000000 SwSIPEndpoint::EraseCall () Erased Call with Call-ID '932d305952694524@c2VydmVyMDEudHJpbWF4eC5sb2NhbA..' from list of calls!
2007/12/04 10:49:01 009634 Info SwSIP 08ED3300 00000055 SwSIPCall::ClearInvitesList () Clear list of SIP INVITE messages...
2007/12/04 10:49:01 009634 Info SwSIP 08ED3300 00000055 SwSIPCall::ClearInvitesList () Delete SIP INVITE message with CSeq '1'
2007/12/04 10:49:01 009634 Inf3 SwTCL 08ED3300 00000055 SBaseCall::~SBaseCall ()
2007/12/04 10:49:01 0096b8 *ERR SrvScrAPI 08F0BED0 00000055 SPBXScriptSite::OnScriptError ()
~Code: 0
~Src: Runtimefout Microsoft VBScript
~Desc: Het subscript valt buiten het bereik: '[number: 0]'
~RetVal: 800a0009
~Line: 15409
~Column: 10
~Source code:
~
2007/12/04 10:49:01 0096b8 Info SrvPBXCtl 08F315B8 00000055 SScrServer::OnScriptFinished ()
2007/12/04 10:49:01 0096b8 Info SrvPBXCtl 08F315B8 00000055 SScrServer::ActionOnScrFinish () script finished -> inform main FSM to finish call
2007/12/04 10:49:01 0096b8 Info SrvScrAPI 011CF6E0 00000055 SScriptHost::Delete () script running, delay deletion, confCnt= 12
2007/12/04 10:49:01 0096b8 Info SrvPBXCtl 08F315B8 00000055 SScrServer::ProcessFSM ()
~Running ScrFinish Result: 0 NewSt: Idle
2007/12/04 10:49:01 008270 Info SrvPBXCtl 08EE2C70 00000055 SPBXCtlFSM::ProcessEvent ()
~ResolvedMediaA ScrFinish start processing...
2007/12/04 10:49:01 008270 Info SrvPBXCtl 08EE2C70 00000055 SPBXCtlFSM::ProcessEvent ()
~ResolvedMediaA ScrFinish Result: 1 NewSt: DisconnectPending Timeout: 60
2007/12/04 10:49:01 008270 Info SrvPBXCtl 08EE2C70 00000055 SPBXCtlFSM::ProcessEvent ()
~DisconnectPending Disconnect start processing...
2007/12/04 10:49:01 008270 Info SrvPBXCtl 08EE2C70 00000055 SPBXCtlFSM::DisconnectHdl (DiscHdlDiscPending, 00000000, ResultCallRoutingFailed, ScriptFinished, UseNormDisc)
2007/12/04 10:49:01 008270 Inf3 SrvPBXCtl 08EE2C70 00000055 SPBXCtlFSM::DisconnectHdl () 1st: disconnect initiated from script/admin
2007/12/04 10:49:01 0096b8 Inf3 SrvCOMApi 058A15F0 00000000 SPBXConfig::~SPBXConfig () Pieter Eijkmans
Intratel B.V.
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Norway) |
|
|
| p.eijkmans wrote
~Code: 0
~Src: Runtimefout Microsoft VBScript
~Desc: Het subscript valt buiten het bereik: '[number: 0]'
~RetVal: 800a0009
~Line: 15409
~Column: 10
~Source code:
|
This error tells you a lot. The error message will usually been seen if you try to access variables from an array, and you try to point to an array element that is not populated. Like you have an array holding 3 elements, and you try to access var(3). This should then be your fourth element, and it is therefor out of range.
From the number I see that your array holds actually 0 elements.
This is probably when you try to evaluate the aRange variable. This should be an array when you are using split. All this indicates that the split does not fill the aRange var as an array.
Morten Rokosz (Swyx T.A.G Member)
The best way to predict the future is to invent it. |
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Germany) |
|
|
| Morten Rokosz wrote
This error tells you a lot.
|
Of course this error tells already a lot when having a look into the sources also.
Pieter, is it possible, that you have blank lines in your bankholiday.txt file ?
I have just updated the script with some meaningfull tracie output.So, check your bankholiday.txt file. If this does not include any empty lines use the new script version from the download page to get more trace information.
Tom Wellige
(Lead Solution Consultant, Swyx)
I learned very early the difference between knowing the name of something and knowing something.
Richard P. Feynman
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Netherlands) |
|
|
Tom,
There was a blank line at the end of the file. I have removed it and now the script works !!
Thanks fot the support. Pieter Eijkmans
Intratel B.V.
|
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Norway) |
|
|
| Tom Wellige wrote
| Morten Rokosz wrote This error tells you a lot. |
Of course this error tells already a lot when having a look into the sources also.
|
Yes, like you know you are in the wood if you are sorrounded by a lot of trees 
Morten Rokosz (Swyx T.A.G Member)
The best way to predict the future is to invent it. |
|
|
|
 |  |
|
|
| Re: Upgrading the BankHoliday with time (Netherlands) |
|
|
Tom,
I have been testing the script and it is working fine.
I now have the following question, i made a shortcut to the receptions desktop to the file bankholiday.txt., so they can do changes to the dates. Soon we will upgrade to version 6.1.
Will this shortcut to change dates still work ? Because the share is moved into the database. Or do we have to change the script ?
Thanks in advance for the answer. Pieter Eijkmans
Intratel B.V.
|
|
|
|