Tom Wellige Posted September 3, 2019 #1 Posted September 3, 2019 The following forum topic is restored from the Swyx Forum Archive (2007-2014) Quote 2011-07-11 13:08:07, AchimB Hello, how can I avoid a Loop during call diversion? For example: A user x is diverting his phone to user y, now I want to prevent that user y is able to divert to user x. Thanks in advance Achim Quote 2011-07-11 13:24:19, Tom Wellige You can't prevent user y to configure such a loop. But you can stop the execution of the loop (if you don't want the server to do it for you by disconnecting the call). To do so, just place a small rule in front of all other rules of a user: check if he has PBXUser.UnconditionalRedirect enabled if so, check if you find the PBXUser.UnconditionalRedirectNumber within the PBXScript.PreviousScripts collection if so, just take a Connect To block and connect the call to the original destination and leave the rule through the Rule executed exit if not, leave the rule trough the Rule skipped exit Only problem with this approach is, that within the PBXScript.PreviousScripts collection there aren't any user numbers but just user names available, so use the function GetUserNameFromExtension to resolve the user name from PBXUser.UnconditionalRedirectNumber and compare it against the name from the PBXScript.PreviousScripts collection. Update 2019-09-03: on restoring this topic from the archive I just wrote a such a function: IsRedirectionLoopConfigured Another and most likely more robust attempt would be to check if the current script user is already in the PBXScript.PreviousScripts collection by using the function IsRedirectedFromByName and if so simply connect the call using the Connect To block. Update 2019-09-03: on restoring this topic from the archive I just wrote a such a function: IsLoopConfigured Use this kind of script for every user where you don't want to allow loops which would be detected by the server and disconnected. To get it for every user you can use the script as PreProcessing script. See the SwyxWare admin manual for details on this. Regards, Tom. Quote 2011-07-11 14:03:45, AchimB Thanks Tom, I'll try and return the results Best Regards Achim Quote 2011-07-11 23:16:04, Tom Wellige Just a word on why it is possible anyway to configure loops within SwyxWare: Redirections / Forwardings can not only be set in the SwyxIt! configuration but also within the call routing, the rule wizard or the graphical script editor. Especially the GSE provides such a flexibility that it is simply impossible to prevent a user (or two user independently from each other) to configure loops. So what happens if there is a redirection loop configured? Well, SwyxServer identifies he loop after a short moment and stops it by disconnecting the call and writing an event log entry. If the administrator uses for example the provided event log monitor he will get notified immediately and will be able to take action (like removing the loop). In my previous post I have suggested what to do, i.e. how to build a small script, to prevent loops before the server detects them and disconnects the call. If I find time, I will make a complete and ready to use function out of it (if wanted). Tom. Quote 2011-07-12 08:36:48, markus.wallner Hi Tom, such a function would be great. I think it would be the best to redirect such calls to a specific number where the calls can be handled (like the number for undeliverable calls in the location settings) -Markus Quote 2011-07-12 14:50:28, AchimB Thanks Tom, I'm trying to implement your suggestion, but till now, without luck. Yeah, I'll appreciate if you take care of it, since there is a demand for it. Best regards Achim
Recommended Posts
Archived
This topic is now archived and is closed to further replies.