Tom Wellige Posted February 27, 2015 #1 Share Posted February 27, 2015 Today's first question of the Presales department: Is it possible to check if one user in a goup is busy and if so not to connect the call to the group but instead disconnect the call with busy? Of course! Copy the following code into the Start block: Function IsAtLeastOneAgentBusy(ByVal sNumber) PBXScript.OutputTrace("-------> IsAtLeastOneAgentBusy ( sNumber = " & sNumber & " )") Dim bReturn bReturn = False Dim PBXConfig Set PBXConfig = PBXScript.CreateObject("IpPbxSrv.PBXConfig") PBXConfig.Initialize(PBXUser) Dim Users Set Users = PBXConfig.GetUserByAddress(sNumber) Dim User For Each User In Users PBXScript.OutputTrace("Found user " & User.Name & " with current state " & User.State) ' does the server recognize this user a busy ? If (User.State = 3) or (User.State = 5) Then PBXScript.OutputTrace("User is busy!") bReturn = True End If Next IsAtLeastOneAgentBusy = bReturn PBXScript.OutputTrace("bReturn = " & bReturn) PBXScript.OutputTrace("<------- IsAtLeastOneAgentBusy") End FunctionAfterwards use an Evaluate block to call the function. Let's assume the group number is 200: IsAtLeastOneAgentBusy(200)The result is then directly on one of the two exits of this block. Then just either use a Connect To block to connect the call to the group or a Disconnect block (with "busy" configured as reason) to disconnect it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.