-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]: FreePBX 17 FollowMe - GOSUB_RETVAL empty from [macro-blkvm-setifempty] #582
Comments
Log output attached |
This line: Is executed before the Follow-Me list is dialled so that no extensions go to voicemail while dialling the list. Once the list is dialled or in this case, the list comes back with nothing to dial due to various status (or an empty list) then the following dialplan is executed:
This clears the voicemail block that was set so the extension that was dialled originally can execute dialplan due to the Dial() returning with nothing answered. It then executes this dialplan to send the call back into the extensions normal routing (going to voicemail if enabled, etc).
It's from there because the IVR is set to return after voicemail (or in cases no voicemail is set, just return) the call is returned to the IVR
It sounds like the IVR isn't configured the same on FreePBX v17 as it was on the FreePBX v15 systems you say this works on. I'd compare the IVR settings and make sure the IVR options don't have the return to IVR option set to Yes. It would also be helpful to see output from the v15 system this is working on so we can compare what is happening. |
I can try to send the output from v15.. but why it's working fine when we change the var from GOSUB_RETVAL to GOSUB_RETVAL1 is a big question for me? Return on voicemail on the IVR is set to No. |
We will need to see what 15 is doing because in v15 here's what an extension's dialplan looks like when no voicemail is set on the extension.
Here's what it looks like in v17:
They are virtually the same. This is your issue Again, we'll need to see something from v15 that is working as you say. Because they both would end up hitting the same exact dialplan which begs the question, why does it work differently between the systems? |
Further investigation brings us to the below. So the built-in variable GOSUB_RETVAL is being reset with Return(). @kguptasangoma the macro-blkvm-setifempty (extensions_additional.conf) from the core module should be adjusted by replacing the Return() with Return(${GOSUB_RETVAL}). Pull request: FreePBX/core#140 |
None of this has to do with the voicemail block or clearing. The extension doesn't have voicemail enabled on it so it doesn't matter if voicemail is blocked or not. The issue you are having is the line I highlighted in my previous comment, I will provide it again:
To reiterate, the voicemail Gosub's or Macro's have no bearing on the call being returned to the IVR. |
So why [macro-blkvm-check] has a different Return than the others? :) The code is expecting GOSUB_RETVAL to be returned from macro-blkvm-setifempty but it does not because it's being reset (or even not set in the return) by Return(). |
You are not understanding the logic of the dialplan. The voicemail gosubs are there to block/clear/reset the calls ability to leave voicemail for the extension. The extension in question does not have voicemail enabled so when followme finishes and sends to the post destination of Again, you need to provide the requested verbose call log from the v15 system that you claim works right. |
As you wish :D
GOSUB_RETVAL is set from blkvm-setifempty and returned by MacroExit():
GotoIf is 1:
as from: In the v17 we got false for the same condition:
If we put Noop of var ${GOSUB_RETVAL} just before: we will see it's empty. So that means it's not being set/returned by Return() function. |
btw I'm not 100% sure why the call is returning to the IVR but I'm pretty sure if we set ${GOSUB_RETVAL} to TRUE from macro-blkvm-setifempty and then we check the same variable in followme-sub if it's TRUE it should work but it cannot work because Return() resets/does not return this variable and this should be Return(${GOSUB_RETVAL}) instead, as it's done for example in macro-blkvm-check. |
I believe I have found the problem and it is a configuration issue. v15: v17: The issue is the ring strategy because ringallv2 will ring the extension then continue to ring the extension with the follow-me list. However, with ringallv2-prim it will attempt to ring the extension and if the extension returns BUSY (inuse or DND) it will not continue to the follow-me list. Which is exactly what is happening on the v17 system. Update your ring strategy in Follow-Me to ringallv2 instead of ringallv2-prim and that should allow the external number to be tried instead of ending the call as it is now and returning back to the IVR. |
I made a short test without the -prim and it indeed does something else. ringallv2-prim seems to not ring the Busy extension's fm list yes, but it returns the call to the IVR, is this not strange? This should be routed to the final destination at least anyway, my conclusion about macro-blkvm-setifempty remains the same, it the variable ${GOSUB_RETVAL} is being set there to TRUE and is being accessed from somewhere else (followme-sub in this case) it's should exist but without Return(${GOSUB_RETVAL}) it's empty... |
This has nothing to do with the macro-blkvm-setifempty Gosub. It's already being set as a variable and doesn't need to be in the Return().
It is not strange, I've explained it a few times. The call was ringing extension 2222, it returned BUSY and wasn't using follow-me list, so it issued a Goto(ext-local,2222,dest) which would execute the following:
${IVR_CONTEXT} is set to ivr-31 due to this executing earlier in the dialplan: Everything that is happening is happening as it should. The issue was with your ring strategy in follow-me which was not allowing the follow-me list to execute because the extension is in a BUSY status. That's it. |
As I already told:
If I follow you, why the call is returning to the IVR if Return to IVR after VM is set to No? |
additionally the main questions are
Here is also the output from V15 with the same followme settings as on v17 (ringallv2-prim). The call is not looping to the IVR, it ends instead in the final destination of the queue (= terminate call: busy). |
Can I see output from v17 that isn't from modified dialplan? |
It's on my second message (: |
OK so I've done so testing with things and I was incorrect, the voicemail check is a factor for the returning to the queue...and the issue you have found isn't just for the voicemail gosub's but any old Macro that was setting GOSUB_RETVAL as a way to work with other GoSub calls. Each GoSub that needs to return a value needs to have it set in the Return() as you have pointed out. Otherwise it sets to the an empty value. So this isn't just a follow-me issue, it's an issue with quite a few things using these checks and GOSUB_RETVAL being returned as empty all the time. Sorry about that but there were some config differences....you use call confirm on v15 which also handles the call differently. But in the v17 because the GOSUB_RETVAL was empty, it didn't set the needed settings to make the call return to the queue and no follow the extensions normal routing. |
Yes indeed. Not sure if there are more.. |
so for these I made a pull request :) |
See my review. It needs a fix applied. |
Thanks! |
framework version 17.0.19.22 |
FreePBX Version
FreePBX 17
Issue Description
When FollowMe is enabled on extension and the extension is an agent in a queue + set on DND/Busy + the queue is linked to an IVR, when calling to this extension from queue the call returns to the IVR makes it a loop.
Setup:
Inbound route > IVR > Queue
We see the call is coming to [followme-sub] and the below Gosub goes to [macro-blkvm-setifempty]:
exten => _X!,n,Gosub(macro-blkvm-setifempty,s,1())
When it returns back to [followme-sub] the variable GOSUB_RETVAL is empty so the below check on [followme-sub] fails resulting the call is looping:
exten => _X!,n,GotoIf($["${GOSUB_RETVAL}" = "TRUE"]?skipov)
If we change the GOSUB_RETVAL variable to something custom like GOSUB_RETVAL1 then it works fine.
Same setup has been tested on FreePBX 15 with no issue.
Operating Environment
FreePBX 17 + Asterisk 20.10/Asterisk 18.25
+-------------------+------------+-----------------------------------+------------+-----------+
| Module | Version | Status | License | Signature |
+-------------------+------------+-----------------------------------+------------+-----------+
| announcement | 17.0.2.1 | Enabled | GPLv3+ | Sangoma |
| arimanager | 17.0.1.1 | Enabled | GPLv3+ | Sangoma |
| asterisk-cli | 17.0.2 | Enabled | GPLv3+ | Sangoma |
| asteriskinfo | 17.0.2 | Enabled | GPLv3+ | Sangoma |
| backup | 17.0.5.61 | Enabled | GPLv3+ | Sangoma |
| builtin | | Enabled | | Unsigned |
| bulkhandler | 17.0.5 | Enabled | GPLv3+ | Sangoma |
| calendar | 17.0.4.20 | Enabled | GPLv3+ | Sangoma |
| callforward | 17.0.1.6 | Enabled | AGPLv3+ | Sangoma |
| callrecording | 17.0.3.8 | Enabled | AGPLv3+ | Sangoma |
| callwaiting | 17.0.3.4 | Enabled | GPLv3+ | Sangoma |
| cdr | 17.0.4.29 | Enabled | GPLv3+ | Sangoma |
| cel | 17.0.2.10 | Enabled | GPLv3+ | Sangoma |
| certman | 17.0.3.13 | Enabled | AGPLv3+ | Sangoma |
| conferences | 17.0.3.2 | Enabled | GPLv3+ | Sangoma |
| configedit | 17.0.1.4 | Enabled | AGPLv3+ | Sangoma |
| contactmanager | 17.0.5.12 | Enabled | GPLv3+ | Sangoma |
| core | 17.0.18.7 | Enabled | GPLv3+ | Sangoma |
| customappsreg | 17.0.1 | Enabled | GPLv3+ | Sangoma |
| customcontexts | 17.0.1.3 | Enabled | GPLv2+ | Sangoma |
| dashboard | 17.0.4.6 | Enabled | AGPLv3+ | Sangoma |
| daynight | 17.0.1.1 | Enabled | GPLv3+ | Sangoma |
| donotdisturb | 17.0.2.3 | Enabled | GPLv3+ | Sangoma |
| dynroute | 17.0.3.2 | Enabled | GPLv3+ | Sangoma |
| extensionsettings | 17.0.1 | Enabled | GPLv3+ | Sangoma |
| fax | 17.0.3.4 | Enabled | GPLv3+ | Sangoma |
| featurecodeadmin | 17.0.2 | Enabled | GPLv3+ | Sangoma |
| filestore | 17.0.2.31 | Enabled | AGPLv3 | Sangoma |
| findmefollow | 17.0.4.10 | Enabled | GPLv3+ | Sangoma |
| firewall | 17.0.1.29 | Enabled | AGPLv3+ | Sangoma |
| framework | 17.0.19.17 | Enabled | GPLv2+ | Sangoma |
| infoservices | 17.0.1.1 | Enabled | GPLv2+ | Sangoma |
| ivr | 17.0.8 | Enabled | GPLv3+ | Sangoma |
| languages | 17.0.1 | Enabled | GPLv3+ | Sangoma |
| logfiles | 17.0.3.3 | Enabled | GPLv3+ | Sangoma |
| manager | 17.0.6 | Enabled | GPLv2+ | Sangoma |
| miscapps | 17.0.3 | Enabled | GPLv3+ | Sangoma |
| miscdests | 17.0.1.1 | Enabled | GPLv3+ | Sangoma |
| music | 17.0.5 | Enabled | GPLv3+ | Sangoma |
| paging | 17.0.3 | Enabled | GPLv3+ | Sangoma |
| parking | | Not Installed (Locally available) | GPLv3+ | Sangoma |
| pm2 | 17.0.3.3 | Enabled | AGPLv3+ | Sangoma |
| presencestate | 17.0.2.4 | Enabled | GPLv3+ | Sangoma |
| printextensions | 17.0.1.2 | Enabled | GPLv3+ | Sangoma |
| queues | 17.0.1.13 | Enabled | GPLv2+ | Sangoma |
| recordings | 17.0.2.3 | Enabled | GPLv3+ | Sangoma |
| ringgroups | 17.0.2.6 | Enabled | GPLv3+ | Sangoma |
| setcid | 17.0.1.2 | Enabled | GPLv3+ | Sangoma |
| sipsettings | 17.0.6.9 | Enabled | AGPLv3+ | Sangoma |
| soundlang | 17.0.4.1 | Enabled | GPLv3+ | Sangoma |
| sysadmin | 17.0.2.4 | Enabled | Commercial | Sangoma |
| timeconditions | 17.0.1.18 | Enabled | GPLv3+ | Sangoma |
| userman | 17.0.6.29 | Enabled | AGPLv3+ | Sangoma |
| voicemail | 17.0.5.26 | Enabled | GPLv3+ | Sangoma |
| weakpasswords | 17.0.1 | Enabled | GPLv3+ | Sangoma |
+-------------------+------------+-----------------------------------+------------+-----------+
Relevant log output
No response
The text was updated successfully, but these errors were encountered: