GOOD NEWS FreePBX Swiss Army Knife Module

Joined
Jun 29, 2009
Messages
258
Reaction score
0
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
 

tm1000

Schmoozecom INC/FreePBX
Joined
Dec 1, 2009
Messages
1,360
Reaction score
78
I realized this thread is old (three years at this point) and perhaps many of the people have moved on or do not care anymore but I think it's important for me to get the news out there. When I made the decision to stop working on Swiss Army Knife about two years ago I made a promise that I would push to get the features from Swiss Army Knife, and this thread, into FreePBX. That's why I am posting here today.

I wanted to let everyone attached know that in FreePBX 12 we have added an advanced setting to turn back on the old dial plan text box from 2.7 and lower. It's been almost three years but I made a promise and the promise has been fulfilled in 12. I feel that giving users the best of both worlds will help foster further growth within FreePBX. Along with the CSV import/export options that were added in 2.9 we have also added the ability to login to an extension's voicemail without having to type the password. If the setting "Require from same Extension" is set to no a user can simply dial *97 and will be instantly in their mailbox (configurable per extension). Moving forward I hope to get the last bit of remaining features from Swiss Army Knife into FreePBX (mainly the blacklist reg-expressions lists).

I feel it's important to get the word out about this because of the controversy surrounding the dial patterns gui and the creation of this module and my eventual dropping support for it.

The changes listed above have a great deal to do with this thread and how the module was entertained and fostered (supported/hacked/forked) by the community. I am happy that most of the features have made it back into FreePBX and I am happy to say it's because of community members like all of you in this thread and outside of it that helped to make this a reality. Soon I hope to be able to say that all of the proposed features from the community in this thread and those in Swiss Army Knife are in FreePBX. I can see the light at the end of the tunnel....

Thank you again
 

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
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