Setting large number of extensions to "Require From Same Extension" = no

Hi all,

Just done a large deployment and now need to switch “Require From Same Extension” to “No” to avoid the password prompt from the phones when going to their voicemails on their own handsets.
(Yes they are aware of the risks of this)
I know it sets this in asterisk database using the novmpw = yes flag, but where in the MySQL database is this read from in FreePBX? What I’m wanting to do is write a quick MySQL query to update/add this into the database then run an apply so FreePBX updates asterisk accordingly.

Thanks in advance.
Andy

Prepared to be wrong, but I don’t believe this setting is stored in a MySQL table. You can manipulate the param directly at the Asterisk CLI with:

database put AMPUSER 2014/novmpw yes
database del AMPUSER 2014/novmpw
database get AMPUSER 2014/novmpw
3 Likes

Thanks! Yes that was my suspicion too as going through the PHP code I couldn’t see any MySQL queries/updates for that.

I’ve just done a quick script and pushed the extensions to asterisk cli using the database put you suggested and it’s working great.

Thank you for your help.

Regards,
Andy

3 Likes

Hi andy I am interested in doing the same thing as you here. Would you mind posting the script you put together or an example?

One easy way would be to open the console through an SSH session and paste the line

database put AMPUSER 2014/novmpw no

into your Asterisk CLI (replace 2014 with your extension number).
If you have a bunch of them to do, create a text file and set up the extension numbers one per line. Copy and paste the file at the prompt and away you go.

Note that the following may be more correct:

database del AMPUSER 2014/novmpw

I’ve never played with it, so I don’t know if the novmpw setting being deleted is the preferred method, or if setting it to “no” is the right way. It’s pretty simple to experiment with, so you could try both and let us know which worked better for you.

Thanks!
Unlike Andyb I was looking to change “Require From Same Extension” to yes. So same setting just the opposite value.
Initially I figured that I should change “novmpw” to “no” in the asterisk DB (database put AMPUSER 2014/novmpw no)… But after playing around I found the way to accomplish this is to remove the “novmpw” entry from the extension using (database del AMPUSER 2014/novmpw).
I put a shell script together with all the extensions I needed to change and ran that from linux. It looked like this:

#!/bin/bash
asterisk -rx "database del AMPUSER 8100/novmpw"
asterisk -rx "database del AMPUSER 8101/novmpw"
asterisk -rx "database del AMPUSER 8102/novmpw"
asterisk -rx “database del AMPUSER 8103/novmpw”

1 Like

To save typing, from bash:-

rasterisk -x " database query “delete from astdb where key like ‘/AMPUSER/%/novmpw’”"