Tom Wellige 59 Report post Posted September 3, 2019 This post is taken from the Swyx Forum Archive (2007-2014) and was originally posted 10.08.2010 by me This function returns True if the current script user has an unconditional redirection enabled and configured to an external destination. It makes use of the PBXConfig object which is fully described in the following Swyx knowledgebase article: Request configuration and user data (incl. user status) within an Extended Call Routing script (kb2910) Please note that it is not necessary to instantiate the PBXConfig object yourself, as it is already available in the global variable g_PBXConfig. This object is used to get the configured public line access on the server. It also uses the PBXUser.UnconditionalRedirect and PBXUser.UnconditionalRedirectNumber to check the redirection configuration. To use the function within your call routing script just copy&paste it into the "Start" block and call it afterwards within an "Evaluate" block. '---------------------------------------------------------------- ' IsExternalRedirectionConfigured ' ' Checks if there is an unconditional call forwarding configured to an ' external number. The function checks if the configured unconditional ' call forwarding starts with the configured public line access. ' ' Parameter: ' ' Return: ' boolean '---------------------------------------------------------------- Function IsExternalRedirectionConfigured() PBXScript.OutputTrace "-------------> IsExternalRedirectionConfigured" Dim bReturn bReturn = False Dim sPublicLineAccess sPublicLineAccess = g_PBXConfig.PublicAccessPrefix() PBXScript.OutputTrace "Configured public line access: " & sPublicLineAccess ' check forwarding If PBXUser.UnconditionalRedirect Then PBXScript.OutputTrace "Unconditional call forwarding configured to " & PBXUser.UnconditionalRedirectNumber If Left(PBXUser.UnconditionalRedirectNumber, Len(sPublicLineAccess)) = sPublicLineAccess Then PBXScript.OutputTrace "External call forwarding configured" bReturn = True Else PBXScript.OutputTrace "Internal call forwarding configured" End If Else PBXScript.OutputTrace "No unconditional call forwarding configured" End If IsExternalRedirectionConfigured = bReturn PBXScript.OutputTrace "bReturn: " & bReturn PBXScript.OutputTrace "<------------- IsExternalRedirectionConfigured" End Function 0 Quote Share this post Link to post Share on other sites