Advertisement
rdailey

extensions.conf working example

Jun 10th, 2011
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. ; extensions.conf - the Asterisk dial plan
  2. ;
  3. ; Static extension configuration file, used by
  4. ; the pbx_config module. This is where you configure all your
  5. ; inbound and outbound calls in Asterisk.
  6. ;
  7. ; This configuration file is reloaded with the "dialplan reload" command in the CLI
  8.  
  9. [general];
  10. static=yes;
  11. writeprotect=no;
  12. autofallthrough=no;
  13. clearglobalvars=yes;
  14.  
  15.  
  16. [globals];
  17.  
  18.  
  19. [default];
  20. exten => s,1,Verbose(Unrouted call handler);
  21. same => n,Playback(silence/1&tt-weasels);
  22. same => n,Hangup();
  23.  
  24.  
  25. [voipms-inbound];
  26. exten => 3149691077,1,Goto(business-inbound,s,1);
  27.  
  28. exten => 3145551212,1,NoOp();
  29. same => n,Dial(SIP/jill,30);
  30. same => n,VoiceMail(jill@default);
  31. same => n,Hangup();
  32.  
  33. exten => 3148888888,1,Goto(fax-in,fax,1); This is a dedicated fax number
  34.  
  35. exten => _X.,1,Verbose(Call to undefined ${EXTEN}: ${CALLERID(all)} -- ${STRFTIME(${EPOCH},,%Y-%m-%d %H%M.%S)});
  36. same => n,Playback(silence/1&ss-noservice);
  37. same => n,Congestion(30);
  38. same => n,Hangup();
  39.  
  40.  
  41. [ipkall-inbound];
  42. exten => 2065237757,1,NoOp();
  43. same => n,Dial(SIP/jane,30);
  44. same => n,VoiceMail(jane@default);
  45. same => n,Hangup();
  46.  
  47. exten => _X.,1,Verbose(Call to undefined ${EXTEN}: ${CALLERID(all)} -- ${STRFTIME(${EPOCH},,%Y-%m-%d %H%M.%S)});
  48. same => n,Playback(silence/1&ss-noservice);
  49. same => n,Congestion(30);
  50. same => n,Hangup();
  51.  
  52.  
  53. [business-inbound];
  54. exten => s,1,NoOp();
  55. exten => s,n,Set(COUNT=3); initialize the variable and set how many loops you want
  56. exten => s,n,Set(TIMEOUT(digit)=3);
  57. exten => s,n,BackGround(silence/1&if-u-know-ext-dial);
  58. exten => s,n,While($[${COUNT} > 0]);
  59. exten => s,n,BackGround(silence/1&for-tech-support&press&digits/1);
  60. exten => s,n,BackGround(silence/1&for-service&press&digits/2);
  61. exten => s,n(return),WaitExten(4); ; Return here on invalid
  62. exten => s,n,Set(COUNT=$[${COUNT} - 1]);
  63. exten => s,n,EndWhile();
  64. exten => s,n,WaitExten(2);
  65. exten => s,n,Goto(t,1);
  66.  
  67. exten => 1,1,Queue(queue-tech-support,hntw,,,3600);
  68. exten => 1,n,Playback(all-reps-busy);
  69. exten => 1,n,VoiceMail(4000@default);
  70. exten => 1,n,Hangup();
  71.  
  72. exten => 2,1,Queue(queue-service,hntw,,,3600);
  73. exten => 2,n,Playback(all-reps-busy);
  74. exten => 2,n,VoiceMail(5000@default);
  75. exten => 2,n,Hangup();
  76.  
  77. exten => i,1,BackGround(pbx-invalid);
  78. same => n,WaitExten(2);
  79. same => n,Goto(s,return);
  80.  
  81. exten => t,1,Playback(sorry-youre-having-problems&vm-goodbye);
  82. same => n,Hangup();
  83.  
  84. include => internal;
  85.  
  86.  
  87. [fax-in];
  88. exten => fax,1,NoOp();
  89. same => n,Ringing();
  90. same => n,Set(TIMEOUT(absolute)=300);
  91. same => n,Set(FileBaseName=${STRFTIME(${EPOCH},,%Y%m%d)}-${CALLERID(num)}-${UNIQUEID});
  92. same => n,Set(FAXFILE=/var/spool/asterisk/fax/${FileBaseName}.tif);
  93. same => n,Set(PDFFILE=/var/spool/asterisk/fax/pdf/${FileBaseName}.pdf);
  94. ;same => n,Wait(9); Optional, for more ring time
  95. same => n,ReceiveFAX(${FAXFILE});
  96.  
  97. exten => h,1,NoOp();
  98. same => n,GotoIf($[${EXISTS(${FAXOPT(status)})}]?${FAXOPT(status)});
  99. same => n,Set(FAXOPT(status)=NOSTATUS);
  100. same => n(SUCCESS),NoOp();
  101. same => n,System(/usr/bin/tiff2pdf -o ${PDFFILE} ${FAXFILE});
  102. same => n,System(/bin/echo "Please see attachment."|/usr/bin/mutt -a ${PDFFILE} -s "New fax from ${CALLERID(num)}" -- ${DB(fax/fax-manager/email)});
  103. ;same => n,System(/bin/rm ${FAXFILE}); Delete the TIFF
  104. ;same => n,System(/bin/rm ${PDFFILE}); Delete the PDF
  105. same => n,Goto(end);
  106. same => n(FAILED),NoOp();
  107. same => n,System(/bin/echo "I regret to inform you that a fax from ${CALLERID(all)} has failed. If you were expecting a fax from this number\, you may need to contact the sender and ask to have it sent again."|/usr/bin/mutt -s "Fax from ${CALLERID(num)} failed" -- ${DB(fax/fax-manager/email)});
  108. same => n(end),NoOp();
  109. same => n,Verbose(mail result = ${SYSTEMSTATUS});
  110.  
  111. exten => t,1,Congestion();
  112. exten => T,1,Hangup();
  113.  
  114.  
  115. [callcentric-outbound];
  116. exten => _1777ZXXXXXX,1,Dial(SIP/callcentric/${EXTEN}); callcentric internal calling using 777 area code
  117.  
  118.  
  119. [voipms-outbound];
  120. exten => _NXXXXXX,1,Goto(1314${EXTEN},1); 7-digit dialing in the 314 area code
  121. exten => _NXXNXXXXXX,1,Goto(1${EXTEN},1); 10-digit dialing
  122. exten => _1NXXNXXXXXX,1,Dial(SIP/voipms/${EXTEN}); 11-digit dialing
  123. exten => _1NXXNXXXXXX,n,Hangup();
  124.  
  125. exten => _011.,1,Dial(SIP/voipms/${EXTEN}); international dialing using 011 prefix
  126. exten => _011.,n,Hangup();
  127.  
  128. exten => _00.,1,Dial(SIP/voipms/${EXTEN}); international dialing using 00 prefix
  129. exten => _00.,n,Hangup();
  130.  
  131.  
  132. [isn-outbound];
  133. exten => _012.,1,NoOp();
  134. exten => _012.,n,Set(CALLERID(num)=700${CALLERID(num)}*929);
  135. exten => _012.,n,Set(CALLERID(name)=ISN ${CALLERID(name)});
  136. exten => _012.,n,Set(TIMEOUT(absolute)=10800);
  137. exten => _012.,n,Set(isnresult=${ENUMLOOKUP(${EXTEN:3},sip,,,freenum.org)});
  138. exten => _012.,n,GotoIf($["${isnresult}" = ""]?congestion);
  139. exten => _012.,n,Dial(SIP/${isnresult},120);
  140. exten => _012.,n(congestion),Congestion();
  141.  
  142. exten => h,1,Hangup();
  143. exten => i,1,Congestion();
  144. exten => T,1,Hangup();
  145.  
  146.  
  147. [internal];
  148. exten => 123,1,Dial(SIP/00001234FFFF-a,30);
  149. exten => 528,1,Dial(SIP/001122334455,30);
  150. exten => 762,1,Dial(SIP/aabbccddeeff,36);
  151.  
  152.  
  153. [phones];
  154. include => internal;
  155. include => callcentric-outbound;
  156. include => voipms-outbound;
  157. include => isn-outbound;
  158.  
  159.  
  160. [unauthenticated];
  161. exten => _X.,1,Verbose(Call to undefined ${EXTEN}: ${CALLERID(all)} -- ${STRFTIME(${EPOCH},,%Y-%m-%d %H%M.%S)});
  162. exten => _X.,n,Playback(silence/1&ss-noservice);
  163. exten => _X.,n,Congestion(30);
  164. exten => _X.,n,Hangup();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement