QUESTION dial in to toggle FollowMe remotely?

theterran

New Member
Joined
Sep 9, 2008
Messages
7
Reaction score
0
Good day,

I am looking for a way to toggle FollowMe remotely by dialing in. We currently use a combination of IVR options and feature codes to toggle some things - for example, a "night mode" call flow control - and would like to give users the option of dialing in to toggle their FollowMe status. They want to be able to turn FollowMe on and off anytime they want to enable/disable calls ringing through to their mobile phones.

FollowMe can be enabled/disabled by dialing *21 from the user's phone, or via the Voicemail web interface (which seems to require Maint login before getting to the user login, and we don't open access to the outside world anyway). Neither of these is viable from outside the network.

Current setup is PBX in a Flash GREEN 2.0.6.4 under *XEN* on RentPBX, FreePBX version 2.11.0.38, running asterisk version 11.10.0. Everything is working fine, no issues with the phone system, just want to find a way to enable this dial-in FollowMe toggle.

So far I have Googled to the limits of my imagination, and also searched this forum and the FreePBX forum for ideas. Haven't found anything yet. If at all possible I would like to find a solution that can be done through the FreePBX web GUI, as not all maintainers are comfortable with editing config files. I know there are Misc Application and Misc Destination features, but haven't ever used them for anything; may not be applicable. If we do need to edit config files, it should be done in such a way that FreePBX changes and updates do not break or overwrite the customization (to the extent practically possible).

Thanks for any input or suggestions.

Regards,

Daniel Mann
 

theterran

New Member
Joined
Sep 9, 2008
Messages
7
Reaction score
0
I have custom code that can do this. It creates a prefix *22 that you can dial in front of a valid system extension to toggle the Follow Me. There is zero security, anyone can change any follow-me on any extension.

No worries; toggling FollowMe is not a security concern. =]

Save changes, reload config and test by dialing an extension with a *22 prefix. Note that if you wish to use a prefix other than *22, you can, but you must update

OK, all 3 steps done, and it works perfectly from inside: I dial *22 + extension from any phone on the system, and it toggles FollowMe for the target extension.

Now I'm trying to implement the final step, i.e. make this work from an IVR. To obfuscate I added a hidden (unannounced) destination to the main IVR. I also added a recording saying "Please dial your extension to toggle follow me", and gave it a 5s timeout. Now I'm not sure how to trigger the Misc Application, as you can't just dial *22NNN. Here's what I tried, using extension 301 as a test:
  • Create a Misc Destination named "Toggle FollowMe 301", with Dial value "*22301"
  • Set an IVR code (e.g. "123" for testing) that triggers Misc Destination > Toggle FollowMe 301
Unfortunately that didn't work... Any suggestions? I can pull log snippets if helpful, but don't know what to look for myself. You're pretty far beyond me here...

-Daniel
 

theterran

New Member
Joined
Sep 9, 2008
Messages
7
Reaction score
0
I just discovered another feature that can add an element of security to the feature code. If you want to limit the users of this feature code prefix to say a single extension, 103, you would define the Misc Applicaton as follows:
Code:
_*22./103
You can use wild cards as well. This Misc. Application will allow any 100 series extension to dial:
Code:
_*22./_1XX
I've been using FreePBX for years and never realized that Feature Codes could be defined with the /<ext>.

Neat. Do you know if there is a way to limit it to a list of extensions, using something like pseudo-regex syntax?
Code:
_*22./_[103|202|205|301]

Something like that, with whatever is the correct syntax. This is just icing, though, if the remote-dial-in toggle works. =]

-Daniel
 

theterran

New Member
Joined
Sep 9, 2008
Messages
7
Reaction score
0
I'm not much of an IVR user, I don't see a way of catching the digits input by the IVR caller and passing to the dialplan. If you don't have too many users, you could create a separate Custom Destination for each extension using the format:
Code:
fmfm-toggle-custom,101,1
where you substitute whatever extension you want in place of the 101.

I've tried this several times on different days, even after a good night's sleep, and I'm just not getting there. The suggestion is clear enough, and it works fine if I dial from an inside extension, even by dialing an option via an IVR. However, when calling in from outside, getting the same IVR, and dialing the same option, the FollowMe state for the desired extension is not toggled. It just hangs up on me.

For clarity I'll use my own extension, 102, which is registered by fixed devices 1021 and 1022 (don't let that part sidetrack you - it's not important here beyond the fact that you're seeing SIP/1021 in the output below; that's a phone on my desk, using my extension 102).

Here's the setup, picking up from where we left off above:

Custom Destination "Toggle FollowMe 102"
Code:
fmfm-toggle-custom,102,1

