Hey there List,

People have been very helpful in helping to point me in the right direction for vm handling using asterisk.. and  I’m making some progress.  I manage to have some of the calls handed off to asterisk, using a failure route.   This is the code snippet:

 

failure_route[4]  {

        # If we've got here, it means that a call timer has expired, and the user is in the

        # voicemail group. Therefore we're going to try and hand off the call to the Asterisk

        # voicemail system.

        revert_uri();

        rewritehostport("161.30.94.69:5060");

        log (1, "VOICEMAIL: Handing off to Asterisk\n");

        append_branch();

        t_relay;

}

 

 

However, I am seeing two problems which I’ve been bashing my head against a brick wall for a little bit ….  The first is that it only works if you dial the numerical alias, not if you dial the user name… do you know how I can make sure it’s the alias being passed to * and not the username?

 

Secondly, even though I have put the logic block for checking if a user is a vm user before checking if a user is online, I can’t seem to get to the mailbox for an offline user.. I just get a 404 not found….

 

<snip>

               # Make sure we check the aliases table

                lookup("aliases");

 

                # Enable diverted voicemail functionlity DB 26-07-2004

                # Does user have vm activated? (i.e., is in the voicemail (ser->grp) group?)

                if (!(method=="MESSAGE") && (is_user_in("Request-URI", "voicemail"))) {

                  log(1, "VOICEMAIL: vm user detected, activating failure route");

                  t_on_failure("4");

                  setflag(3);

                };

 

                # native SIP destinations are handled using our USRLOC DB

                if (!lookup("location")) {  # BEGIN if not in location database

               ……..

 

</snip>

 

If you have any ideas at all, I would be very very grateful.

 

Many thanks again for all the help…

 

Dave