Some suggestions for round 2 of Swiss Army Knife
Well, since no one has proposed any additional features, I'll throw our a few suggestions. These are just ideas, no idea if I'm asking for something easy or something that would require monumental effort, so feel free to ignore the latter:
- Blacklisting by Caller ID NAME - wouldn't you love to be able to block calls from those annoying bank telemarketers that seem to have 100's of numbers at their disposal, but always use the same Caller ID name? Probably wouldn't hurt to allow RegEX patterns here.
- New trunk type with Destination Picker. The idea is this: Sometimes if people dial numbers with a particular pattern, you want to reroute them to an internal destination such as a system recording. There are probably a thousand reason you might need to do this and each one is unique. Basically a variation on a "Custom" trunk, to be used for outgoing calls only, that simply includes a destination picker similar to what you'd find on an IVR or Misc Application page. Calls that hit that trunk would be re-routed to that destination, whatever it might be.
- An option to automatically disable all SIP trunks (or at least certain specified ones) if Internet connectivity is lost, and re-enable those trunks when Internet connectivity is restored, so that local extension-to-extension calls continue to work when the Internet is down (unless this is no longer an issue in Asterisk 1.8).
- An option to not require a PIN when dialing *97 to retrieve voicemail for the same extension.
That's probably enough for now. Any of these easily doable?
EDIT: With regard to the option to not require a PIN when dialing *97 to retrieve voicemail for the same extension, this would be most useful on "home" type systems, or basically any system where there's no chance an employee might pick up another employee's phone and try to listen to their voicemail (for example, if all employees worked from home, and there was no centralized "office"). This could be on a per-extension or system-wide basis, although I'm sure per-extension would be more difficult to implement. I have for years used code in extensions_custom.conf to implement this on a system-wide basis, like this:
[custom-voicemail-retrieve]
exten => s,1,Noop(Voicemail for calling extension)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Macro(get-vmcontext,${CALLERID(num)})
exten => s,n,VoiceMailMain(${CALLERID(num)}@${VMCONTEXT},s)
exten => s,n,Goto(app-blackhole,hangup,1)
exten => h,1,Macro(hangupcall,)
I then create a Custom Destination (custom-voicemail-retrieve,s,1) and then set that up as my *97 destination using a Misc. Application (of course I have to disable the original *97 in Feature Codes). The problem with this code is that although is still (somewhat amazingly) works in my situation, it was something I obtained back in the Asterisk@Home days (not sure if I had to modify it at all since then) and I'm sure it doesn't "track" all the additions to the voicemail code since then. Compare to the current *97 code in FreePBX 2.9:
include => app-vmmain-custom
exten => *97,1,Answer
exten => *97,n,Wait(1)
exten => *97,n,Macro(user-callerid,)
exten => *97,n,Macro(get-vmcontext,${AMPUSER})
exten => *97,n(check),Set(VMBOXEXISTSSTATUS=${IF(${MAILBOX_EXISTS(${AMPUSER}@${VMCONTEXT})}?SUCCESS:FAILED)})
exten => *97,n,GotoIf($["${VMBOXEXISTSSTATUS}" = "SUCCESS"]?mbexist)
exten => *97,n,VoiceMailMain()
exten => *97,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?playret)
exten => *97,n,Macro(hangupcall,)
exten => *97,check+101(mbexist),VoiceMailMain(${AMPUSER}@${VMCONTEXT})
exten => *97,n,GotoIf($["${IVR_RETVM}" = "RETURN" & "${IVR_CONTEXT}" != ""]?playret)
exten => *97,n,Macro(hangupcall,)
exten => *97,n(playret),Playback(beep&you-will-be-transfered-menu&silence/1)
exten => *97,n,Goto(${IVR_CONTEXT},return,1)
As you can see there are significant differences, which makes me wonder how the old custom code still works at all (I confess I didn't write it, but I do recall that at the time I got it it was only slightly changed from the original *97 code, possibly just the addition of the ,s option to the call to VoiceMailMain). Anyway, I found that the only thing needed to eliminate the password requirement in the new (2.9) code is the addition of the ,s option to the call to VoiceMailMain. This only affects *97 voicemail pickup for the same extension you are calling from, not *98 (pick up voicemail for any extension, with PIN required).
It occurs to me that if extensions had a flag in the Asterisk database to specify no PIN required for same extension voicemail pickup, for example /AMPUSER/
extnumber/novmpw, then when *97 was called you could check to see if that flag were set for the calling extension and if so, skip the password entry requirement (add the ,s option to the call to VoiceMailMain). For example, it seems to me (without actually testing this code) that you could change this line:
Code:
exten => *97,check+101(mbexist),VoiceMailMain(${AMPUSER}@${VMCONTEXT})
to
Code:
exten => *97,check+101(mbexist),ExecIf($["${DB(AMPUSER/${AMPUSER}/novmpw)}"!=""]?Set(VMOPT=",s"))
exten => *97,n,VoiceMailMain(${AMPUSER}@${VMCONTEXT}${VMOPT})
I'm assuming that if $(VMOPT} was not set in the first line, it would evaluate to "nothing". but if that's an incorrect assumption then an additional line might be needed to initialize it to "".
Then to set (or unset) the variable in the database, you could then add a setting on the extension pages, under the Voicemail & Directory section and under the existing Voicemail Password line, like this:
Code:
Voicemail Password [Existing Text Field]
Require From Same Extension º yes º no
If set to "no" then the database flag would be set and vise versa.
Or if there are no "hooks" to allow that, then just have a separate section on the SAK page listing all extensions that currently have voicemail enabled, and allow the option to be set/unset there.
Again, I'm NOT suggesting that anyone use this on a business system, but for a home system it gets irritating to have to enter a PIN every time you get voicemail. I also submitted this one as a FreePBX feature request, for whatever that's worth:
freepbx.org/trac/ticket/5326