1 ///////////////////////////////////////////////////////////////////////////////
6 NoOp(Add a background sound to tell the user their options);
8 NoOp(Put in options to apologize and send user to voicemail);
11 0 => goto default|0|1;
13 Dial(u41950@svm1.shsu.edu);
20 context l903-calling {
22 Realtime(l903_ext|exchange|${EXTEN:4:3}|l903_);
23 if ("${l903_exchange}foo" = "foo") {
24 Playback(num-outside-area);
26 Playback(and-area-code);
27 Playback(before-the-number);
35 ///////////////////////////////////////////////////////////////////////////////
36 // Extensions pulled from houston.conf
37 // Converted the extension list to the database
39 context houston-calling {
41 Realtime(hou_713_ext|exchange|${EXTEN:4:3}|hou_713_);
42 if ("${hou_713_exchange}foo" = "foo") {
43 Playback(num-outside-area);
45 Playback(and-area-code);
46 Playback(before-the-number);
55 Realtime(hou_281_ext|exchange|${EXTEN:4:3}|hou_281_);
56 if ("${hou_281_exchange}foo" = "foo") {
57 Playback(num-outside-area);
59 Playback(and-area-code);
60 Playback(before-the-number);
69 Realtime(hou_832_ext|exchange|${EXTEN:4:3}|hou_832_);
70 if ("${hou_832_exchange}foo" = "foo") {
71 Playback(num-outside-area);
73 Playback(and-area-code);
74 Playback(before-the-number);
84 ///////////////////////////////////////////////////////////////////////////////
85 // Extensions pulled from huntsville.conf
86 // Converted the extension list to the database
88 context huntsville-calling {
90 Realtime(hv_ext|exchange|${EXTEN:1:3}|hv_);
91 if ("${hv_exchange}foo" = "foo") {
92 Playback(num-outside-area);
94 Playback(and-area-code);
95 Playback(before-the-number);
104 NoOp(Stripping last four to see what extension we're dialing);
105 Set(LAST4=${EXTEN:3});
109 i => Playback(pbx-invalid);
113 ///////////////////////////////////////////////////////////////////////////////
114 // Extensions pulled from macros.conf
116 macro dialout( number ) {
117 Realtime(call_info|exten|${CALLERIDNUM:5}|mon_);
118 if ("${mon_monitor}" = "YES") {
119 Dial(SIP/${number}@sgw1.shsu.edu,,wW);
120 Dial(SIP/${number}@sgw2.shsu.edu,,wW);
122 Dial(SIP/${number}@sgw1.shsu.edu);
123 Dial(SIP/${number}@sgw2.shsu.edu);
127 // Standard extension macro:
128 // ${ext} - Extension
129 macro stdexten( ext ) {
130 Realtime(sipusers|name|${ext}|sip_user_);
131 Realtime(call_info|exten|${ext}|info_);
132 if ("${sip_user_name}foo" = "foo") {
138 NoOp(${CALLERIDNUM});
139 RealtimeUpdate(call_info|exten|${ext}|calltrace|${CALLERIDNUM});
140 System(/usr/local/bin/db_update.sh call_info calltrace ${CALLERIDNUM} exten ${ext} &);
143 Realtime(call_info|exten|${CALLERIDNUM:5}|mon_);
144 if ("${mon_monitor}" = "YES") {
145 Dial(SIP/${info_forwardto},25,wW);
147 Dial(SIP/${info_forwardto},25);
149 switch ("${DIALSTATUS}") {
154 Dial(IAX2/asterisk:password@scm2.shsu.edu/${info_forwardto},25,wW);
155 MailboxExists(${ext});
156 // if ("${VMBOXEXISTSSTATUS}" = "FAILED") {
164 MailboxExists(${ext});
165 if ("$(VMBOXEXISTSSTATUS}" = "FAILED") {
173 MailboxExists(${ext});
174 if ("$(VMBOXEXISTSSTATUS}" = "FAILED") {
185 Dial(SIP/u${ext}@svm1.shsu.edu);
187 Playback(voice-mail-system);
194 Dial(SIP/b${ext}@svm1.shsu.edu);
196 Playback(voice-mail-system);
202 macro checkdnd( ext ) {
203 if ("${info_donotdisturb}foo" = "foo") {
204 NoOp(Do Not Disturb is not active);
209 macro checkcf( ext ) {
210 if ("${info_forwardto}foo" = "foo")
211 if ("${ext}" = "43974") {
212 Set(info_forwardto=${ext}&SCCP/${ext});
214 Set(info_forwardto=${ext}&SIP/${ext}w);
218 macro checkcfb( ext ) {
219 if ("${info_forwardbusy}foo" = "foo") {
221 MailboxExists(${ext});
222 if ("$(VMBOXEXISTSSTATUS}" = "FAILED") {
229 &stdexten(${info_forwardbusy});
232 ///////////////////////////////////////////////////////////////////////////////
233 // Extensions pulled from test.conf
235 context test-include {
243 context test-digium {
245 Dial(IAX2/guest@misery.digium.com/s@default);
251 context test-sounds {
260 context test-phinfo {
263 NoOp(${CALLERIDNUM:5});
264 SayDigits(${CALLERIDNUM:5});
269 ///////////////////////////////////////////////////////////////////////////////
270 // Extensions pulled from external.conf
272 context long-distance {
277 _91XXXXXXXXXX => &dialout(${EXTEN});
278 _9011. => &dialout(${EXTEN});
286 911 => &dialout(911);
287 9911 => &dialout(9911);
289 _9NXXXXXX => goto huntsville-calling|${EXTEN}|1;
322 _91800NXXXXXX => &dialout(${EXTEN});
323 _91866NXXXXXX => &dialout(${EXTEN});
324 _91877NXXXXXX => &dialout(${EXTEN});
325 _91888NXXXXXX => &dialout(${EXTEN});
326 _91900NXXXXXX => &dialout(${EXTEN});
327 _91976NXXXXXX => &dialout(${EXTEN});
328 _9713NXXXXXX => goto houston-calling|${EXTEN}|1;
329 _9281NXXXXXX => goto houston-calling|${EXTEN}|1;
330 _9832NXXXXXX => goto houston-calling|${EXTEN}|1;
331 _9903NXXXXXX => goto l903-calling|${EXTEN}|1;
333 _31NXXNXXXXXX => &dialout(${EXTEN});
338 ///////////////////////////////////////////////////////////////////////////////
339 // Extensions pulled from internal.conf
343 NoOp(DIALING SIP EXTENSION ${EXTEN} - FROM ${CALLERIDNUM});
344 Dial(SIP/${EXTEN},20,wW);
349 NoOp(DIALING SIP EXTENSION ${EXTEN} - FROM ${CALLERIDNUM});
350 Dial(SIP/${EXTEN},20,wW);
355 ///////////////////////////////////////////////////////////
356 // All internal extensions work through the default context
357 // Phones that can only make internal calls should be in
359 ///////////////////////////////////////////////////////////
362 // Include the contexts in the files that allow us to make these phone calls
369 // ALWAYS have an 'h' extension
371 NoOp(Hangup cause was: ${HANGUPCAUSE});
375 // We like to hear that we dialed an invalid extension
376 i => Playback(pbx-invalid);
381 // Send voicemail calls to the vm-* contexts to be handled
382 voicemail => goto vm-direct|s|1;
383 5555 => goto vm-direct|s|1;
384 62100 => goto vm-extension|s|1;
386 // These are our campus extensions, send them to the macro
387 _6XXXX => &stdexten(${EXTEN});
388 _4XXXX => &stdexten(${EXTEN});
389 // These are campus extensions as well, might need to take this out though.
390 _9294XXXX => goto _4XXXX|1;
391 _9496XXXX => goto _6XXXX|1;
393 // These allows us to dial from the directory in our phone without worrying about dialing 9
409 ///////////////////////////////////////////////////////////////////////////////
410 // Extensions pulled from apps.conf
412 context apps-include {
432 Read(agent_no|agent-user);
433 AgentCallbackLogin(${agent_no}|s${CALLERIDNUM:5});
434 Playback(agent-loginok);
441 AgentCallbackLogin(${agent_no});
446 context app-calltrace {
447 // caller dials this to find out the last call missed and possibly call back
448 *69 => goto app-calltrace-perform|s|1;
451 context app-calltrace-perform {
455 Background(info-about-last-call);
456 Background(telephone-number);
457 RealTime(call_info|exten|${CALLERIDNUM:5}|ct_);
458 if ("${ct_calltrace}foo" = "foo") {
459 Playback(loligo/from-unknown-caller);
462 SayDigits("${ct_calltrace}");
463 Set(TIMEOUT(digit)=3);
464 Set(TIMEOUT(response)=7);
465 Background(loligo/to-call-this-number);
467 Background(loligo/silence/5);
471 1 => goto local|${ct_calltrace}|1;
474 Playback(vm-goodbye);
479 Playback(vm-goodbye);
484 context app-set-monitor {
486 Realtime(call_info|exten|${CALLERIDNUM:5}|mon_set_);
487 if ("${mon_set_monitor}" = "YES") {
488 RealtimeUpdate(call_info|exten|${CALLERIDNUM:5}|monitor|);
489 System(/usr/local/bin/db_update.sh call_info monitor '' exten ${CALLERIDNUM:5} &);
491 RealtimeUpdate(call_info|exten|${CALLERIDNUM:5}|monitor|YES);
492 System(/usr/local/bin/db_update.sh call_info monitor YES exten ${CALLERIDNUM:5} &);
494 NoOp(${mon_set_monitor});
503 RealtimeUpdate(call_info|exten|${CALLERIDNUM:5}|donotdisturb|YES);
504 System(/usr/local/bin/db_update.sh call_info donotdisturb YES exten ${CALLERIDNUM:5} &);
505 Playback(do-not-disturb);
506 Playback(loligo/activated);
513 RealtimeUpdate(call_info|exten|${CALLERIDNUM:5}|donotdisturb|);
514 System(/usr/local/bin/db_update.sh call_info donotdisturb '' exten ${CALLERIDNUM:5} &);
515 Playback(do-not-disturb);
516 Playback(loligo/de-activated);
521 context app-callforward {
522 // forwards calling extension to input number *72{EXTEN}
524 RealtimeUpdate(call_info|exten|${CALLERIDNUM:5}|forwardto|${EXTEN:3});
525 System(/usr/local/bin/db_update.sh call_info forwardto ${EXTEN:3} exten ${CALLERIDNUM:5} &);
528 Playback(loligo/call-fwd-unconditional);
529 Playback(loligo/for);
530 Playback(loligo/extension);
531 SayDigits(${CALLERIDNUM:5});
532 Playback(loligo/is-set-to);
533 SayDigits(${EXTEN:3});
537 // prompts for extension to forward to
541 Playback(please-enter-your);
543 Background(then-press-pound);
545 Background(loligo/ent-target-attendant);
546 Read(toext,loligo/then-press-pound);
548 RealtimeUpdate(call_info|exten|${AUTH_MAILBOX}|forwardto|${toext});
549 System(/usr/local/bin/db_update.sh call_info forwardto ${toext} exten ${AUTH_MAILBOX} &);
550 Playback(loligo/call-fwd-unconditional);
551 Playback(loligo/for);
552 Playback(loligo/extension);
553 SayDigits(${AUTH_MAILBOX});
554 Playback(loligo/is-set-to);
559 // cancels dialed extension call forward
561 Realtime(voicemail|mailbox|${EXTEN:3}|auth_);
564 Authenticate(${auth_password});
565 RealtimeUpdate(call_info|exten|${EXTEN:3}|forwardto|);
566 System(/usr/local/bin/db_update.sh call_info forwardto '' exten ${EXTEN:3} &);
568 SayDigits(${EXTEN:3});
569 Playback(loligo/call-fwd-cancelled);
573 // cancels call forward for calling extension
575 RealtimeUpdate(call_info|exten|${CALLERIDNUM:5}|forwardto|);
576 System(/usr/local/bin/db_update.sh call_info forwardto '' exten ${CALLERIDNUM:5} &);
579 Playback(loligo/call-fwd-cancelled);
583 // dialed call forward on busy
585 RealtimeUpdate(call_info|exten|${CALLERIDNUM:5}|forwardbusy|${EXTEN:3});
586 System(/usr/local/bin/db_update.sh call_info forwardbusy ${EXTEN:3} exten ${CALLERIDNUM:5} &);
589 Playback(loligo/call-fwd-on-busy);
590 Playback(loligo/for);
591 Playback(loligo/extension);
592 SayDigits(${CALLERIDNUM:5});
593 Playback(loligo/is-set-to);
594 SayDigits(${EXTEN:3});
598 // cancels call forward on busy for calling extension
600 RealtimeUpdate(call_info|exten|${CALLERIDNUM:5}|forwardbusy|);
601 System(/usr/local/bin/db_update.sh call_info forwardbusy '' exten ${CALLERIDNUM:5} &);
604 Playback(loligo/call-fwd-on-busy);
605 Playback(loligo/de-activated);
612 context app-idblock {
614 Set(CALLERID(name)=Anonymous);
615 &stdexten(${EXTEN:3});
619 context app-dictate {
627 // *59 <xx> <y.> - Set system speed dial <xx> to digits <y.>
628 // *59 <xx> 0 - Delete system speed dial <xx>
629 // *59 <xx> - Review system speed dial <xx>
630 // *1xx - Dial speed dial <xx>
633 RealtimeUpdate(ssd|sd|${EXTEN:3:2}|extension|${EXTEN:5});
634 System(/usr/local/bin/db_update.sh systemsd extension ${EXTEN:5} sd ${EXTEN:3:2} &);
636 Playback(loligo/speed-dial);
637 SayDigits(${EXTEN:3:2});
638 Playback(loligo/has-been-set-to);
639 SayDigits(${EXTEN:5});
645 RealtimeUpdate(ssd|sd|${EXTEN:3:2}|extension|);
646 System(/usr/local/bin/db_update.sh systemsd extension '' sd ${EXTEN:3:2} &);
648 Playback(loligo/speed-dial);
649 SayDigits(${EXTEN:3:2});
650 Playback(loligo/has-been-cleared);
656 Realtime(ssd|sd|${EXTEN:3}|ssd_);
657 if ("${ssd_extension}foo" = "foo") {
658 Playback(loligo/speed-dial);
659 SayDigits(${EXTEN:3:2});
660 Playback(loligo/is-not-set);
664 Playback(loligo/speed-dial);
665 SayDigits(${EXTEN:3:2});
666 Playback(loligo/is-set-to);
667 SayDigits(${ssd_extension});
671 // NTC = number to call
673 Realtime(ssd|sd|${EXTEN:2}|ssd_);
674 if ("${ssd_extension}foo" = "foo") {
677 Playback(loligo/speed-dial);
678 SayDigits(${EXTEN:2});
679 Playback(loligo/is-not-set);
682 &stdexten(${ssd_extension});
688 macro check-psd-exists ( ext ) {
689 Realtime(psd|extension|${ext}|psd_);
690 if ("${psd_extension}foo" = "foo") {
691 System(/usr/local/bin/create_psd.sh ${ext});
693 NoOp(PSD set for ${ext});
697 // *89 <xx> <y.> - Set personal speed dial <xx> to digits <y.>
698 // *89 <xx> 0 - Delete personal speed dial <xx>
699 // *89 <xx> - Review personal speed dial <xx>
700 // *2xx - Dial personal speed dial <xx>
702 &check-psd-exists(${CALLERIDNUM:5});
704 RealtimeUpdate(psd|extension|${CALLERIDNUM:5}|s${EXTEN:3:2}|${EXTEN:5});
705 System(/usr/local/bin/db_update.sh personalsd s${EXTEN:3:2} ${EXTEN:5} extension ${CALLERIDNUM:5} &);
707 Playback(loligo/speed-dial);
708 SayDigits(${EXTEN:3:2});
709 Playback(loligo/has-been-set-to);
710 SayDigits(${EXTEN:5});
715 &check-psd-exists(${CALLERIDNUM:5});
717 RealtimeUpdate(psd|extension|${CALLERIDNUM:5}|s${EXTEN:3:2}|);
718 System(/usr/local/bin/db_update.sh personalsd s${EXTEN:3:2} '' extension ${CALLERIDNUM:5} &);
720 Playback(loligo/speed-dial);
721 SayDigits(${EXTEN:3:2});
722 Playback(loligo/has-been-cleared);
727 &check-psd-exists(${CALLERIDNUM:5});
729 Realtime(psd|extension|${CALLERIDNUM:5}|psd_);
731 if ("${psd_s${EXTEN:3:2}}foo" = "foo") {
732 Playback(loligo/speed-dial);
733 SayDigits(${EXTEN:3:2});
734 Playback(loligo/is-not-set);
737 Playback(loligo/speed-dial);
738 SayDigits(${EXTEN:3:2});
739 Playback(loligo/is-set-to);
740 SayDigits(${psd_s${EXTEN:3:2}});
744 // NTC = number to call
746 &check-psd-exists(${CALLERIDNUM:5});
747 Realtime(psd|extension|${CALLERIDNUM:5}|psd_);
748 if ("${psd_s${EXTEN:2}}foo" = "foo") {
751 Playback(loligo/speed-dial);
752 SayDigits(${EXTEN:2});
753 Playback(loligo/is-not-set);
756 &stdexten(${psd_s${EXTEN:2}});
762 context app-helpdesk {
769 context app-conferences {
770 // waiting for room number announcement
771 *86 => goto app-conf-hidden|s|1;
774 context app-conf-hidden {
777 Playback(loligo/please-enter-the);
778 Playback(loligo/extension);
779 read(roomtoenter,loligo/then-press-pound);
780 Meetme(${roomtoenter});
785 _1. => Meetme(${EXTEN});
788 ///////////////////////////////////////////////////////////////////////////////
789 // Extensions pulled from vm.conf:
801 Dial(SIP/5555@svm1.shsu.edu,20);
803 Playback(voice-mail-system);
805 Playback(extra/pls-try-call-later);
811 context vm-extension {
813 Dial(SIP/62100@svm1.shsu.edu,20);
815 Playback(voice-mail-system);
817 Playback(extra/pls-try-call-later);
823 context vm-directory {
825 Dial(SIP/5556@svm1.shsu.edu);
827 Playback(voice-mail-system);
829 Playback(extra/pls-try-call-later);