⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 extensions.ael

📁 asterisk 一个模拟IPPBX的源代码
💻 AEL
📖 第 1 页 / 共 5 页
字号:
		if( "${CALLERID(num)}"  = "7077577685" & "${CALLERID(name)}" : "Privacy Manager" )		{			&callerid-liar();		}		TrySystem(/usr/local/bin/who-is-it ${CALLERID(num)} "${CALLERID(name)}"&);		Set(lds=${DB(playlds/${CALLERID(num)})});		if( "${lds}" = "1" )		{			SetMusicOnHold(mohlds);		}		direct=${DB(DirectCall/${CALLERID(num)})};		if( "${direct}" != "" & ${direct} != 0 )		{			verbose(direct is XXX#${direct}XXXX);			Playback(greetings/direct); // Welcome to the Murphy residence. This system will automatically try to connect you to...			Playback(/var/spool/asterisk/voicemail/default/${direct}/greet);			TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/${direct}/greet.wav&);			switch(${direct})			{			case 1: //Steve				&std-priv-exten(Zap/6r3&Sip/murf,1,25,mpA(beep)tw,telemarket,telemarket);				goto s|loopback;			case 2: //Sonya		                &std-priv-exten(Zap/3r1&Zap/5r1,2,25,mtw,telemarket,telemarket);				goto s|loopback;			default: // all the kids				Set(z=${direct}-2);				goto homeline-kids|${z}|1;			}		}	loopback:		ifTime(*|*|20-25|dec) 		{ 			Playback(greetings/christmas); 		}		else ifTime(*|*|31|dec) 		{	 			Playback(greetings/newyear); 		}		else ifTime(*|*|1|jan)		{			Playback(greetings/newyear);		}		else ifTime(*|*|14|feb)		{			Playback(greetings/valentines);		}		else ifTime(*|*|17|mar) 		{			Playback(greetings/stPat);		}		else ifTime(*|*|31|oct) 		{			Playback(greetings/halloween);		}		else ifTime(*|mon|15-21|jan) 		{			Playback(greetings/mlkDay);		}		else ifTime(*|thu|22-28|nov)		{			Playback(greetings/thanksgiving);		}		else ifTime(*|mon|25-31|may)		{			Playback(greetings/memorial);		}		else ifTime(*|mon|1-7|sep)		{			Playback(greetings/labor);		}		else ifTime(*|mon|15-21|feb)		{			Playback(greetings/president);		}		else ifTime(*|sun|8-14|may)		{			Playback(greetings/mothers);		}		else ifTime(*|sun|15-21|jun)		{			Playback(greetings/fathers);		} 		else 		{			Playback(greetings/hello);   // None of the above? Just a plain hello will do		}  		Background(murphy-homeline-intro1);  // Script: Hello-- Welcome to the Murphy's! If you already know what                                                //  option you want, you don't have to wait for this entire spiel-- just                                                //  have at it.                                                //  If you are calling because this number is on a list of some sort, dial 6.                                                //  If you want Sonya, dial 1.                                                //  If you want one of the kids, dial 2.                                                //  If you want Steve, dial 3.						//  to play with your introduction, dial 5.                                                //  If we don't seem to be giving you the time of day, try 7.                                                //  Have a good day!			}	1 => {  // Sonya			TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/2/greet.wav&);			&std-priv-exten(Zap/3r1&Zap/5r1,2,25,mtw,telemarket,telemarket);			goto s|loopback;	}	2 => {  // Kids			goto homeline-kids|s|begin;	}	21 => {		Dial(IAX2/seaniax,20,T);		}	3 => {  // Steve			&std-priv-exten(Zap/6r3&Sip/murf,1,25,mpA(beep)tw,telemarket,telemarket);			goto s|loopback;	}	4 => {  // Voicemail 			VoicemailMain();			goto s|loopback;	}	5 => {   // play with intro			goto home-introduction|s|begin;	}	6 => {    // Telemarketers			goto telemarket|s|begin;	}	7 => {    // time of day, riddle			agi(tts-riddle.agi);			Background(gsm/what-time-it-is2);			SayUnixTime();			goto s|loopback;	}	792 => {   // Page All			goto pageall|s|begin;	}	793 => { // check the tone recognition			Read(zz,,0,,1,0);			SayDigits(${zz});	}	t => {		Set(repeatcount=${repeatcount} + 1);		if( ${repeatcount} < 3 )		{			goto s|loopback;  // just loopback isn't enough		}		Hangup();	}	i => {		Background(invalid);		goto s|loopback;	}	o => {		Congestion();	}	fax => {		Dial(Zap/4);	}}// Some comments// Some more commentscontext pageall {	s => {	begin:		AGI(callall);		MeetMe(5555,dtqp);		MeetMeAdmin(5555,K);		Hangup();	}	h => {	begin:		MeetMeAdmin(5555,K);		Background(conf-muted);		Hangup();	}}// Some comments// Some more commentscontext add-to-conference {	start => {		NoCDR();		MeetMe(5555,dmqp);	}	h => {		Hangup();	}}context home-introduction {	s => {	begin:		Background(intro-options);   // Script: To hear your Introduction, dial 1.						//         to record a new introduction, dial 2.						//         to return to the main menu, dial 3.						//         to hear what this is all about, dial 4.	}	1 => {		Playback(priv-callerintros/${CALLERID(num)});		goto s|begin;	}	2 => {		goto home-introduction-record|s|begin;	}	3 => {		goto homeline|s|loopback;	}	4 => {		Playback(intro-intro);     // Script:				// This may seem a little strange, but it really is a neat				// thing, both for you and for us. I've taped a short introduction				// for many of the folks who normally call us. Using the Caller ID				// from each incoming call, the system plays the introduction				// for that phone number over a speaker, just as the call comes in.				// This helps the folks				// here in the house more quickly determine who is calling.				// and gets the right ones to gravitate to the phone.				// You can listen to, and record a new intro for your phone number				// using this menu.		goto s|begin;	}	t => {		goto s|begin;	}	i => {		Background(invalid);		goto s|begin;	}	o => {		goto s|begin;	}}context home-introduction-record {	s => {	begin:		Background(intro-record-choices);    // Script:				//      If you want some advice about recording your				// 	introduction, dial 1. 				//      otherwise, dial 2, and introduce yourself after				//      the beep.	}	1 => {	Playback(intro-record);				//	Your introduction should be short and sweet and crisp.				//	Your introduction will be limited to 10 seconds.				//	This is NOT meant to be a voice mail message, so				//	please, don't say anything about why you are calling.				//	After we are done making the recording, your introduction				//	will be saved for playback. 				//	If you are the only person that would call from this number, 				//	please state your name.  Otherwise, state your business				//	or residence name instead. For instance, if you are 				//	friend of the family, say, Olie McPherson, and both				//	you and your kids might call here a lot, you might				//	say: "This is the distinguished Olie McPherson Residence!"				//	If you are the only person calling, you might say this:				//	"This is the illustrious Kermit McFrog! Pick up the Phone, someone!!"				//	If you are calling from a business, you might pronounce a more sedate introduction,like,				//	"Fritz from McDonalds calling.", or perhaps the more original introduction:				//	"John, from the Park County Morgue. You stab 'em, we slab 'em!".				//	Just one caution: the kids will hear what you record every time				//	you call. So watch your language!				//	I will begin recording after the tone. 				//	When you are done, hit the # key. Gather your thoughts and get 				//	ready. Remember, the # key will end the recording, and play back				//      your intro. Good Luck, and Thank you!"		goto 2|begin;	}	2 => {		begin:		Background(intro-start);				//  OK, here we go! After the beep, please give your introduction.		Background(beep);		Record(priv-callerintros/${CALLERID(num)}:gsm,3);		Background(priv-callerintros/${CALLERID(num)});		goto home-introduction|s|begin;	}	t => {		goto s|begin;	}	i => {		Background(invalid);		goto s|begin;	}	o => {		goto s|begin;	}}context homeline-kids {	s => {	begin:		Background(murphy-homeline-kids);        //  Which Kid? 1=Sean, 2:Eric, 3:Ryan, 4:Kyle, 5:Amber, 6:Alex, 7:Neal	}	1 => {  // SEAN			TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/3/greet.wav&);			// &std-priv-exten(Zap/3r2&Zap/5r2,3,35,mtw,telemarket,telemarket);			&std-priv-exten(IAX2/seaniax&Zap/5r2,3,35,mtw,telemarket,telemarket);			goto homeline|s|loopback;	}	2 => {  // ERIC			TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/4/greet.wav&);			Voicemail(u4);			goto homeline|s|loopback;						// SetMusicOnHold(erics);			// TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			// TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/4/greet.wav&);			// &std-priv-exten(Zap/3r2&Zap/5r2,4,35,mtw,telemarket,telemarket);			// goto homeline|s|loopback;	}	3 => {  // RYAN			TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/5/greet.wav&);			&std-priv-exten(Zap/3r2&Zap/5r2,5,35,mtw,telemarket,telemarket);			goto homeline|s|loopback;	}	4 => {  // KYLE			TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/6/greet.wav&);			&std-priv-exten(Zap/3r2&Zap/5r2,6,35,mtw,telemarket,telemarket);			goto homeline|s|loopback;	}	5 => {			TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/7/greet.wav&);			&std-priv-exten(Zap/3r2&Zap/5r2,7,35,mtw,telemarket,telemarket);			goto homeline|s|loopback;				}	6 => {			TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/8/greet.wav&);			&std-priv-exten(Zap/3r2&Zap/5r2,8,35,mtw,telemarket,telemarket);			goto homeline|s|loopback;	}	7 => {			TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);			TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/9/greet.wav&);			&std-priv-exten(Zap/3r2&Zap/5r2,9,35,mtw,telemarket,telemarket);			goto homeline|s|loopback;	}	t => {		goto s|begin;	}	i => {		Background(invalid);		goto s|begin;	}	o => {		goto s|begin;	}}context voipworkline {	s => {	begin:		Answer();		TrySystem(/usr/local/bin/who-is-it ${CALLERID(num)} "${CALLERID(name)}"&);		goto workline|s|loopback;	}	7075679201 => {		Answer();		TrySystem(/usr/local/bin/who-is-it ${CALLERID(num)} "${CALLERID(name)}"&);		goto workline|s|loopback;	}}context workline {	s => {	begin:		Answer();		Wait(1);		Set(repeatcount=0);		Zapateller(nocallerid);//              PrivacyManager();//              if( "${PRIVACYMGRSTATUS}" = "FAILED" )//              {//                     goto privacyManagerFailed|s|begin;//              }		&fillcidname();		TrySystem(/usr/local/bin/who-is-it ${CALLERID(num)} "${CALLERID(name)}"&);	loopback:		Background(greetings/greeting);  //script: Hello		Background(murphy-office-intro1); //script: welcome to Steve Murphy's office. If you are dialing                                              //  this number because it was on a calling list of any sort, dial 6.                                              // Otherwise, dial 1, and hopefully, you will reach Steve.	}	1 => {		TrySystem(/usr/bin/play /var/lib/asterisk/sounds/call-for.gsm);		TrySystem(/usr/bin/play /var/spool/asterisk/voicemail/default/1/greet.wav&);				&std-priv-exten(Zap/6&Sip/murf,1,30,mtw,telemarket,telemarket);		goto s|loopback;			}	4 => {		VoicemailMain(); 		goto s|loopback;	}	6 => {		goto telemarket|s|begin;	}	793 => { // check the tone recognition			Read(zz,,0,,1,0);			SayDigits(${zz});	}	t => {		repeatcount=${repeatcount} + 1;		if( ${repeatcount} < 3 )		{			goto s|loopback;  // just loopback isn't enough		}		Hangup();	}	i => {		Background(invalid); 		goto s|loopback;	}	o => {		Congestion();	}	fax => {		Answer();		Dial(Zap/4);	}}context dialFWD {	ignorepat => 8;	ignorepat => 9;	_83. => {		Set(CALLERID(name)=${FWDCIDNAME});		Dial(IAX2/${FWDNUMBER}:${FWDPASSWORD}@iax2.fwdnet.net/${EXTEN:2},60,r);		Congestion();	}	_82NXX => {		Set(CALLERID(name)=${FWDCIDNAME});		Dial(IAX2/${FWDNUMBER}:${FWDPASSWORD}@iax2.fwdnet.net/${EXTEN:2},60,r);		Congestion();	}	_92NXX => {		Set(CALLERID(name)=${FWDCIDNAME});		Dial(IAX2/${FWDNUMBER}:${FWDPASSWORD}@iax2.fwdnet.net/${EXTEN:2},60,r);		Congestion();	}}context dialiaxtel {	ignorepat => 8;	ignorepat => 9;	_81700NXXXXXX => {		Dial(IAX2/zorch:zilchnoodle@iaxtel.com/${EXTEN:1}@iaxtel);	}	_81800NXXXXXX => {		Dial(IAX2/zorch:zilchnoodle@iaxtel.com/${EXTEN:1}@iaxtel);	}	_91700NXXXXXX => {		Dial(IAX2/zorch:zilchnoodle@iaxtel.com/${EXTEN:1}@iaxtel);	}	_91800NXXXXXX => {		Dial(IAX2/zorch:zilchnoodle@iaxtel.com/${EXTEN:1}@iaxtel);	}}context dialgoiax {	ignorepat => 9;	_93. => {		Set(CALLERID(name)="Joe Worker");		Dial(IAX2/878201007658:stickyfinger295@server1.goiax.com/${EXTEN:2},60,r);		Congestion();	}}context homefirst {	ignorepat => 9;	_91NXXNXXXXXX => {		&ciddial(${EXTEN:1},${EXTEN:2},30,TW,Zap/1);	}	_9754XXXX => {		&ciddial(${EXTEN:1},707${EXTEN:1},30,TW,Zap/1);	}	_9574XXXX => {		&ciddial(${EXTEN:1},707${EXTEN:1},30,TW,Zap/1);	}	_9202XXXX => {		&ciddial(${EXTEN:1},707${EXTEN:1},30,TW,Zap/1);	}	_9219XXXX => {		&ciddial(${EXTEN:1},707${EXTEN:1},30,TW,Zap/1);	}	_9254XXXX => {		&ciddial(${EXTEN:1},707${EXTEN:1},30,TW,Zap/1);	}	_9716XXXX => {		&ciddial(${EXTEN:1},707${EXTEN:1},30,TW,Zap/1);	}	_9NXXXXXX => {		&ciddial(1707${EXTEN:1},707${EXTEN:1},30,TW,Zap/1);	}	_9011. => {		&ciddial(${EXTEN:1},${EXTEN:1},30,TW,Zap/1);	}	_9911 => {		Dial(Zap/1/911,30,T);	}	_9411 => {		Dial(Zap/1/411,30,T);	}}context workfirst {	ignorepat => 9;	_91NXXNXXXXXX => {		&ciddial2(${EXTEN:1},${EXTEN:2},30,TW,Zap/1);	}	_9754XXXX => {		&ciddial2(${EXTEN:1},707${EXTEN:1},30,TW,Zap/1);	}	_9574XXXX => {		&ciddial2(${EXTEN:1},707${E

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -