Asterisk 配置基础

来源:互联网 发布:淘宝一件代发怎么上架 编辑:程序博客网 时间:2024/05/17 00:15
# base configuration  host is multi-cpu server / multi-cpu vmware image  install minimal setup Ubuntu 8.04.1 server   create user account phonesys uid=1000 gid=1000  apt-get install openssh-server # add packages needed for development and debugging  apt-get install build-essential  apt-get install libncurses5-dev  apt-get install gdb# download / install imap2004g (version DRUID/CentOS 5.2 tracks)  cd /usr/src  wget ftp://ftp.cac.washington.edu/imap/old/imap-2004g.tar.Z  tar -xzvf imap-2004g.tar.Z  cd imap-2004g  make slx SSLTYPE=none  make install# install / configure dovecot IMAP server for asterisk and postfix  apt-get install dovecot-imapd postfix   mkdir /var/mail/asterisk  mkdir /var/mail/asterisk/phonesys  chown phonesys:phonesys /var/mail/asterisk/phonesys    cd /etc/dovecot  mv dovecot.conf dovecot.conf.bak  edit /etc/dovecot/dovecot.conf  mail_location = maildir:/var/mail/asterisk/phonesys/%u  passdb passwd-file {     args = /etc/dovecot/dovecot.masterusers     master = yes  }    userdb static {     args = uid=1000 gid=1000  }  cd /etc/dovecot      edit /etc/dovecot/dovecot.masterusers  phonesys:{PLAIN}phonesys  /etc/init.d/dovecot restart# download / install asterisk 1.4.22 (version DRUID tracks)    cd /usr/src  wget http://downloads.digium.com/pub/asterisk/old-releases/asterisk-1.4.22.tar.gz  tar -xzvf asterisk-1.4.22.tar.gz   cd asterisk-1.4.22  ./configure --with-imap=/usr/src/imap2004g  make menuselect (enable IMAP_STORAGE under Voicemail Build Options)  make  make install  make samples# configure some SIP accounts to dial-in with  mv /etc/asterisk/sip.conf /etc/asterisk/sip.conf.bak  edit /etc/asterisk/sip.conf  [general]  context=recreate   allowoverlap=no  bindport=5060  bindaddr=0.0.0.0  srvlookup=yes  dtmfmode=rfc8233  checkmwi=10  [softphone](!)  type=friend  context=recreate  host=dynamic  secret=opensource  [user1](softphone)  mailbox=3001  [user2](softphone)  mailbox=3002  [user3](softphone)  mailbox=3003  [user4](softphone)  mailbox=3004  [user5](softphone)  mailbox=3005  [user6](softphone)  mailbox=3006  [user7](softphone)  mailbox=3007  [user8](softphone)  mailbox=3008  [user9](softphone)  mailbox=3009# configure some voicemail accounts  mv /etc/asterisk/voicemail.conf /etc/asterisk/voicemail.conf.bak  edit /etc/asterisk/voicemail.conf  [general]  format=wav  serveremail=asterisk  attach=yes  maxmsg=100  maxmessage=180  minmessage=3  maxgreet=60  skipms=3000  maxsilence=10  silencethreshold=128  maxlogins=3  sendvoicemail=yes  imapserver=localhost  imapflags=notls  authuser=phonesys  authpassword=phonesys  expungeonhangup=yes  [zonemessages]  eastern=America/New_York|'vm-received' Q 'digits/at' IMp  central=America/Chicago|'vm-received' Q 'digits/at' IMp  central24=America/Chicago|'vm-received' q 'digits/at' H N 'hours'  military=Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'  european=Europe/Copenhagen|'vm-received' a d b 'digits/at' HM  [default]  3001 => 3001,user1,user1@recreate.bug,,imapuser=user1  3002 => 3002,user2,user2@recreate.bug,,imapuser=user2  3003 => 3003,user3,user3@recreate.bug,,imapuser=user3  3004 => 3004,user4,user4@recreate.bug,,imapuser=user4  3005 => 3005,user5,user5@recreate.bug,,imapuser=user5  3006 => 3006,user6,user6@recreate.bug,,imapuser=user6  3007 => 3007,user7,user7@recreate.bug,,imapuser=user7  3008 => 3008,user8,user8@recreate.bug,,imapuser=user8  3009 => 3009,user9,user9@recreate.bug,,imapuser=user9# configure a minimal dialplan to quickly get in to voicemail mailboxes  mv /etc/asterisk/voicemail.conf /etc/asterisk/voicemail.conf.bak  edit /etc/asterisk/extension.conf  [general]  static=yes  writeprotect=no  clearglobalvars=no  [macro-sendtovmail]  exten => s,1,Answer  exten => s,n,Voicemail(${ARG1},u)  exten => s,n,Hangup  [recreate]  exten => _300X,1,Macro(sendtovmail, ${EXTEN})# fireup asterisk, simulate concurrent callers in vmail, hanging up a close as possible to after beep + 3 seconds   asterisk -cgvvvv  ./hammer.sh (sends 10 calls using PJSUA, plays 30 second message, disconnects abruptly)# asterisk sputters when client disconnects (not just for PJSUA) spits IMAP parsing errors [Feb 17 21:47:43] WARNING[23822]: app_voicemail.c:1710 mm_log: IMAP Warning: Missing IMAP reply key: *[Feb 17 21:47:43] WARNING[23821]: app_voicemail.c:1710 mm_log: IMAP Warning: Not an atom: [Feb 17 21:47:43] WARNING[23821]: app_voicemail.c:1710 mm_log: IMAP Warning: Bogus string list member: [Feb 17 21:47:43] WARNING[23821]: app_voicemail.c:1710 mm_log: IMAP Warning: Bogus header field list: ([Feb 17 21:47:43] WARNING[23821]: app_voicemail.c:1710 mm_log: IMAP Warning: IMAP server sent a blank line[Feb 17 21:47:43] WARNING[23821]: app_voicemail.c:1710 mm_log: IMAP Warning: Missing IMAP reply key: )# if it sputters bad enough it coughs on the IMAP parse hard enough to segfault(gdb) bt#0  ucase (s=0x0) at misc.c:43#1  0xb7b8230d in imap_parse_unsolicited (stream=0x825cbb0, reply=0x82b6da4) at imap4r1.c:3596#2  0xb7b84b0c in imap_reply (stream=0x825cbb0, tag=0xb7132dfe "00000052") at imap4r1.c:3453#3  0xb7b84c0c in imap_sout (stream=0x825cbb0, tag=0xb7132dfe "00000052", base=0x82b6df8 "PERMANENTFLAGS", s=0xb71329f8)    at imap4r1.c:3411#4  0xb7b86687 in imap_send (stream=0x825cbb0, cmd=0xb7bfc73f "SELECT", args=0xb7132e60) at imap4r1.c:3045#5  0xb7b8cb31 in imap_open (stream=0x825cbb0) at imap4r1.c:957#6  0xb7b69cf6 in mail_open (stream=0x825cbb0,     name=0xb7134246 "{localhost:143/imap/authuser=phonesys/notls/user=user8}INBOX", options=0) at mail.c:1220#7  0xb7b382aa in ?? () from /usr/lib/asterisk/modules/app_voicemail.so#8  0xb7b4368d in ?? () from /usr/lib/asterisk/modules/app_voicemail.so#9  0xb7b43fe6 in ?? () from /usr/lib/asterisk/modules/app_voicemail.so#10 0xb7b4b8db in ?? () from /usr/lib/asterisk/modules/app_voicemail.so#11 0xb7b4dc3f in ?? () from /usr/lib/asterisk/modules/app_voicemail.so#12 0x080cd260 in pbx_extension_helper (c=0x81ff888, con=0x0, context=0x81ffa08 "macro-sendtovmail", exten=0x81ffa58 "s",     priority=2, label=0x0, callerid=0x82fab48 "user8", action=E_SPAWN) at pbx.c:537#13 0xb7852084 in _macro_exec (chan=0x81ff888, data=<value optimized out>, exclusive=0) at app_macro.c:308#14 0x080cd260 in pbx_extension_helper (c=0x81ff888, con=0x0, context=0x81ffa08 "macro-sendtovmail", exten=0x81ffa58 "s",     priority=1, label=0x0, callerid=0x82fab48 "user8", action=E_SPAWN) at pbx.c:537#15 0x080cec15 in __ast_pbx_run (c=0x81ff888) at pbx.c:2317#16 0x080cfb5e in pbx_thread (data=0x81ff888) at pbx.c:2621#17 0x0810215b in dummy_start (data=0x8213578) at utils.c:912#18 0xb7eff4fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0#19 0xb7e18e5e in clone () from /lib/tls/i686/cmov/libc.so.6
原创粉丝点击