Jump to content

Script API "IsGroupLoggedOff"


mac_key
 Share


Go to solution Solved by Tom Wellige,

Recommended Posts

And the user for whom the call routing script is running is also part of that group?

 

You can take a look into the server trace to see exactly what the function IsGroupLoggedOff is doing.

 

The following article describes how to identify and filter a spcific call within the server trace file and how to filter it further down to just the call routing trace output:

 

Feel free to post that filtered trace output here.

 

Link to comment
Share on other sites


It's a 13.28, so i ran the script in the group call routing manager.  Here is a part of the Logfile from a group with nobody of the members logged in:

 

29 12:11:52.504 0013e4 Info SrvPBXCtl  09D815C0 0000009b SScrServer::EntityGetId                 () -> G:11
29 12:11:52.504 0013e4 Inf3 SrvPBXCtl  09D815C0 0000009b SScrServer::EntityGetName               () returning: Testgruppe
29 12:11:52.504 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () Script for group [11] Testgruppe
29 12:11:52.504 0013e4 Info SrvScrAPI  09D815C0 0000009b SScrServer::EntityGetRIEnabled          () returning 0
29 12:11:52.504 0013e4 Info SrvScrAPI  09D815C0 0000009b SScrServer::EntityGetRIUsePIN           () returning 0
29 12:11:52.504 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () RI/PL parameters loaded: 0,Falsch,XXX,Falsch,
29 12:11:52.504 0013e4 Info SrvPBXCtl  09D815C0 0000009b SScrServer::CallGetCalledNumber         () returning 13
29 12:11:52.504 0013e4 Info SrvPBXCtl  09D815C0 0000009b SScrServer::CallGetDialedNumReq         () returning 13
29 12:11:52.504 0013e4 Info SrvPBXCtl  09D815C0 0000009b SScrServer::CallGetCallTypeReq          () returning 'Group'
29 12:11:52.504 0013e4 Info SrvPBXCtl  09D815C0 0000009b SScrServer::GetCallingNumber            () returning '+49CALLER'
29 12:11:52.504 0013e4 Info SrvPBXCtl  09D815C0 0000009b SScrServer::GetCallingNumber            () returning '+49CALLER'
29 12:11:52.504 0013e4 Inf3 SrvPBXCtl  09D815C0 0000009b ScriptInfo::GetPreviousScripts          (connId 155) no previous scripts available
29 12:11:52.504 0013e4 Inf3 SrvPBXCtl  09D815C0 0000009b SScrServer::GetPreviousScripts          () NO script found
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () rule PreProcessing started...
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () User-defined PreProcessing (dummy)
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () Begin GSE Script (Rule: ruleWhrendGZeiten)
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () GSEVersion: 13.27.0.31
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              ()   case [Start0]
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () --> gseStart()
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () <-- gseStart, rc = 1 [gseStateStarted]
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              ()   case [Evaluate6]
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () IsGroupLoggedOff(11)
29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () -------------> IsGroupLoggedOff ( sNumber = 11 )
29 12:11:52.511 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () bReturn = Wahr
29 12:11:52.511 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () <------------- IsGroupLoggedOff
29 12:11:52.511 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () --> gseEvaluateEx(Wahr)
29 12:11:52.511 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () <-- gseEvaluateEx, rc = 34 [gseStateEvaluateMatch]
29 12:11:52.511 0013e4 Info SrvPBXCtl  09D815C0 0000009b SScrServer::CallIsOriginatorDiscd       () returning no
29 12:11:52.511 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              ()   case [PlaySound7]
29 12:11:52.511 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () --> gsePlaySoundEx2(niemand da.wav, , Falsch, , Wahr, Falsch, , Falsch)
29 12:11:52.511 0013e4 Info SrvPBXCtl  09D815C0 0000009b SScrServer::CallGetDtmfInput            (niemand da.wav, U:0, name , dir 0, skip 0 sec, rep 0, interval 0 sec, mask= '', timeout 0 sec, repeat after hold/transfer: YES)
29 12:11:52.511 0013e4 Inf2 SrvPBXCtl  09D815C0 0000009b SScrServer::EventGetDtmfInput           ()
29 12:11:52.511 0010d0 Inf2 SrvPBXCtl  097A7660 0000009b SScriptFsm::ActionOnGetDtmfInputWInbound()
29 12:11:52.511 0010d0 Inf3 SrvPBXCtl  09719D88 0000009b SPBXCall::EventAlert                    (alert type: AlertTypeNormal, , <empty>, redir <empty>)
29 12:11:52.512 000a3c Inf2 SrvPBXCtl  09CCA190 0000009b SPBXCallFSM::ActionOnAlert              () B1-A
29 12:11:52.512 0010d0 Info SrvPBXCtl  097A7660 0000009b SScriptFsm::TraceTransition             () Inbound --GetDtmfInput--> AlertingGetDtmf (Result: 0)
 

Link to comment
Share on other sites


  • Solution
4 hours ago, mac_key said:

29 12:11:52.505 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () -------------> IsGroupLoggedOff ( sNumber = 11 )
29 12:11:52.511 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () bReturn = Wahr
29 12:11:52.511 0013e4 Info SrvScript  09CD46C0 0000009b SPBXScriptVbs::OutputTrace              () <------------- IsGroupLoggedOff

 

This function doesn't work in a group call routing at the moment. It uses "g_PBXConfig.GetUserByAddress" which is not working in a group context. 

 

As stated on the IsGroupLoggedOff page you can use the PBXGroup.IsLoggedIn in a group call routing script. 

 

The usage is as simple as with the previous function:

 

if not IsGroupLoggedOff ("11") then
	...
end if

 

respective:

 

if PBXGroup.IsLoggedIn then
	...
end if

 

 

Or when being used in an Evaluate block (Variable auswerten):

 

image.png

 

 

Link to comment
Share on other sites


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
 Share


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.