I configured an option in my NoAnswer IVR such that dialing 123 triggers Custom Destination > Toggle FollowMe 102, as defined above.

Here is the relevant code block for [app_fmf_toggle] in /etc/asterisk/extension_additional.conf (generated by FreePBX, not edited by me):
Code:
exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/followme/ddial)}" = "EXTENSION"]?activate)
exten => s,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/followme/ddial)}" = "DIRECT"]?deactivate:end)
exten => s,n(deactivate),Set(DB(AMPUSER/${AMPUSER}/followme/ddial)=EXTENSION)
exten => s,n,Set(STATE=NOT_INUSE)
exten => s,n,Gosub(app-fmf-toggle,sstate,1())
exten => s,n(hook_off),Playback(followme&de-activated)
exten => s,n(end),Macro(hangupcall,)
exten => s,n(activate),Set(DB(AMPUSER/${AMPUSER}/followme/ddial)=DIRECT)
exten => s,n,Set(STATE=INUSE)
exten => s,n,Gosub(app-fmf-toggle,sstate,1())
exten => s,n(hook_on),Playback(followme&activated)
exten => s,n,Macro(hangupcall,)

By dialing 7777 from my phone (SIP/1021) I get the NoAnswer IVR, then dial 123 for the Custom Destination "Toggle FollowMe 102". Capturing the CLI output, I see the following sequence:
Code:
    -- Executing [s@app-fmf-toggle:4]
    -- Executing [s@app-fmf-toggle:5]
    -- Goto (app-fmf-toggle,s,6)
    -- Executing [s@app-fmf-toggle:6] Set("SIP/1021-000000c6", "DB(AMPUSER/102/followme/ddial)=EXTENSION") in new stack
...etc.
When I dial in from outside, I get the same NoAnswer IVR, then dial the same 123 for the same Custom Destination "Toggle FollowMe 102". In this case, the CLI shows:
Code:
    -- Executing [s@app-fmf-toggle:4]
    -- Executing [s@app-fmf-toggle:5]
    -- Goto (app-fmf-toggle,s,10)
    -- Executing [s@app-fmf-toggle:10] Macro("SIP/vitel-ring-000000c7", "hangupcall,") in new stack
...etc.

Looking for the source of the problem, I compared the preceding CLI output. The only variance I see is in the macro-user-callerid section. Here is the CLI output from the call that originates from an internal extension:
Code:
    -- Goto (app-fmf-toggle,s,1)
    -- Executing [s@app-fmf-toggle:1] Answer("SIP/1021-000000c6", "") in new stack
    -- Executing [s@app-fmf-toggle:2] Wait("SIP/1021-000000c6", "1") in new stack
    -- Executing [s@app-fmf-toggle:3] Macro("SIP/1021-000000c6", "user-callerid,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/1021-000000c6", "TOUCH_MONITOR=1412385358.282") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/1021-000000c6", "AMPUSER=102") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("SIP/1021-000000c6", "11?report") in new stack
    -- Goto (macro-user-callerid,s,16)
...and here is the CLI output from the call that originates from an outside number:
Code:
    -- Goto (app-fmf-toggle,s,1)
    -- Executing [s@app-fmf-toggle:1] Answer("SIP/vitel-ring-000000c7", "") in new stack
    -- Executing [s@app-fmf-toggle:2] Wait("SIP/vitel-ring-000000c7", "1") in new stack
    -- Executing [s@app-fmf-toggle:3] Macro("SIP/vitel-ring-000000c7", "user-callerid,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/vitel-ring-000000c7", "TOUCH_MONITOR=1412385500.283") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/vitel-ring-000000c7", "AMPUSER=102") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("SIP/vitel-ring-000000c7", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("SIP/vitel-ring-000000c7", "1?Set(REALCALLERIDNUM=8885551212)") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/vitel-ring-000000c7", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/vitel-ring-000000c7", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/vitel-ring-000000c7", "AMPUSERCIDNAME=") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("SIP/vitel-ring-000000c7", "1?report") in new stack
    -- Goto (macro-user-callerid,s,16)

Somewhere in those extra lines, AMPUSER is reset to "" (blank) instead of "102". We're setting AMPUSER in fmfm-toggle-custom, but it looks like that value does not stick; therefore app-fmf-toggle does not know what extension to toggle.

I'm poking around in the dark here, but that's my best guess. Am I interpreting this correctly? Any ideas what to try next?

Thanks,

-Daniel
 

trupsalms

Member
Joined
May 13, 2011
Messages
337
Reaction score
6
Bump for this thread as I would like to be able to do the same dial via and disa, and toggle follow me on any given extension. Please help
 

Members online

No members online now.

Forum statistics

Threads
25,770
Messages
167,441
Members
19,181
Latest member
ejrubin
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top