I have users with multiple extensions (ie. office, home, etc.) and I wanted my users to have only one mail box for all of these extensions. Perhaps I didn't see it in the Asterisk docs and I have bastardized the sip.conf but I did the following. Constructive flames appreciated.
Tim In sip.conf the mailbox line shows the common mailbox number (ie "1015") with the optional context: [...] [1015] type=friend username=1015 callerid = Tim Pozar <1015> secret=HACKME host=dynamic nat=yes context=default canreinvite=no mailbox=1015 [1078] type=friend username=1078 secret=HACKME host=dynamic nat=yes context=default canreinvite=no [EMAIL PROTECTED] callerid=Tim Pozar HOME <1078> [...] In extesions.conf I run an AGI that goes out and gets the mailbox numberr and passes it to the Voicemail and VoicemailMain commands... [...] exten=_1XXX,1,dial(SIP/${EXTEN},20,tr) exten=_1XXX,2,Wait,1 exten=_1XXX,3,agi(parse_asterisk_sip_conf.agi|${EXTEN}|mailbox) exten=_1XXX,4,Voicemail(u${MAILBOX}) exten=_1XXX,5,Hangup exten => 8500,1,Answer exten => 8500,2,Wait,1 exten => 8500,3,agi(parse_asterisk_sip_conf.agi|${CALLERIDNUM}|mailbox) exten => 8500,4,VoicemailMain(${MAILBOX}) exten => 8500,5,Hangup [...] parse_asterisk_sip_conf.agi looks like this... --- #!/usr/bin/perl use strict; ##################################################### # Parses the sip config to pass back the mailbox number. # There should be more error checking in this script. # # Tim Pozar - Sat Jan 28 18:22:40 PST 2006 ##################################################### $|=1; my $asterisk_conf_dir = "/etc/asterisk"; my $sip_conf = "$asterisk_conf_dir/sip.conf"; my $value = "9999"; my $sip_extennum = $ARGV[0]; my $sip_variable = $ARGV[1]; my $variablename; my %AGI; while(<STDIN>) { chomp; last unless length($_); if (/^agi_(\w+)\:\s+(.*)$/) { $AGI{$1} = $2; } } open(CONF, "$sip_conf") || die "can't open $sip_conf"; while (<CONF>) { chop; if ((!/^;/) && (!/^#/)) { # Skip comments at the start of lines if (/^\[$sip_extennum\]/) { $_ = <CONF>; chop; while ((!/^\[/)){ if (/^$sip_variable/) { ($variablename, $value) = split('='); last; } $_ = <CONF>; chop; } } } } # Make sure you pass back something and not just a blank. Asterisk # doesn't like that. $variablename = uc($variablename); print "SET VARIABLE $variablename $value\n\n"; exit 0 --- -- 1978 45th Ave / San Francisco CA 94116 / USA // POTS: +1 415 665 3790 GPG Fingerprint: 4821 CFDA 06E7 49F3 BF05 3F02 11E3 390F 8338 5B04 Life is playful - Ben Olizar
begin:vcard fn:Tim Pozar n:Pozar;Tim org:UnitedLayer LLC adr:Suite 110;;200 Paul Avenue;San Francisco;CA;94124-3100;US email;internet:[EMAIL PROTECTED] title:COO tel;work:415-349-2112 tel;home:415-665-3790 tel;cell:415-637-8512 note:"Be who you are and say what you feel because the people who mind don't matter and the people who matter don't mind." - Dr. Seuss url:http://www.unitedlayer.com version:2.1 end:vcard
_______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users