Restricting Forwarding List

Are there any options for the ARI interface for restricting the forward list? In other words, I want to allow users to forward but I don’t wan the drop down list to show.

Thanks.

Mike

Currently what you have seen is what you get. It is always possible to customize the the interface for what you need, but out of the box the answer is no.

There is a way to restrict number the phones/extensions in the drop down list by creating contexts and placing those phones/extensions in that specific context. That might work for you but there is one known catch: if you have people who attempt to get voicemail by dialing the default *98 from any phone, then they will have issues as the *98 only looks in the default context. If they only check voicemail from their extensions by dialing *97 (or calling there extension and pressing * durring the voicemail message) then it’s not a problem. With a group of phones/extensions configured in a given context it will restrict that drop down list to only those in that context and not the whole list.

Hope that helps some.

I wish I could find a way of doing this. Our users want web access to their voice mail but I don’t want to open the main web site to the public.

I’ve got it working as a VirtualHost right now, it seems to work fine but I need to get rid of the drop down list. Perhaps I can simply edit that out of the php design to keep things simple?

Mike

That is always possible. But you’ve not explained exactly what you are trying to accomplish here…
Why don’t you want the drop down list?
Is it that you don’t want them to be able to setup a forward? If so removing it would be the best option. The reason for the drop down list is so that they pick a valid extension and don’t enter a random number which would then generate a result of dialing a unknown extension making the one that was actually called look like it is gone now…

It’s actually because we have two groups of people on the system which don’t really have anything to do with each other. We would prefer if they don’t see each other.

I would like to leave the forward option on but remove the pick list. I’ve been looking at the php pages but it’s not yet clear what I would need to change.

you might find it easier to create seperate voicemail context’s for each group of people so only members of one group can see those members and not the others.

i.e. group one is context company_a, and the other is company_b, and don’t use the default context for voicemail. (This is not the same or relaited to a trunk, extension or user context). Basically it’s a way to organize each group of peoples voicemails so they only see those they need to.

It’s also very easy to change. Edit a particular group and only change the mailbox defination from xxx@default to xxx@company_a then they will only see them selves and the remainder default group will also only see themselves. (if that is more along the lines of what you want then change the other default’s to a second group so that they are all using the same setup, and organization, and if in the future you forget to change it they will show up in the default group all alone and you’ll know easly.

Right now, on every extension, we have from-internal in the data field. Do you mean we could change this to, for example, from-internal-1 and from-internal-2 and hide group1 from group2?

Mike

Edit a extension, look for the mailbox field (it’s the last field in the device options section directly under accountcode) by default for extension 100 it would be 100@default change the word default (that is the voicemail context) to something else group1, etc. (Best to NOT use a name of a extisting context and get it confused).

I’ve done as suggested, restarted everything even after updating and still, they all show up? Is there something else I am supposed to edit or restart?

Mike, ok Sorry I brain farted again… reset the mailbox to it’s previous value. it’s the vmcontext that needs to be set. That’s the box 2nd from the bottom.

next you need to edit a file /var/www/html/admin/modules/framework/htdocs/recordings/modules/voicemail.module and add one line.

it depends on which editor you use but it’s line 280 or 281.

This is before

foreach ($lines as $key => $line) {

    // get context for forward to mailbox
    if (preg_match("/\[.*\]/i",$line)) {
      $forwardContext = trim(preg_replace('/\[|\]/', '', $line));
    }

    // get username and add to options
    if (preg_match("/\=\>/i",$line)) {
      list($username,$value) = split('=>',$line);
      $username = trim($username);
      if ($username!=$_SESSION['ari_user']['extension']) {
        //$ext_array[] = $username . "|" . $forwardContext;
        list(,$real_name,) = split(",",$value,3);
        $ext_array[] = $real_name . "|" . $username . "|" . $forwardContext;
      }
    }
  } //foreach
This is after foreach ($lines as $key => $line) {
    // get context for forward to mailbox
    if (preg_match("/\[.*\]/i",$line)) {
      $forwardContext = trim(preg_replace('/\[|\]/', '', $line));
    }
    if ($forwardContext!=$_SESSION['ari_user']['context']) { continue; }

    // get username and add to options
    if (preg_match("/\=\>/i",$line)) {
      list($username,$value) = split('=>',$line);
      $username = trim($username);
      if ($username!=$_SESSION['ari_user']['extension']) {
        //$ext_array[] = $username . "|" . $forwardContext;
        list(,$real_name,) = split(",",$value,3);
        $ext_array[] = $real_name . "|" . $username . "|" . $forwardContext;
      }
    }
  } //foreach

Notice the addition of the 6th line down. I thought it was entered into the bug track and had a patch file and just spend a hour looking for it. Only to find that it never made it into the bug track. The posting about this is located here: http://www.freepbx.org/forum/changes-to-the-forward-to-button-in-ari

We wanted it at the office so I applied it and know it works nicely. I’ll submit it into the bug track with some reasoning behind it and some additional logic I think so it can be enabled or disabled…

I’ve added the line. Do I need to restart anything to give this a try?

nope it should just work as that line of php is called when needed.

Could this affect users calling in for voice mail? I’m working on NAT related issues at the same time and users have been complaining about not being able to reach vm.

yes

Sorry I thought I was responding to your Nat thread issue… This change for forward has nothing at all to do with the voicemail system, just the ARI web interface…

I thought I would ask. because I’m going through hell here today. I have another thread going and I posted how we’ve had NAT set up. I must have changed something small and can’t recall what it is because we’re being inundated with problems today. One way audio, calls that seem to be fine once established, assuming there isn’t a one way audio problem, voice mail that sometimes replies asking for security code and other times doesn’t reply at all.

I’ll have to get back to this thread once I fix the other problems with the poor folks using the phones are just going crazy.

Mike

Turns out it was the ALG setup on the juniper firewall. Turning it off, creating my own policy and service got the traffic flowing instantly.

Mike

I’m back at this finally, have the other problems resolved.

I changed the line as you noted, however, I am now getting;

Fatal error: Cannot redeclare class Voicemail in /var/www/vhosts/vm/html/modules/voicemail.module on line 11

I should note that I am trying to run the /recordings directory as a VirtualHost. It’s working just fine other than this drop down list item I’d like to address. I have edited the main config file so that it knows the path back to the main site though.

With the edited file in place, I got the following error;

Fatal error: Cannot redeclare class Voicemail in /var/www/html/recordings/modules/voicemail.module on line 11

The error goes away the moment I remove the URL from /etc/asterisk/voicemail.conf and put it back to AMPWEBADDRESS. I read countless messages on where to edit that to get a real URL vs AMPWEBADDRESS but many didn’t say the same things. Which is it, guess I still don’t have it yet.


UPDATE: Fixed. Need to edit /etc/asterisk/vm_email.inc and replace AMPWEBADDRESS. I had edited /etc/asterisk/voicemail.conf based on another message thread I found.

UPDATE #2: Nope, still not working. I’ll update this with the fix when I finally figure it out.

Mike

Ok, I’ve got back to this now and I seem to have it working, at least partially.
So for example, I created group1 and group2. I edited VM Vontext and added group1 for all group1 users. I then did the same for users in group2.

Now, from what I understand, group1 users should see only group1 users to forward to and group2 users should only see group2, correct?

That seems to be working.

Mike