Asterisk callmanager integration voicemail

I found this guide how to do voicemail cm integration,
Some parts are missing, like images, and scripts

voip-info.org/wiki/view/Aste … t_id=11759

does anyone has it?

thx

calls are being forwarded to asterisk voicemail , but
rdnis is not forwarded from call manager,

any ideas why?

I was able to make voice mail running.
I change some extentions on asterisk so rdnis started to work.
But I am still missing the scripts to notify users.

Anyone has that?

Thanks in advance

I found this:

[root@asterisk1 asterisk]# cat vmnotify.pl
#!/usr/bin/perl

my $DEBUG = 0;
open(OUT, “>>/tmp/asterisk.log”);
###############################################################################

Configuration Variables

###############################################################################

If you have a remote PBX ( hanging off of your non asterisk pbx;

ie. asterisk -> definity -> nortel)

… remoteExtensions would be the mode code for the nortel

remoteExtensions is the list of extensions hanging of the “nortel”

my $remoteExtensions = “1280|1203”;
my $remoteMWIOn = “#53”;
my $remoteMWIOff = “#*53”;

Mode codes for the definity

my $mwiOn = “*1”;
my $mwiOff = “#1”;

my $vmNumber = “706-867-5309”;
###############################################################################

my $callFile = “Channel: Zap/25/CALLTHISNUMBER
MaxRetries: 15
RetryTime: 60
WaitTime: 10
Context: vmnotify
Extension: s
Callerid: VM Notification <$vmNumber>
Priority: 2”;

my $notifyFileP = “Channel: Zap/g1/9CALLTHISNUMBER,EXTENSION#
MaxRetries: 0
RetryTime: 300
WaitTime:30
Context: default
Extension: s
Callerid: VM Notification <$vmNumber>
Priority: 2”;

my $notifyFileM = “Channel: Zap/g1/9CALLTHISNUMBER
MaxRetries: 0
RetryTime: 300
WaitTime:30
Context: default
Application: VoicemailMain
Data: sEXTENSION
Callerid: VM Notification <$vmNumber>
Priority: 2”;

my $currentMessageDir = “/var/spool/asterisk/mwi/”;
my $currentNotifyDir = “/var/spool/asterisk/notify/”;
my $rand = $$;
my $callFileTEMP = “/var/tmp/asterisk.callfile.” . $rand;
$rand2 = $rand + 1;
my $callFileTEMP2 = “/var/tmp/asterisk.callfile.” . $rand2;

my $date = date;
print OUT $date;

if ($DEBUG > 0) {
print OUT “$callFileTEMP = $callFileTEMP\n”;
print OUT “$callFileTEMP2 = $callFileTEMP2\n”;
for my $arg (@ARGV) {
print OUT “\t$arg\n”;
}
}

shift;
my $mailboxTEMP = shift;
my $messages = shift;
chomp $mailbox;
chomp $messages;

my ($mailbox,$context) = split(/@/, $mailboxTEMP);

if ( $mailbox =~ /$remoteExtensions/ ){
$mwiOn = $remoteMWIOn;
$mwiOff = $remoteMWIOff;
}

$CMDPath = $currentMessageDir . $context . “/” . $mailbox;
my $currentMessages = 0;
if ( -e $CMDPath ) {
open(CURRENT, “<$CMDPath”);
$currentMessages = ;
close CURRENT;
chomp $currentMessages;
print OUT “currentMessages = “$currentMessages”\n” if $DEBUG > 0;
} else {
$currentMessages = 0;
}

create the call file

open(CF, “>$callFileTEMP”);

if ( $messages > $currentMessages ) { # they have messages
$callFile =~ s/CALLTHISNUMBER/$mwiOn$mailbox/;

    # print "Turning ON MWI for $mailbox\@$context\n" if $DEBUG > 0;
    print OUT "Turning ON MWI for $mailbox\@$context\n";
    print OUT $callFile if $DEBUG > 0;

    open(CF2, ">$callFileTEMP2");
    my $notifyNumber = getNotifyNumber($mailbox);
    my $notifyMethod = $notifyNumber;
    $notifyMethod = substr($notifyNumber,0,1);
    $notifyNumber = substr($notifyNumber,1,10);
    my $notifyFile = "";
    my $qFile = "/var/spool/asterisk/outgoing/asterisk." . $rand2;
    print OUT "\$qfile = $qFile\n" if $DEBUG > 0;
    if ($notifyMethod eq 'm') {
            $notifyFile = $notifyFileM;
    } elsif ( $notifyMethod eq 'p' ) {
            $notifyFile = $notifyFileP;
    }
    if ( $notifyNumber != 0 ) {
            $notifyFile =~ s/CALLTHISNUMBER/$notifyNumber/;
            if ($notifyMethod eq 'p' ) {
                    $notifyFile =~ s/EXTENSION/$mailbox/;
            } else {
                    $notifyFile =~ s/EXTENSION/$mailbox\@$context/;
            }
            print CF2 $notifyFile;
            if ($DEBUG > 0 ) {
                    print OUT "---\n";
                    print OUT $notifyFile;
                    print OUT "---\n";
            }
            close CF2;
            rename($callFileTEMP2, $qFile) or print(OUT "ERROR: Can't rename callfile($callFileTEMP2): $!\n");
    }

} else {
$callFile =~ s/CALLTHISNUMBER/$mwiOff$mailbox/;

    #print "Turning OFF MWI for $mailbox\@$context\n" if $DEBUG > 0;
    print OUT "Turning OFF MWI for $mailbox\@$context\n";
    print OUT $callFile if $DEBUG > 0;

}
print CF $callFile;
close CF;

put it in the outgoing queue

rename($callFileTEMP, “/var/spool/asterisk/outgoing/asterisk.$$”) or print(OUT “ERROR: Can’t rename callfile($callFileTEMP): $!\n”);

update the new message count

open(UPDATECMD, “>$CMDPath”);
print UPDATECMD $messages;
close UPDATECMD;
print OUT "-"x80 . “\n”;
close OUT;

sub getNotifyNumber {
my $NotifyPath = $currentNotifyDir . $context . “/” . $mailbox;
if ( -e $NotifyPath ) {
open(CURRENT, “<$NotifyPath”);
$notifyNumber = ;
close CURRENT;
chomp $notifyNumber;
print OUT “notifyNumber = “$notifyNumber”\n” if $DEBUG > 0;
return $notifyNumber;
} else {
return 0;
}
}

how do I modify above script to use:

my extensions for notifications:
exten => _230XXXX,1,SetCallerID(${EXTEN:3})
exten => _230XXXX,2,Dial(SIP/28888@callman01)
exten => _230XXXX,3,Answer
exten => _230XXXX,4,Wait,1
exten => _230XXXX,5,Hangup

exten => _231XXXX,1,SetCallerID(${EXTEN:3})
exten => _231XXXX,2,Dial(SIP/28889@callman01)
exten => _231XXXX,3,Answer
exten => _231XXXX,4,Wait,1
exten => _231XXXX,5,Hangup

thx

Hello,

Hopw do you route call from CCM to Asterisk Voicemial?

Regards