Sign in to follow this  
Ruhrpottfon

CR: Skip group if everybody is logged off

Recommended Posts

Hi community,

 

I'm trying to setup a call routing for one of our customers. They have 3 groups that are called in a chain. If the first group (azubi) is not answering in 6 seconds tha call goes to the next group (Buero), after additional 20 seconds the call goes to group 3. Now they want to have the call go directly to group 3 if the other group members are no inhouse.

I've come up with this code for the start block:

 

Function AzubiStatus()
    Dim nReturn
    nReturn = 1
 
    Dim Users = New Integer() {23, 24}
    Dim User

    For index = 0 To Users.GetUpperBound(0)
	dim Current
	Set Current = g_PBXConfig.GetUserByAddress(Users(index))
        PBXScript.OutputTrace("Found user " & Current.Name & " with current state " & Current.State)
        If Current.State <> 1 Then
            nReturn = 0
        End If
    Next
 
    AzubiStatus = nReturn
    PBXScript.OutputTrace("nReturn = " & nReturn)
    PBXScript.OutputTrace("<------------- UserStatus")
 
End Function

Function BueroStatus()
    Dim nReturn
    nReturn = 1
 
    Dim Users = New Integer() {21, 22, 23, 24}
    Dim User

    For index = 0 To Users.GetUpperBound(0)
	dim Current
	Set Current = g_PBXConfig.GetUserByAddress(Users(index))
        PBXScript.OutputTrace("Found user " & Current.Name & " with current state " & Current.State)
        If Current.State <> 1 Then
            nReturn = 0
        End If
    Next
 
    BueroStatus = nReturn
    PBXScript.OutputTrace("nReturn = " & nReturn)
    PBXScript.OutputTrace("<------------- UserStatus")
 
End Function

 

Function AzubiStatus checks if any of these numbers 23, 24 are inhouse, (logged in) if not go to the next group.

Function BueroStatus checks if any of these numbers 21, 22, 23, 24 are inhouse, (loggin in) if not go to the next group.

 

Does this work wherne I call these functions in a block in front of the groups? Is there a more elegant way to check the status of group members?

CR.PNG.a6d88e9bf7fdaca9a902ca7461973a17.PNG

 

 

Edited by Ruhrpottfon

Share this post


Link to post
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
Sign in to follow this