Forum

 
  Forums  Development  Extended Call R...  Upgrading the BankHoliday with time
Previous Previous
 
Next Next
New Post 9/18/2007 2:57 PM
Resolved
User is offline Beni
57 posts
www.cropmark.ch
5th Level Poster


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.

 
New Post 9/18/2007 3:46 PM
User is offline Tom Wellige
821 posts
www.swyx.com
1st Level Poster








Re: Upgrading the BankHoliday with time  (Germany)
Modified By Tom Wellige  on 9/18/2007 2:48:52 PM)

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)

"It is a capital mistake to theorize before you have all the evidence. It biases the judgment."
Sir Arthur Conan Doyle - Sherlock Holmes - A Study in Scarlet

 
New Post 9/19/2007 12:08 PM
User is offline Beni
57 posts
www.cropmark.ch
5th Level Poster


Re: Upgrading the BankHoliday with time  (Switzerland)

I tested it and it seems to work. Thank you very much.

 
New Post 9/19/2007 2:34 PM
User is offline Tom Wellige
821 posts
www.swyx.com
1st Level Poster








Re: Upgrading the BankHoliday with time  (Germany)

Thanks for uploading the updated script


Tom Wellige
(Lead Solution Consultant, Swyx)

"It is a capital mistake to theorize before you have all the evidence. It biases the judgment."
Sir Arthur Conan Doyle - Sherlock Holmes - A Study in Scarlet

 
New Post 11/30/2007 9:56 AM
User is offline Beni
57 posts
www.cropmark.ch
5th Level Poster


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?

 

 
New Post 11/30/2007 10:25 AM
User is offline Tom Wellige
821 posts
www.swyx.com
1st Level Poster








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)

"It is a capital mistake to theorize before you have all the evidence. It biases the judgment."
Sir Arthur Conan Doyle - Sherlock Holmes - A Study in Scarlet

 
New Post 11/30/2007 10:42 AM
User is offline Beni
57 posts
www.cropmark.ch
5th Level Poster


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.

 
New Post 11/30/2007 11:03 AM
User is offline Tom Wellige
821 posts
www.swyx.com
1st Level Poster








Re: Upgrading the BankHoliday with time  (Germany)

So, what is the problem then ?


Tom Wellige
(Lead Solution Consultant, Swyx)

"It is a capital mistake to theorize before you have all the evidence. It biases the judgment."
Sir Arthur Conan Doyle - Sherlock Holmes - A Study in Scarlet

 
New Post 12/3/2007 11:01 AM
User is offline p.eijkmans
14 posts
www.intratel.nl
9th Level Poster


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.
 
New Post 12/3/2007 12:59 PM
User is offline Tom Wellige
821 posts
www.swyx.com
1st Level Poster








Re: Upgrading the BankHoliday with time  (Germany)

How does your txt file look like ?


Tom Wellige
(Lead Solution Consultant, Swyx)

"It is a capital mistake to theorize before you have all the evidence. It biases the judgment."
Sir Arthur Conan Doyle - Sherlock Holmes - A Study in Scarlet

 
New Post 12/3/2007 1:06 PM
User is offline p.eijkmans
14 posts
www.intratel.nl
9th Level Poster


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.
 
New Post 12/4/2007 9:42 AM
User is offline Beni
57 posts
www.cropmark.ch
5th Level Poster


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.

 

 
New Post 12/4/2007 10:11 AM
User is offline p.eijkmans
14 posts
www.intratel.nl
9th Level Poster


Re: Upgrading the BankHoliday with time  (Netherlands)

In the Netherlands we use a - as seperation mark not a dot.


Pieter Eijkmans Intratel B.V.
 
New Post 12/4/2007 10:39 AM
User is offline Tom Wellige
821 posts
www.swyx.com
1st Level Poster








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)

"It is a capital mistake to theorize before you have all the evidence. It biases the judgment."
Sir Arthur Conan Doyle - Sherlock Holmes - A Study in Scarlet

 
New Post 12/4/2007 10:52 AM
User is offline p.eijkmans
14 posts
www.intratel.nl
9th Level Poster


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.
 
New Post 12/4/2007 11:29 AM
User is offline Morten Rokosz
793 posts
gui.this-is-voip.net
1st Level Poster








Re: Upgrading the BankHoliday with time  (Norway)