[Asterisk-Users] VoiceMailMain skipping extension and password prompting

Florian Overkamp florian at obsimref.com
Thu Sep 25 14:34:26 MST 2003


Hi,

At 12:13 25-9-2003 -0400, you wrote:
>I would like to access VoiceMailMain2 skipping extension and password
>prompting if calling from a resource that has a mailbox defined. What
>variables can I use to retrieve the calling channel & calling extension (if
>it exists)?
>
>Here is what I'm trying to accomplish (of course ${CallingResourse.MailBox}
>is not a real way to retrieve this info)...
>
>exten => 7799,1,gotoif(${CallingResourse.MailBox}?7799|2:7799|4)
>exten => 7799,2,VoicemailMain2(s${CallingResourse.MailBox})
>exten => 7799,4,VoicemailMain2
>
>... currently extensions.conf is ...
>exten => 7799,1,VoicemailMain2
>
>... and from zapata.conf ...
>callerid="TCC hcaar" <321-222-2553>
>mailbox=7731
>channel=19
>
>Any suggestions?

Actually, I've experienced that its not always -just- that local extension 
that you want to give this kind of access to, so I've written some AGI code 
that helps. Here is a snippet that gives you the general idea...

=============
// parse agi headers into array $agi["callerid"]
while ($env=read()) {
   errlog($env);
   $s = split(": ",$env);
   $agi[str_replace("agi_","",$s[0])] = trim($s[1]);
   if (($env == "") || ($env == "\n")) {
     break;
   }
}

// Main run
$clid = $agi["callerid"];
switch($clid) {
   // enter the mailbox number for each valid callerid
   // prepend 's' if you wish to trust the callerid and skip the password check
   case "3001":  $parms = "s1"; break;
   case "06123456":    $parms = "s1"; break;
   default: $parms = "0"; break;
}
if($parms != "") $parms = " $parms";

echo "EXEC VoiceMailMain2$parms\n";
=============

I find this approach more flexible. Hope this gets you somewhere.

Best regards,
Florian





More information about the asterisk-users mailing list