mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	Compare commits
	
		
			744 Commits
		
	
	
		
			certified/
			...
			1.2.18-net
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					f453ab22ae | ||
| 
						 | 
					96482ee598 | ||
| 
						 | 
					c26ebad187 | ||
| 
						 | 
					a66029756b | ||
| 
						 | 
					0c81d2e046 | ||
| 
						 | 
					9c2c0004a8 | ||
| 
						 | 
					242a90d01f | ||
| 
						 | 
					b850893d6c | ||
| 
						 | 
					31a1692162 | ||
| 
						 | 
					0401150187 | ||
| 
						 | 
					e278c92503 | ||
| 
						 | 
					d691fa4d17 | ||
| 
						 | 
					d5b4a6c3c0 | ||
| 
						 | 
					2f76122f9a | ||
| 
						 | 
					6e2e94e498 | ||
| 
						 | 
					dc14a89f78 | ||
| 
						 | 
					3dbf6e09a7 | ||
| 
						 | 
					bf5b3a7fca | ||
| 
						 | 
					4f9d0e28e4 | ||
| 
						 | 
					aca1adfe03 | ||
| 
						 | 
					6e8d96fcd1 | ||
| 
						 | 
					e70e937cb1 | ||
| 
						 | 
					7a1390a0c6 | ||
| 
						 | 
					624988bd1e | ||
| 
						 | 
					e668aad746 | ||
| 
						 | 
					48e2d876ff | ||
| 
						 | 
					5901452ecb | ||
| 
						 | 
					5b029cfcb6 | ||
| 
						 | 
					faa652eeb4 | ||
| 
						 | 
					e421382a07 | ||
| 
						 | 
					f309e69638 | ||
| 
						 | 
					c23816ba19 | ||
| 
						 | 
					58500a4c7f | ||
| 
						 | 
					28d60b864c | ||
| 
						 | 
					70c96b9bc6 | ||
| 
						 | 
					f525f6de36 | ||
| 
						 | 
					902b16bdda | ||
| 
						 | 
					3951e4addf | ||
| 
						 | 
					c52232f4f4 | ||
| 
						 | 
					be2a021189 | ||
| 
						 | 
					39605fc510 | ||
| 
						 | 
					c590b397ea | ||
| 
						 | 
					b7f5c1ddf4 | ||
| 
						 | 
					b38e464dd3 | ||
| 
						 | 
					97942ba44c | ||
| 
						 | 
					2673fcd2d2 | ||
| 
						 | 
					224316634a | ||
| 
						 | 
					a85da9ebec | ||
| 
						 | 
					44ebb34bee | ||
| 
						 | 
					4423ae672e | ||
| 
						 | 
					c3a5b0d8e1 | ||
| 
						 | 
					3f98583e26 | ||
| 
						 | 
					df5009b564 | ||
| 
						 | 
					e16cd7369d | ||
| 
						 | 
					3b6d2f2633 | ||
| 
						 | 
					c31b4a6a2e | ||
| 
						 | 
					518d9c6dd1 | ||
| 
						 | 
					131fcf61e6 | ||
| 
						 | 
					2954de75bb | ||
| 
						 | 
					33ec4fecf5 | ||
| 
						 | 
					870af81ca1 | ||
| 
						 | 
					17679c25cf | ||
| 
						 | 
					96300341b9 | ||
| 
						 | 
					229aed7457 | ||
| 
						 | 
					48b43e1a92 | ||
| 
						 | 
					dc1836f854 | ||
| 
						 | 
					b507853850 | ||
| 
						 | 
					a7bd9aec9c | ||
| 
						 | 
					7c6c6a0d7b | ||
| 
						 | 
					23c17817ae | ||
| 
						 | 
					57122c46c5 | ||
| 
						 | 
					b7765f3783 | ||
| 
						 | 
					c1063541e5 | ||
| 
						 | 
					be9e3c0778 | ||
| 
						 | 
					93d501e3b3 | ||
| 
						 | 
					d55ae8cc0e | ||
| 
						 | 
					6bfe3a4244 | ||
| 
						 | 
					a88490a68c | ||
| 
						 | 
					155aee0b84 | ||
| 
						 | 
					dd0edc0f9c | ||
| 
						 | 
					03161d7a82 | ||
| 
						 | 
					e9b9632fef | ||
| 
						 | 
					1308ebf409 | ||
| 
						 | 
					20b69b892a | ||
| 
						 | 
					f29eee96ec | ||
| 
						 | 
					ff730c46b0 | ||
| 
						 | 
					33228042e7 | ||
| 
						 | 
					c58c4e83a2 | ||
| 
						 | 
					2911d1ab26 | ||
| 
						 | 
					263d1100fd | ||
| 
						 | 
					fb41b21e01 | ||
| 
						 | 
					29a132d611 | ||
| 
						 | 
					1c9163443a | ||
| 
						 | 
					3f1a198f45 | ||
| 
						 | 
					ff2ae14a9b | ||
| 
						 | 
					260eccbb03 | ||
| 
						 | 
					a94d625209 | ||
| 
						 | 
					5030563084 | ||
| 
						 | 
					a4e9dffea0 | ||
| 
						 | 
					ab1111631a | ||
| 
						 | 
					80da8dcaac | ||
| 
						 | 
					a552b8298c | ||
| 
						 | 
					f80eaea4ee | ||
| 
						 | 
					075c32cbb9 | ||
| 
						 | 
					a05d42a3ef | ||
| 
						 | 
					0517ed834e | ||
| 
						 | 
					fa061fa339 | ||
| 
						 | 
					a20330b393 | ||
| 
						 | 
					b8612623a2 | ||
| 
						 | 
					28de5dbaa9 | ||
| 
						 | 
					97f57029d5 | ||
| 
						 | 
					272ff651de | ||
| 
						 | 
					325d362076 | ||
| 
						 | 
					ac96ab8b01 | ||
| 
						 | 
					f7e49a14fd | ||
| 
						 | 
					b99c6b0329 | ||
| 
						 | 
					8672b596af | ||
| 
						 | 
					e42fdeeea1 | ||
| 
						 | 
					84041c2b8b | ||
| 
						 | 
					9dbe6ac46e | ||
| 
						 | 
					6459d34ade | ||
| 
						 | 
					8866f912c1 | ||
| 
						 | 
					8e36da5699 | ||
| 
						 | 
					32ef26d652 | ||
| 
						 | 
					05f6188c69 | ||
| 
						 | 
					3bb733a7c7 | ||
| 
						 | 
					74c70148ac | ||
| 
						 | 
					e993f73211 | ||
| 
						 | 
					ace0f74f27 | ||
| 
						 | 
					30448e4bac | ||
| 
						 | 
					e41860927e | ||
| 
						 | 
					830d07c933 | ||
| 
						 | 
					9a6cfc6866 | ||
| 
						 | 
					026b3a3fc7 | ||
| 
						 | 
					088684b275 | ||
| 
						 | 
					4a00839358 | ||
| 
						 | 
					5c99f456a9 | ||
| 
						 | 
					cc1353522f | ||
| 
						 | 
					5d49b657f6 | ||
| 
						 | 
					bea7528f5e | ||
| 
						 | 
					d7a7695b91 | ||
| 
						 | 
					ab1188c1f2 | ||
| 
						 | 
					2a0b7672d2 | ||
| 
						 | 
					6c4758530a | ||
| 
						 | 
					83852bc8c1 | ||
| 
						 | 
					225c4931fa | ||
| 
						 | 
					e3a3e8377d | ||
| 
						 | 
					1a0892dbeb | ||
| 
						 | 
					2489f46365 | ||
| 
						 | 
					dfafe2f958 | ||
| 
						 | 
					0485f6b149 | ||
| 
						 | 
					2097c7e87d | ||
| 
						 | 
					eacb11ad56 | ||
| 
						 | 
					d70d558bef | ||
| 
						 | 
					bf9aaf7beb | ||
| 
						 | 
					2c9a7acf54 | ||
| 
						 | 
					3dfd319062 | ||
| 
						 | 
					d2cbfe3d21 | ||
| 
						 | 
					b45cbc48f2 | ||
| 
						 | 
					213c6afa9b | ||
| 
						 | 
					50841b3a96 | ||
| 
						 | 
					029b67fd32 | ||
| 
						 | 
					41c63cf7f5 | ||
| 
						 | 
					e1fbeb0c7f | ||
| 
						 | 
					e609b4070c | ||
| 
						 | 
					1db6355b21 | ||
| 
						 | 
					b628bed1c3 | ||
| 
						 | 
					d81ec738b2 | ||
| 
						 | 
					b2d3f68e87 | ||
| 
						 | 
					ae1a27ae61 | ||
| 
						 | 
					93efe68235 | ||
| 
						 | 
					3da0f0e59d | ||
| 
						 | 
					2b76e9e216 | ||
| 
						 | 
					854e0369df | ||
| 
						 | 
					97834bbed9 | ||
| 
						 | 
					7502860910 | ||
| 
						 | 
					4c6fb3dd37 | ||
| 
						 | 
					1de86fd7fc | ||
| 
						 | 
					d4026a11b1 | ||
| 
						 | 
					c5056e1736 | ||
| 
						 | 
					bb63a367e3 | ||
| 
						 | 
					24279ed40d | ||
| 
						 | 
					e2354a5244 | ||
| 
						 | 
					9ae33412c5 | ||
| 
						 | 
					daeb228bb3 | ||
| 
						 | 
					8911aced89 | ||
| 
						 | 
					1e4fd6f9b5 | ||
| 
						 | 
					60b84e7a31 | ||
| 
						 | 
					0d4e8df3d6 | ||
| 
						 | 
					0eb84ea1b0 | ||
| 
						 | 
					3f4ef02de2 | ||
| 
						 | 
					cb1e08addc | ||
| 
						 | 
					e1f5e8e583 | ||
| 
						 | 
					a270e65e11 | ||
| 
						 | 
					b2b2ea5901 | ||
| 
						 | 
					558c7ade17 | ||
| 
						 | 
					380d8d80ba | ||
| 
						 | 
					1134ad9412 | ||
| 
						 | 
					0b7de19b00 | ||
| 
						 | 
					6f41dcb8a3 | ||
| 
						 | 
					67f0bd0d79 | ||
| 
						 | 
					fe6193c75b | ||
| 
						 | 
					8bb17660d7 | ||
| 
						 | 
					cfb503c6a7 | ||
| 
						 | 
					a4beaa7dc7 | ||
| 
						 | 
					942974c8df | ||
| 
						 | 
					6480d28862 | ||
| 
						 | 
					e9cce1551a | ||
| 
						 | 
					aee92d097a | ||
| 
						 | 
					ecfce7b643 | ||
| 
						 | 
					aada1f902b | ||
| 
						 | 
					008cf36d00 | ||
| 
						 | 
					5d95ba629c | ||
| 
						 | 
					37f7d1e3f0 | ||
| 
						 | 
					d4b10c9036 | ||
| 
						 | 
					a37739a0d9 | ||
| 
						 | 
					53a30e84eb | ||
| 
						 | 
					a8350ac22f | ||
| 
						 | 
					26eba15ec8 | ||
| 
						 | 
					38990b3d2c | ||
| 
						 | 
					c05bc793fe | ||
| 
						 | 
					65d8d50962 | ||
| 
						 | 
					e51b44628a | ||
| 
						 | 
					672df19a39 | ||
| 
						 | 
					d8220c853c | ||
| 
						 | 
					38504cba52 | ||
| 
						 | 
					c45aa02c13 | ||
| 
						 | 
					3e1daa8f94 | ||
| 
						 | 
					1e38d97c40 | ||
| 
						 | 
					e6906d738b | ||
| 
						 | 
					8c1e784711 | ||
| 
						 | 
					02e6c4f9f3 | ||
| 
						 | 
					e7e8d3d4a2 | ||
| 
						 | 
					e4c08a03c8 | ||
| 
						 | 
					3cafe77949 | ||
| 
						 | 
					76f5300793 | ||
| 
						 | 
					d5061be770 | ||
| 
						 | 
					e91c55a99d | ||
| 
						 | 
					ee2918d783 | ||
| 
						 | 
					06352345c1 | ||
| 
						 | 
					03a63f510a | ||
| 
						 | 
					809a32c851 | ||
| 
						 | 
					561838ab6a | ||
| 
						 | 
					c535882053 | ||
| 
						 | 
					1f18490cdd | ||
| 
						 | 
					3a4688c5ba | ||
| 
						 | 
					6088318e55 | ||
| 
						 | 
					0e601bac9b | ||
| 
						 | 
					ac9938f84a | ||
| 
						 | 
					e076d9d41f | ||
| 
						 | 
					109237c04f | ||
| 
						 | 
					4dc5c42b30 | ||
| 
						 | 
					0375e58b2f | ||
| 
						 | 
					f8bb8d5eab | ||
| 
						 | 
					7211dd853e | ||
| 
						 | 
					6342e0c54a | ||
| 
						 | 
					38b6e7dd94 | ||
| 
						 | 
					ebdb3d95b2 | ||
| 
						 | 
					2d035ab9a4 | ||
| 
						 | 
					861ecb091a | ||
| 
						 | 
					7d70ecfe81 | ||
| 
						 | 
					95e2fd1571 | ||
| 
						 | 
					0b482e3f1c | ||
| 
						 | 
					0aaae9f118 | ||
| 
						 | 
					a2be0f0c4a | ||
| 
						 | 
					25ba50fb8f | ||
| 
						 | 
					4469bcc1a2 | ||
| 
						 | 
					13c52205fb | ||
| 
						 | 
					51c1fc4c90 | ||
| 
						 | 
					afb25c2c40 | ||
| 
						 | 
					94755549d7 | ||
| 
						 | 
					fac0ba002f | ||
| 
						 | 
					9fe475f0df | ||
| 
						 | 
					36f56a5e9e | ||
| 
						 | 
					424b3fd4eb | ||
| 
						 | 
					a07938ea7e | ||
| 
						 | 
					da8d720b2a | ||
| 
						 | 
					2fb94832b5 | ||
| 
						 | 
					e11ef6ebe9 | ||
| 
						 | 
					aa3c2d5acb | ||
| 
						 | 
					c6e79104a3 | ||
| 
						 | 
					0fb5b6dcf2 | ||
| 
						 | 
					b051dd6899 | ||
| 
						 | 
					fd757fcf51 | ||
| 
						 | 
					ec42b4f2b1 | ||
| 
						 | 
					77d5bacce8 | ||
| 
						 | 
					603eaab120 | ||
| 
						 | 
					402cef20d8 | ||
| 
						 | 
					d7b1425124 | ||
| 
						 | 
					47b80cf742 | ||
| 
						 | 
					6f9b26b7e3 | ||
| 
						 | 
					5a25b96143 | ||
| 
						 | 
					031b53f451 | ||
| 
						 | 
					12ebb1d7b4 | ||
| 
						 | 
					59a4279fb5 | ||
| 
						 | 
					e1583210e7 | ||
| 
						 | 
					1386fb291b | ||
| 
						 | 
					d9cfa818c4 | ||
| 
						 | 
					0af302cf60 | ||
| 
						 | 
					5b7b71ebc9 | ||
| 
						 | 
					c6323087fc | ||
| 
						 | 
					a98f0bf56d | ||
| 
						 | 
					36fbb43884 | ||
| 
						 | 
					4d1ed8bde0 | ||
| 
						 | 
					05c3bd0de5 | ||
| 
						 | 
					36cacf788f | ||
| 
						 | 
					641ab6d1bc | ||
| 
						 | 
					c364c5efdd | ||
| 
						 | 
					279b842888 | ||
| 
						 | 
					e7648cca42 | ||
| 
						 | 
					449c9c191f | ||
| 
						 | 
					bfae89ea9e | ||
| 
						 | 
					20fe40f872 | ||
| 
						 | 
					8aa9a0e17f | ||
| 
						 | 
					9de1f31bbc | ||
| 
						 | 
					fae968612e | ||
| 
						 | 
					d21d275cc3 | ||
| 
						 | 
					62866c9fda | ||
| 
						 | 
					f6a39fbcc2 | ||
| 
						 | 
					e7e0030d6b | ||
| 
						 | 
					6fcb0a1a43 | ||
| 
						 | 
					ec8919adcf | ||
| 
						 | 
					cbf462c3c7 | ||
| 
						 | 
					e89976c879 | ||
| 
						 | 
					bc79efe36f | ||
| 
						 | 
					b54594651c | ||
| 
						 | 
					e655848772 | ||
| 
						 | 
					0de3815b2a | ||
| 
						 | 
					214df108f8 | ||
| 
						 | 
					e5d6dfc0b9 | ||
| 
						 | 
					6b24a23364 | ||
| 
						 | 
					fc18e3a448 | ||
| 
						 | 
					c7a667391b | ||
| 
						 | 
					98b7b027be | ||
| 
						 | 
					9b23589112 | ||
| 
						 | 
					99cf427def | ||
| 
						 | 
					f16891f03f | ||
| 
						 | 
					b2fb09bd73 | ||
| 
						 | 
					b752fe2fb0 | ||
| 
						 | 
					ad5a410b70 | ||
| 
						 | 
					bc94429e8c | ||
| 
						 | 
					4f6e1f4878 | ||
| 
						 | 
					a5cfea7f28 | ||
| 
						 | 
					aa4d7f8df9 | ||
| 
						 | 
					b5b89d732c | ||
| 
						 | 
					a71ff914c6 | ||
| 
						 | 
					b30db14404 | ||
| 
						 | 
					0d1e7be6ea | ||
| 
						 | 
					4bcedb93cc | ||
| 
						 | 
					0a4881b51f | ||
| 
						 | 
					c96816d287 | ||
| 
						 | 
					ca89b4e76c | ||
| 
						 | 
					cfd6e75c53 | ||
| 
						 | 
					ebfd515ca7 | ||
| 
						 | 
					db4f8886bd | ||
| 
						 | 
					1683b50452 | ||
| 
						 | 
					49be813673 | ||
| 
						 | 
					bb59b231d3 | ||
| 
						 | 
					c8d73b95a0 | ||
| 
						 | 
					dac92a6182 | ||
| 
						 | 
					142165cb92 | ||
| 
						 | 
					3e6f1fe864 | ||
| 
						 | 
					134eb7c8f6 | ||
| 
						 | 
					7633ebabe8 | ||
| 
						 | 
					a2ebf8a0fb | ||
| 
						 | 
					54282f4e4b | ||
| 
						 | 
					f360986593 | ||
| 
						 | 
					7f5e1b4abe | ||
| 
						 | 
					1da1f4e939 | ||
| 
						 | 
					f209b6fe9b | ||
| 
						 | 
					1dea733878 | ||
| 
						 | 
					7b5e3d8fd5 | ||
| 
						 | 
					2c8f7e39f6 | ||
| 
						 | 
					64fa2ed07a | ||
| 
						 | 
					2a3e4e3a38 | ||
| 
						 | 
					8c111c6a6c | ||
| 
						 | 
					f16c918188 | ||
| 
						 | 
					c161ad3074 | ||
| 
						 | 
					fcdf61c4b3 | ||
| 
						 | 
					2e4c3cac8a | ||
| 
						 | 
					a84ea4f014 | ||
| 
						 | 
					e9ee611581 | ||
| 
						 | 
					d83e489d61 | ||
| 
						 | 
					269783fdff | ||
| 
						 | 
					c43ec5a1bc | ||
| 
						 | 
					407350f13d | ||
| 
						 | 
					626a5228e3 | ||
| 
						 | 
					d4b1647374 | ||
| 
						 | 
					151fc69ffc | ||
| 
						 | 
					fcdcbf879a | ||
| 
						 | 
					91096b7368 | ||
| 
						 | 
					034337fb07 | ||
| 
						 | 
					0d352c2e09 | ||
| 
						 | 
					f923e2c1b8 | ||
| 
						 | 
					5c40f5053f | ||
| 
						 | 
					b4c09a0b95 | ||
| 
						 | 
					218672370e | ||
| 
						 | 
					696ef06866 | ||
| 
						 | 
					fa4103cc3b | ||
| 
						 | 
					ef55cff62a | ||
| 
						 | 
					95c0040574 | ||
| 
						 | 
					d46854d378 | ||
| 
						 | 
					622352f2c9 | ||
| 
						 | 
					1a02e1b9c1 | ||
| 
						 | 
					8cb576b993 | ||
| 
						 | 
					ab900f7fad | ||
| 
						 | 
					8192165970 | ||
| 
						 | 
					5e0ea8da27 | ||
| 
						 | 
					a8798960dd | ||
| 
						 | 
					ac5119e455 | ||
| 
						 | 
					c67540d87b | ||
| 
						 | 
					49e844c0e6 | ||
| 
						 | 
					b51560eaa1 | ||
| 
						 | 
					3190fe1c57 | ||
| 
						 | 
					0529a7f84a | ||
| 
						 | 
					c292909f2e | ||
| 
						 | 
					37a6092b27 | ||
| 
						 | 
					f73cbceaf6 | ||
| 
						 | 
					940c220642 | ||
| 
						 | 
					ccc668b5d6 | ||
| 
						 | 
					dd12cba9d0 | ||
| 
						 | 
					6e6a00609d | ||
| 
						 | 
					ee263ee87e | ||
| 
						 | 
					63566eac42 | ||
| 
						 | 
					b64b6ef1f7 | ||
| 
						 | 
					54e190dacb | ||
| 
						 | 
					27b633c817 | ||
| 
						 | 
					4099114189 | ||
| 
						 | 
					2c897a8b8c | ||
| 
						 | 
					2aac61e6ad | ||
| 
						 | 
					1db17b168a | ||
| 
						 | 
					24298e447c | ||
| 
						 | 
					d3a87c1f69 | ||
| 
						 | 
					c72b1b15c4 | ||
| 
						 | 
					09609b0510 | ||
| 
						 | 
					63bd37a91e | ||
| 
						 | 
					760352a196 | ||
| 
						 | 
					1fce77dc68 | ||
| 
						 | 
					bde8fa877f | ||
| 
						 | 
					08aecbb1ed | ||
| 
						 | 
					6f8262c9b4 | ||
| 
						 | 
					f7feba82bc | ||
| 
						 | 
					c0bff2ac09 | ||
| 
						 | 
					8839755956 | ||
| 
						 | 
					2648e9f039 | ||
| 
						 | 
					15e7ec94e1 | ||
| 
						 | 
					b877a5b0f7 | ||
| 
						 | 
					27405fac27 | ||
| 
						 | 
					d2f451ef0c | ||
| 
						 | 
					b4d9cb0418 | ||
| 
						 | 
					c116009930 | ||
| 
						 | 
					99a4cd1de2 | ||
| 
						 | 
					9a26882461 | ||
| 
						 | 
					e167a9a350 | ||
| 
						 | 
					f86140a213 | ||
| 
						 | 
					b4589618c4 | ||
| 
						 | 
					fd1d8cdf10 | ||
| 
						 | 
					7a879ed598 | ||
| 
						 | 
					2764568353 | ||
| 
						 | 
					e8862556fd | ||
| 
						 | 
					1e59a857ae | ||
| 
						 | 
					b705a62dc5 | ||
| 
						 | 
					98ba3160e7 | ||
| 
						 | 
					0345a25e6a | ||
| 
						 | 
					ce930f8e2d | ||
| 
						 | 
					0314e5efc6 | ||
| 
						 | 
					c1d5aad112 | ||
| 
						 | 
					7cae785261 | ||
| 
						 | 
					de670a217d | ||
| 
						 | 
					78104df395 | ||
| 
						 | 
					ba4b234d34 | ||
| 
						 | 
					97b3a1c5a4 | ||
| 
						 | 
					2a14dad0f0 | ||
| 
						 | 
					c614f4d869 | ||
| 
						 | 
					e2ad8bd804 | ||
| 
						 | 
					f06bd477c0 | ||
| 
						 | 
					a0e595febf | ||
| 
						 | 
					2395b09fef | ||
| 
						 | 
					e3bc797a82 | ||
| 
						 | 
					00461229c2 | ||
| 
						 | 
					c9d7d267cd | ||
| 
						 | 
					380d8cfcc4 | ||
| 
						 | 
					fe83f9421b | ||
| 
						 | 
					2b3941fcbf | ||
| 
						 | 
					aad583ff1d | ||
| 
						 | 
					9b1e1fe199 | ||
| 
						 | 
					ca6ae319c7 | ||
| 
						 | 
					5e338e72ba | ||
| 
						 | 
					10fe0e9c67 | ||
| 
						 | 
					f1fade4fa6 | ||
| 
						 | 
					00e45fc396 | ||
| 
						 | 
					0e3f10b86f | ||
| 
						 | 
					d008cda808 | ||
| 
						 | 
					ba70bebc38 | ||
| 
						 | 
					eb6fc20dc8 | ||
| 
						 | 
					db6920d628 | ||
| 
						 | 
					0fcae43d36 | ||
| 
						 | 
					8d808bd9d3 | ||
| 
						 | 
					c0763951ba | ||
| 
						 | 
					e483c1945d | ||
| 
						 | 
					0397dba5a4 | ||
| 
						 | 
					c19212f8d0 | ||
| 
						 | 
					d848cb43b3 | ||
| 
						 | 
					50464af8c2 | ||
| 
						 | 
					7f9c385052 | ||
| 
						 | 
					0840844421 | ||
| 
						 | 
					924be1c3b9 | ||
| 
						 | 
					b2b717e61f | ||
| 
						 | 
					2f6c81bbc5 | ||
| 
						 | 
					490cd4ada5 | ||
| 
						 | 
					ee69978cdc | ||
| 
						 | 
					0a4506d0dd | ||
| 
						 | 
					b7ad6d8c2d | ||
| 
						 | 
					6f665a50e0 | ||
| 
						 | 
					0bc176e6b8 | ||
| 
						 | 
					b9b4ae4c34 | ||
| 
						 | 
					2719e0aa02 | ||
| 
						 | 
					2dc3679b6e | ||
| 
						 | 
					74879cff5b | ||
| 
						 | 
					d58f08a1a9 | ||
| 
						 | 
					2d948fe31e | ||
| 
						 | 
					5efaf11018 | ||
| 
						 | 
					b055431b5c | ||
| 
						 | 
					e3bf4c14dc | ||
| 
						 | 
					d291491eb6 | ||
| 
						 | 
					e098adeaf7 | ||
| 
						 | 
					304e39b8ec | ||
| 
						 | 
					d075508cf0 | ||
| 
						 | 
					bf7f1e75da | ||
| 
						 | 
					72e192fc42 | ||
| 
						 | 
					86a106023b | ||
| 
						 | 
					3a0ec4568d | ||
| 
						 | 
					13d5513465 | ||
| 
						 | 
					b670fe8554 | ||
| 
						 | 
					beff9bb972 | ||
| 
						 | 
					19c52a797b | ||
| 
						 | 
					edbaad38fc | ||
| 
						 | 
					266010c7f2 | ||
| 
						 | 
					9bfab982fd | ||
| 
						 | 
					18dbcd321d | ||
| 
						 | 
					744ec2c02e | ||
| 
						 | 
					c0dce52a12 | ||
| 
						 | 
					cfe7565123 | ||
| 
						 | 
					a6d8e03be5 | ||
| 
						 | 
					5fc4e0d280 | ||
| 
						 | 
					1c4e84f888 | ||
| 
						 | 
					f6d4da1706 | ||
| 
						 | 
					f5bbba29fb | ||
| 
						 | 
					4f44b40d33 | ||
| 
						 | 
					08e0a56f32 | ||
| 
						 | 
					a0b6fe01f4 | ||
| 
						 | 
					a03cf25014 | ||
| 
						 | 
					9acbdbcc6d | ||
| 
						 | 
					06765cc9d1 | ||
| 
						 | 
					2cfee72f8e | ||
| 
						 | 
					8ff712f50f | ||
| 
						 | 
					6a02d8a8d9 | ||
| 
						 | 
					02e4d63d7e | ||
| 
						 | 
					6f4c9d5739 | ||
| 
						 | 
					0bd1631812 | ||
| 
						 | 
					edfe61308b | ||
| 
						 | 
					9d4b0ced46 | ||
| 
						 | 
					9a8533488e | ||
| 
						 | 
					d7812f6634 | ||
| 
						 | 
					2e10d5244e | ||
| 
						 | 
					e295ae92f3 | ||
| 
						 | 
					0ca5e4125e | ||
| 
						 | 
					86f0c7bfcc | ||
| 
						 | 
					30c9cea332 | ||
| 
						 | 
					ea091271c8 | ||
| 
						 | 
					bea37cf37b | ||
| 
						 | 
					b2d320b259 | ||
| 
						 | 
					749b766a8c | ||
| 
						 | 
					6fae615794 | ||
| 
						 | 
					abcbea02c1 | ||
| 
						 | 
					65850c0467 | ||
| 
						 | 
					413b215b6c | ||
| 
						 | 
					30185fdff4 | ||
| 
						 | 
					8cedcec2bc | ||
| 
						 | 
					1cc6f6d3bb | ||
| 
						 | 
					ca0a371996 | ||
| 
						 | 
					b0fd9f9b74 | ||
| 
						 | 
					396f6561a4 | ||
| 
						 | 
					f16619507a | ||
| 
						 | 
					69ac155838 | ||
| 
						 | 
					a6bae85952 | ||
| 
						 | 
					494b9c486e | ||
| 
						 | 
					d8c5d338cb | ||
| 
						 | 
					417438fea0 | ||
| 
						 | 
					5488ffb6d4 | ||
| 
						 | 
					e8725ce940 | ||
| 
						 | 
					0e734920e8 | ||
| 
						 | 
					ad598a2060 | ||
| 
						 | 
					bb47f95262 | ||
| 
						 | 
					a7a2115b9c | ||
| 
						 | 
					18429f2a69 | ||
| 
						 | 
					7e6430787c | ||
| 
						 | 
					dc3ba8c223 | ||
| 
						 | 
					2fd6520a7e | ||
| 
						 | 
					7a61b36104 | ||
| 
						 | 
					2f4783a770 | ||
| 
						 | 
					6056391a78 | ||
| 
						 | 
					213b3575ce | ||
| 
						 | 
					3821e18d08 | ||
| 
						 | 
					224c6e3f7c | ||
| 
						 | 
					18ab6f429c | ||
| 
						 | 
					07f8542ce7 | ||
| 
						 | 
					cf293c224d | ||
| 
						 | 
					e234ad0011 | ||
| 
						 | 
					229b778b0b | ||
| 
						 | 
					66f484defe | ||
| 
						 | 
					ed523e248a | ||
| 
						 | 
					3c49f27bf4 | ||
| 
						 | 
					226d146b25 | ||
| 
						 | 
					1892289329 | ||
| 
						 | 
					5529fc0355 | ||
| 
						 | 
					73ef559240 | ||
| 
						 | 
					b59a63c8cd | ||
| 
						 | 
					c36927137f | ||
| 
						 | 
					649aaad100 | ||
| 
						 | 
					ea4c262482 | ||
| 
						 | 
					89de6c9df6 | ||
| 
						 | 
					4578bc3b0c | ||
| 
						 | 
					8df1e4866a | ||
| 
						 | 
					9f92220a9c | ||
| 
						 | 
					09a9e7bcb7 | ||
| 
						 | 
					a434f8877a | ||
| 
						 | 
					ef891dc0a7 | ||
| 
						 | 
					3ebe29c983 | ||
| 
						 | 
					1028e43464 | ||
| 
						 | 
					4979f66f28 | ||
| 
						 | 
					a5e9fe97c8 | ||
| 
						 | 
					2293cfaf84 | ||
| 
						 | 
					d252dde933 | ||
| 
						 | 
					37a49a5992 | ||
| 
						 | 
					2783801610 | ||
| 
						 | 
					82f19c9a91 | ||
| 
						 | 
					71d9531e45 | ||
| 
						 | 
					3bbeaefa57 | ||
| 
						 | 
					4611be805a | ||
| 
						 | 
					587493fdfc | ||
| 
						 | 
					50079144e3 | ||
| 
						 | 
					2ca80e76a0 | ||
| 
						 | 
					68e6502484 | ||
| 
						 | 
					1e91dfa5df | ||
| 
						 | 
					e4e5f7c65b | ||
| 
						 | 
					8ef66261f1 | ||
| 
						 | 
					90812b536c | ||
| 
						 | 
					2b880d3ef8 | ||
| 
						 | 
					6ab729aeb3 | ||
| 
						 | 
					c9f97f49c5 | ||
| 
						 | 
					8b352fcb94 | ||
| 
						 | 
					5a06af4d57 | ||
| 
						 | 
					2ede900bfd | ||
| 
						 | 
					fb0ffc7784 | ||
| 
						 | 
					e69171dc06 | ||
| 
						 | 
					8452f6b494 | ||
| 
						 | 
					f9bc6f8afc | ||
| 
						 | 
					f9f44d7d9b | ||
| 
						 | 
					86bb1472cc | ||
| 
						 | 
					ef09c506c8 | ||
| 
						 | 
					af7b3b420e | ||
| 
						 | 
					3b80a35a66 | ||
| 
						 | 
					f59b27258c | ||
| 
						 | 
					d38fff38f9 | ||
| 
						 | 
					91c5b12f25 | ||
| 
						 | 
					894bdd5cda | ||
| 
						 | 
					d8c58ca6c8 | ||
| 
						 | 
					43f7956422 | ||
| 
						 | 
					96fcc02900 | ||
| 
						 | 
					2e8b6e7f20 | ||
| 
						 | 
					3ed93398e9 | ||
| 
						 | 
					d84e0caea8 | ||
| 
						 | 
					5c1da58b90 | ||
| 
						 | 
					018c617199 | ||
| 
						 | 
					a49f954f6a | ||
| 
						 | 
					03a8791440 | ||
| 
						 | 
					78ad17381e | ||
| 
						 | 
					5b03803e2f | ||
| 
						 | 
					ee1e461a57 | ||
| 
						 | 
					a543725311 | ||
| 
						 | 
					8c701a0861 | ||
| 
						 | 
					5fbe566524 | ||
| 
						 | 
					e14cf31bc9 | ||
| 
						 | 
					0042c03c7e | ||
| 
						 | 
					41023ecb9c | ||
| 
						 | 
					fb8d0a544d | ||
| 
						 | 
					acaf8c9cc9 | ||
| 
						 | 
					0d3fc8d103 | ||
| 
						 | 
					9bbfbacacc | ||
| 
						 | 
					8e301c629f | ||
| 
						 | 
					9576d8a081 | ||
| 
						 | 
					7db96672bf | ||
| 
						 | 
					0d8f099ca2 | ||
| 
						 | 
					0a4d7e5068 | ||
| 
						 | 
					a32f75b800 | ||
| 
						 | 
					78f37c51ef | ||
| 
						 | 
					d6e5eb75ee | ||
| 
						 | 
					6f433a7e7b | ||
| 
						 | 
					ce2ecb5582 | ||
| 
						 | 
					45c15e8561 | ||
| 
						 | 
					5e3f4186da | ||
| 
						 | 
					d03694df19 | ||
| 
						 | 
					d52e8fa7d2 | ||
| 
						 | 
					77c6cd0bff | ||
| 
						 | 
					463ebe8b4b | ||
| 
						 | 
					a563eab49a | ||
| 
						 | 
					bf9d4b103d | ||
| 
						 | 
					7dc2449f3a | ||
| 
						 | 
					27cc20db11 | ||
| 
						 | 
					4e04f5f731 | ||
| 
						 | 
					5ec3844077 | ||
| 
						 | 
					f641c7cd0d | ||
| 
						 | 
					49aa54cafc | ||
| 
						 | 
					e3b81e66a1 | ||
| 
						 | 
					7bb6b928b5 | ||
| 
						 | 
					ad4dc7c4a9 | ||
| 
						 | 
					feb9764721 | ||
| 
						 | 
					8c74501001 | ||
| 
						 | 
					5861d3fd64 | ||
| 
						 | 
					08acdc6a86 | ||
| 
						 | 
					3b50570c9b | ||
| 
						 | 
					00d7e962a7 | ||
| 
						 | 
					192f7413c2 | ||
| 
						 | 
					5bdb8074aa | ||
| 
						 | 
					6abe5e1b23 | ||
| 
						 | 
					4612b4ccca | ||
| 
						 | 
					3245bf61a1 | ||
| 
						 | 
					9ee13167bb | ||
| 
						 | 
					ca9633ca9b | ||
| 
						 | 
					e04884545c | ||
| 
						 | 
					aa2239a050 | ||
| 
						 | 
					40a1b60cbd | ||
| 
						 | 
					cccb11916f | ||
| 
						 | 
					49641825eb | ||
| 
						 | 
					c14c078405 | ||
| 
						 | 
					f2af073588 | ||
| 
						 | 
					b9a5eddb6d | ||
| 
						 | 
					bffc815375 | ||
| 
						 | 
					5c3f322364 | ||
| 
						 | 
					3a6fae817c | ||
| 
						 | 
					d8f74ecb94 | ||
| 
						 | 
					f7f2b1b033 | ||
| 
						 | 
					601ab7ff82 | 
							
								
								
									
										2
									
								
								.cleancount
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								.cleancount
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -1 +1 @@
 | 
			
		||||
8
 | 
			
		||||
9
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								.cvsignore
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								.cvsignore
									
									
									
									
									
								
							@@ -1,16 +0,0 @@
 | 
			
		||||
asterisk
 | 
			
		||||
defaults.h
 | 
			
		||||
ast_expr2.output
 | 
			
		||||
.version
 | 
			
		||||
.depend
 | 
			
		||||
.applied
 | 
			
		||||
mpg123-0.59r
 | 
			
		||||
mpg123-0.59r.tar.gz
 | 
			
		||||
update.out
 | 
			
		||||
.lastclean
 | 
			
		||||
.cleancount
 | 
			
		||||
.tags-depend
 | 
			
		||||
.tags-sources
 | 
			
		||||
tags
 | 
			
		||||
TAGS
 | 
			
		||||
testexpr2
 | 
			
		||||
							
								
								
									
										1
									
								
								.lastclean
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.lastclean
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
9
 | 
			
		||||
							
								
								
									
										2
									
								
								BUGS
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								BUGS
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -10,7 +10,7 @@ For more information on using the bug tracker, or to
 | 
			
		||||
learn how you can contribute by acting as a bug marshall
 | 
			
		||||
please see:
 | 
			
		||||
 | 
			
		||||
	http://www.digium.com/index.php?menu=bugguidelines
 | 
			
		||||
	http://www.asterisk.org/developers/bug-guidelines
 | 
			
		||||
 | 
			
		||||
If you would like to submit a feature request, please
 | 
			
		||||
resist the temptation to post it to the bug tracker.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								CREDITS
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										12
									
								
								CREDITS
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -13,6 +13,8 @@ Telesthetic - for supporting SIP development
 | 
			
		||||
 | 
			
		||||
Christos Ricudis - for substantial code contributions
 | 
			
		||||
 | 
			
		||||
nic.at - ENUM support in Asterisk
 | 
			
		||||
 | 
			
		||||
Paul Bagyenda, Digital Solutions - for initial Voicetronix driver development
 | 
			
		||||
 | 
			
		||||
=== WISHLIST CONTRIBUTERS ===
 | 
			
		||||
@@ -31,6 +33,14 @@ Jim Dixon - Zapata Telephony and app_rpt
 | 
			
		||||
Russell Bryant - Asterisk 1.0 maintainer and misc. enhancements
 | 
			
		||||
	russelb@clemson.edu
 | 
			
		||||
Anthony Minessale II - Countless big and small fixes, and relentless forward push
 | 
			
		||||
	ChanSpy, ForkCDR, ControlPlayback, While/EndWhile, DumpChan, Dictate,
 | 
			
		||||
	MacroIf, ExecIf, ExecIfTime, RetryDial, MixMonitor applications; res_odbc;
 | 
			
		||||
	many realtime concepts and implementation pieces, including res_config_odbc;
 | 
			
		||||
	format_slin; cdr_custom; several features in Dial including L(), G() and
 | 
			
		||||
	enhancements to M() and D(); several CDR enhancements including CDR variables;
 | 
			
		||||
	attended transfer; one touch record; native MOH; manager eventmask; command
 | 
			
		||||
	line '-t' flag to allow recording/voicemail on nfs shares; #exec command and
 | 
			
		||||
	multiline comments in config files; setvar in iax and sip configs.
 | 
			
		||||
	anthmct@yahoo.com              http://www.asterlink.com
 | 
			
		||||
James Golovich - Innumerable contributions
 | 
			
		||||
	You can find him and asterisk-perl at http://asterisk.gnuinter.net
 | 
			
		||||
@@ -85,7 +95,7 @@ Leif Madsen, Jared Smith and Jim van Meggelen - the Asterisk book
 | 
			
		||||
	available under a Creative Commons License at http://www.asteriskdocs.org
 | 
			
		||||
 | 
			
		||||
=== HOLD MUSIC ===
 | 
			
		||||
Music provided by www.freeplaymusic.com
 | 
			
		||||
Music provided by www.opsound.org
 | 
			
		||||
 | 
			
		||||
=== OTHER SOURCE CODE IN ASTERISK ===
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								LICENSE
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										12
									
								
								LICENSE
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -5,6 +5,18 @@ applies to all loadable Asterisk modules used on your system as well,
 | 
			
		||||
except as defined below. The GPL (version 2) is included in this
 | 
			
		||||
source tree in the file COPYING.
 | 
			
		||||
 | 
			
		||||
This package also includes various components that are not part of
 | 
			
		||||
Asterisk itself; these components are in the 'contrib' directory
 | 
			
		||||
and its subdirectories. Most of these components are also
 | 
			
		||||
distributed under the GPL version 2 as well, except for the following:
 | 
			
		||||
 | 
			
		||||
contrib/firmware/iax/iaxy.bin:
 | 
			
		||||
	This file is Copyright (C) Digium, Inc. and is licensed for
 | 
			
		||||
	use with Digium IAXy hardware devices only. It can be
 | 
			
		||||
	distributed freely as long as the distribution is in the
 | 
			
		||||
	original form present in this package (not reformatted or
 | 
			
		||||
	modified).
 | 
			
		||||
 | 
			
		||||
Digium, Inc. (formerly Linux Support Services) holds copyright
 | 
			
		||||
and/or sufficient licenses to all components of the Asterisk
 | 
			
		||||
package, and therefore can grant, at its sole discretion, the ability
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										217
									
								
								Makefile
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										217
									
								
								Makefile
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -28,6 +28,7 @@ HOST_CC=gcc
 | 
			
		||||
ifeq ($(CROSS_COMPILE),)
 | 
			
		||||
  OSARCH=$(shell uname -s)
 | 
			
		||||
  OSREV=$(shell uname -r)
 | 
			
		||||
  OSCPU=$(shell uname -m)
 | 
			
		||||
else
 | 
			
		||||
  OSARCH=$(CROSS_ARCH)
 | 
			
		||||
  OSREV=$(CROSS_REV)
 | 
			
		||||
@@ -36,6 +37,8 @@ endif
 | 
			
		||||
# Remember the MAKELEVEL at the top
 | 
			
		||||
MAKETOPLEVEL?=$(MAKELEVEL)
 | 
			
		||||
 | 
			
		||||
PWD=$(shell pwd)
 | 
			
		||||
 | 
			
		||||
ifneq ($(findstring dont-optimize,$(MAKECMDGOALS)),dont-optimize)
 | 
			
		||||
######### More GSM codec optimization
 | 
			
		||||
######### Uncomment to enable MMXTM optimizations for x86 architecture CPU's
 | 
			
		||||
@@ -81,6 +84,8 @@ TRACE_FRAMES = #-DTRACE_FRAMES
 | 
			
		||||
#
 | 
			
		||||
MALLOC_DEBUG = #-include $(PWD)/include/asterisk/astmm.h
 | 
			
		||||
 | 
			
		||||
INSTALL=install
 | 
			
		||||
 | 
			
		||||
# Where to install asterisk after compiling
 | 
			
		||||
# Default -> leave empty
 | 
			
		||||
INSTALL_PREFIX?=
 | 
			
		||||
@@ -105,6 +110,9 @@ BUSYDETECT+= #-DBUSYDETECT_TONEONLY
 | 
			
		||||
# Don't use together with -DBUSYDETECT_TONEONLY
 | 
			
		||||
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
 | 
			
		||||
 | 
			
		||||
# Comment this if you want to disable MIDCOM
 | 
			
		||||
MIDCOM = -DMIDCOM
 | 
			
		||||
 | 
			
		||||
ifneq ($(OSARCH),SunOS)
 | 
			
		||||
  ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
 | 
			
		||||
  ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
 | 
			
		||||
@@ -179,7 +187,6 @@ ifeq ($(OSARCH),Linux)
 | 
			
		||||
    # You must have GCC 3.4 to use k8, otherwise use athlon
 | 
			
		||||
    PROC=k8
 | 
			
		||||
    #PROC=athlon
 | 
			
		||||
    OPTIONS+=-m64
 | 
			
		||||
  endif
 | 
			
		||||
 | 
			
		||||
  ifeq ($(PROC),sparc64)
 | 
			
		||||
@@ -200,21 +207,25 @@ ifeq ($(OSARCH),Linux)
 | 
			
		||||
      OPTIONS+=-fsigned-char -mcpu=ep9312
 | 
			
		||||
    else
 | 
			
		||||
      ifeq ($(SUB_PROC),xscale)
 | 
			
		||||
        OPTIONS+=-fsigned-char -msoft-float -mcpu=xscale
 | 
			
		||||
        OPTIONS+=-fsigned-char -mcpu=xscale
 | 
			
		||||
      else
 | 
			
		||||
        OPTIONS+=-fsigned-char -msoft-float 
 | 
			
		||||
        OPTIONS+=-fsigned-char 
 | 
			
		||||
      endif
 | 
			
		||||
    endif
 | 
			
		||||
  endif
 | 
			
		||||
  MPG123TARG=linux
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
PWD=$(shell pwd)
 | 
			
		||||
GREP=grep
 | 
			
		||||
LN=ln
 | 
			
		||||
ID=id
 | 
			
		||||
 | 
			
		||||
ifeq ($(OSARCH),SunOS)
 | 
			
		||||
  GREP=/usr/xpg4/bin/grep
 | 
			
		||||
  M4=/usr/local/bin/m4
 | 
			
		||||
  ID=/usr/xpg4/bin/id
 | 
			
		||||
  LN=/usr/xpg4/bin/ln
 | 
			
		||||
  INSTALL=ginstall
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
INCLUDE+=-Iinclude -I../include
 | 
			
		||||
@@ -281,7 +292,10 @@ endif
 | 
			
		||||
 | 
			
		||||
ifeq ($(OSARCH),SunOS)
 | 
			
		||||
  ASTCFLAGS+=-Wcast-align -DSOLARIS
 | 
			
		||||
  INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
 | 
			
		||||
  INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/opt/ssl/include -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
 | 
			
		||||
  ifeq ($(OSCPU),sun4u)
 | 
			
		||||
    OPTIMIZE+=-mcpu=v9 -mcpu=ultrasparc
 | 
			
		||||
  endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
 | 
			
		||||
@@ -305,30 +319,35 @@ endif # WITHOUT_ZAPTEL
 | 
			
		||||
LIBEDIT=editline/libedit.a
 | 
			
		||||
 | 
			
		||||
ifneq ($(wildcard .version),)
 | 
			
		||||
  ASTERISKVERSION=$(shell cat .version)
 | 
			
		||||
  ASTERISKVERSIONNUM=$(shell awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version)
 | 
			
		||||
  RPMVERSION=$(shell sed 's/[-\/:]/_/g' .version)
 | 
			
		||||
  ASTERISKVERSION:=$(shell cat .version)
 | 
			
		||||
  ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
 | 
			
		||||
  RPMVERSION:=$(shell sed 's/[-\/:]/_/g' .version)
 | 
			
		||||
else
 | 
			
		||||
  RPMVERSION=unknown
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifneq ($(wildcard CVS),)
 | 
			
		||||
# CVS mirrors of SVN have .svnrevision files showing
 | 
			
		||||
# which SVN revision they are based on, and .svnbranch
 | 
			
		||||
# showing the branch they are made from
 | 
			
		||||
ifneq ($(wildcard .svnrevision),)
 | 
			
		||||
  ASTERISKVERSIONNUM=999999
 | 
			
		||||
  ifneq ($(wildcard CVS/Tag),)
 | 
			
		||||
    ASTERISKVERSION=$(shell echo "CVS-`sed 's/^T//g' CVS/Tag`-`date +"%D-%T"`")
 | 
			
		||||
  else
 | 
			
		||||
    ASTERISKVERSION=CVS HEAD
 | 
			
		||||
  endif
 | 
			
		||||
  ASTERISKVERSION:=SVN-$(shell cat .svnbranch)-r$(shell cat .svnrevision)
 | 
			
		||||
else
 | 
			
		||||
  ASTERISKVERSIONNUM=000000
 | 
			
		||||
  ifneq ($(wildcard .svn),)
 | 
			
		||||
    ASTERISKVERSIONNUM=999999
 | 
			
		||||
    ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
 | 
			
		||||
  endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ASTCFLAGS+= $(DEBUG_THREADS)
 | 
			
		||||
ASTCFLAGS+= $(TRACE_FRAMES)
 | 
			
		||||
ASTCFLAGS+= $(MALLOC_DEBUG)
 | 
			
		||||
ASTCFLAGS+= $(BUSYDETECT)
 | 
			
		||||
ASTCFLAGS+= $(MIDCOM)
 | 
			
		||||
ASTCFLAGS+= $(OPTIONS)
 | 
			
		||||
ifneq ($(findstring dont-optimize,$(MAKECMDGOALS)),dont-optimize)
 | 
			
		||||
ASTCFLAGS+= -fomit-frame-pointer 
 | 
			
		||||
endif
 | 
			
		||||
SUBDIRS=res channels pbx apps codecs formats agi cdr funcs utils stdtime
 | 
			
		||||
 | 
			
		||||
OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
 | 
			
		||||
@@ -354,7 +373,11 @@ endif
 | 
			
		||||
ifeq ($(OSARCH),Linux)
 | 
			
		||||
  LIBS+=-ldl -lpthread -lncurses -lm -lresolv  #-lnjamd
 | 
			
		||||
else
 | 
			
		||||
  LIBS+=-lncurses -lm
 | 
			
		||||
  ifeq ($(OSARCH),SunOS)
 | 
			
		||||
    LIBS+=-lm -lcurses
 | 
			
		||||
  else
 | 
			
		||||
    LIBS+=-lncurses -lm
 | 
			
		||||
  endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifeq ($(OSARCH),Darwin)
 | 
			
		||||
@@ -363,7 +386,7 @@ ifeq ($(OSARCH),Darwin)
 | 
			
		||||
  AUDIO_LIBS=-framework CoreAudio
 | 
			
		||||
  ASTLINK=-Wl,-dynamic
 | 
			
		||||
  SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
 | 
			
		||||
  OBJS+=poll.o
 | 
			
		||||
  OBJS+= poll.o
 | 
			
		||||
  ASTCFLAGS+=-DPOLLCOMPAT
 | 
			
		||||
else
 | 
			
		||||
#These are used for all but Darwin
 | 
			
		||||
@@ -384,10 +407,10 @@ ifeq ($(OSARCH),OpenBSD)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifeq ($(OSARCH),SunOS)
 | 
			
		||||
  LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
 | 
			
		||||
  LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/opt/ssl/lib -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
 | 
			
		||||
  OBJS+=strcompat.o
 | 
			
		||||
  ASTLINK=
 | 
			
		||||
  SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
 | 
			
		||||
  SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/opt/ssl/lib -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
 | 
			
		||||
@@ -403,8 +426,6 @@ endif
 | 
			
		||||
 | 
			
		||||
LIBS+=-lssl
 | 
			
		||||
 | 
			
		||||
INSTALL=install
 | 
			
		||||
 | 
			
		||||
_all: all
 | 
			
		||||
	@echo " +--------- Asterisk Build Complete ---------+"  
 | 
			
		||||
	@echo " + Asterisk has successfully been built, but +"  
 | 
			
		||||
@@ -427,10 +448,10 @@ endif
 | 
			
		||||
noclean: depend asterisk subdirs
 | 
			
		||||
 | 
			
		||||
editline/config.h:
 | 
			
		||||
	cd editline && unset CFLAGS LIBS && ./configure ; \
 | 
			
		||||
	cd editline && unset CFLAGS LIBS && CFLAGS="$(OPTIMIZE)" ./configure ; \
 | 
			
		||||
 | 
			
		||||
editline/libedit.a: FORCE
 | 
			
		||||
	cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
 | 
			
		||||
	cd editline && unset CFLAGS LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure
 | 
			
		||||
	$(MAKE) -C editline libedit.a
 | 
			
		||||
 | 
			
		||||
db1-ast/libdb1.a: FORCE
 | 
			
		||||
@@ -534,8 +555,9 @@ clean:
 | 
			
		||||
	$(MAKE) -C stdtime clean
 | 
			
		||||
 | 
			
		||||
datafiles: all
 | 
			
		||||
	if test $$(id -u) = 0; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
 | 
			
		||||
	if [ x`$(ID) -un` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/silence
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
 | 
			
		||||
	for x in sounds/digits/*.gsm; do \
 | 
			
		||||
		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
 | 
			
		||||
@@ -545,6 +567,14 @@ datafiles: all
 | 
			
		||||
			exit 1; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	done
 | 
			
		||||
	for x in sounds/silence/*.gsm; do \
 | 
			
		||||
		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
 | 
			
		||||
			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/silence ; \
 | 
			
		||||
		else \
 | 
			
		||||
			echo "No description for $$x"; \
 | 
			
		||||
			exit 1; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	done
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
 | 
			
		||||
	for x in sounds/dictate/*.gsm; do \
 | 
			
		||||
		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
 | 
			
		||||
@@ -572,7 +602,7 @@ datafiles: all
 | 
			
		||||
			exit 1; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	done
 | 
			
		||||
	for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
 | 
			
		||||
	for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-* sounds/hours* sounds/minute* sounds/second* ; do \
 | 
			
		||||
		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
 | 
			
		||||
			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
 | 
			
		||||
		else \
 | 
			
		||||
@@ -588,17 +618,16 @@ datafiles: all
 | 
			
		||||
	mkdir -p $(DESTDIR)$(AGI_DIR)
 | 
			
		||||
 | 
			
		||||
update: 
 | 
			
		||||
	@if [ -d CVS ]; then \
 | 
			
		||||
		if [ -f patches/.applied ]; then \
 | 
			
		||||
			patches=`cat patches/.applied`; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		if [ ! -z "$$patches" ]; then \
 | 
			
		||||
			for x in $$patches; do \
 | 
			
		||||
				echo "Unapplying $$x..."; \
 | 
			
		||||
				patch -R -p0 < patches/$$x; \
 | 
			
		||||
			done; \
 | 
			
		||||
			rm -f patches/.applied; \
 | 
			
		||||
	@if [ -d .svn ]; then \
 | 
			
		||||
		echo "Updating from Subversion..." ; \
 | 
			
		||||
		svn update | tee update.out; \
 | 
			
		||||
		rm -f .version; \
 | 
			
		||||
		if [ `grep -c ^C update.out` -gt 0 ]; then \
 | 
			
		||||
			echo ; echo "The following files have conflicts:" ; \
 | 
			
		||||
			grep ^C update.out | cut -b4- ; \
 | 
			
		||||
		fi ; \
 | 
			
		||||
		rm -f update.out; \
 | 
			
		||||
	elif [ -d CVS ]; then \
 | 
			
		||||
		echo "Updating from CVS..." ; \
 | 
			
		||||
		cvs -q -z3 update -Pd | tee update.out; \
 | 
			
		||||
		rm -f .version; \
 | 
			
		||||
@@ -607,19 +636,8 @@ update:
 | 
			
		||||
			grep ^C update.out | cut -d' ' -f2- ; \
 | 
			
		||||
		fi ; \
 | 
			
		||||
		rm -f update.out; \
 | 
			
		||||
		if [ ! -z "$$patches" ]; then \
 | 
			
		||||
			for x in $$patches; do \
 | 
			
		||||
				if [ -f patches/$$x ]; then \
 | 
			
		||||
					echo "Applying patch $$x..."; \
 | 
			
		||||
					patch -p0 < patches/$$x; \
 | 
			
		||||
					echo $$x >> patches/.applied; \
 | 
			
		||||
				else \
 | 
			
		||||
					echo "Patch $$x no longer relevant"; \
 | 
			
		||||
				fi; \
 | 
			
		||||
			done; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	else \
 | 
			
		||||
		echo "Not CVS";  \
 | 
			
		||||
		echo "Not under version control";  \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
 | 
			
		||||
@@ -636,23 +654,22 @@ bininstall: all
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
 | 
			
		||||
	if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
 | 
			
		||||
	if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
 | 
			
		||||
	if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
 | 
			
		||||
	ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
 | 
			
		||||
	$(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
 | 
			
		||||
	$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
 | 
			
		||||
	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/	
 | 
			
		||||
	if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
 | 
			
		||||
		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
 | 
			
		||||
		chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
 | 
			
		||||
	fi
 | 
			
		||||
	for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
 | 
			
		||||
	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
 | 
			
		||||
	$(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
 | 
			
		||||
	if [ -n "$(OLDHEADERS)" ]; then \
 | 
			
		||||
		rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
 | 
			
		||||
	fi
 | 
			
		||||
	rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
 | 
			
		||||
	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
 | 
			
		||||
@@ -671,30 +688,10 @@ bininstall: all
 | 
			
		||||
	else \
 | 
			
		||||
		echo "You need to do cvs update -d not just cvs update" ; \
 | 
			
		||||
	fi 
 | 
			
		||||
	( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds  ; ln -s $(ASTSPOOLDIR)/voicemail . )
 | 
			
		||||
	if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
 | 
			
		||||
	@echo " +---- Asterisk Installation Complete -------+"  
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " + Asterisk has successfully been installed. +"  
 | 
			
		||||
	@echo " + If you would like to install the sample   +"  
 | 
			
		||||
	@echo " + configuration files (overwriting any      +"
 | 
			
		||||
	@echo " + existing config files), run:              +"  
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " +               $(MAKE) samples                +"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " +-----------------  or ---------------------+"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " + You can go ahead and install the asterisk +"
 | 
			
		||||
	@echo " + program documentation now or later run:   +"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " +              $(MAKE) progdocs                +"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " + **Note** This requires that you have      +"
 | 
			
		||||
	@echo " + doxygen installed on your local system    +"
 | 
			
		||||
	@echo " +-------------------------------------------+"
 | 
			
		||||
	@$(MAKE) -s oldmodcheck
 | 
			
		||||
 | 
			
		||||
install-subdirs:
 | 
			
		||||
	for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
 | 
			
		||||
 | 
			
		||||
NEWMODS=$(notdir $(wildcard */*.so))
 | 
			
		||||
OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
 | 
			
		||||
@@ -717,10 +714,32 @@ oldmodcheck:
 | 
			
		||||
		echo " WARNING WARNING WARNING" ;\
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
install: all datafiles bininstall
 | 
			
		||||
install: all datafiles bininstall install-subdirs
 | 
			
		||||
	@if [ -x /usr/sbin/asterisk-post-install ]; then \
 | 
			
		||||
		/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
 | 
			
		||||
	fi
 | 
			
		||||
	@echo " +---- Asterisk Installation Complete -------+"  
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " + Asterisk has successfully been installed. +"  
 | 
			
		||||
	@echo " + If you would like to install the sample   +"  
 | 
			
		||||
	@echo " + configuration files (overwriting any      +"
 | 
			
		||||
	@echo " + existing config files), run:              +"  
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " +               $(MAKE) samples                +"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " +-----------------  or ---------------------+"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " + You can go ahead and install the asterisk +"
 | 
			
		||||
	@echo " + program documentation now or later run:   +"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " +              $(MAKE) progdocs                +"
 | 
			
		||||
	@echo " +                                           +"
 | 
			
		||||
	@echo " + **Note** This requires that you have      +"
 | 
			
		||||
	@echo " + doxygen installed on your local system    +"
 | 
			
		||||
	@echo " +-------------------------------------------+"
 | 
			
		||||
	@$(MAKE) -s oldmodcheck
 | 
			
		||||
 | 
			
		||||
upgrade: all bininstall
 | 
			
		||||
 | 
			
		||||
@@ -831,12 +850,12 @@ __rpm: include/asterisk/version.h spec
 | 
			
		||||
	$(MAKE) DESTDIR=/tmp/asterisk install ; \
 | 
			
		||||
	$(MAKE) DESTDIR=/tmp/asterisk samples ; \
 | 
			
		||||
	mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
 | 
			
		||||
	cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
 | 
			
		||||
	cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
 | 
			
		||||
	rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
 | 
			
		||||
 | 
			
		||||
progdocs:
 | 
			
		||||
	(cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT) \
 | 
			
		||||
	PROJECT_NUMBER=$(ASTERISKVERSION)  -  $(ASTERISKVERSIONNUM)") | doxygen - 
 | 
			
		||||
	(cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT)"; \
 | 
			
		||||
	echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen - 
 | 
			
		||||
 | 
			
		||||
mpg123:
 | 
			
		||||
	@wget -V >/dev/null || (echo "You need wget" ; false )
 | 
			
		||||
@@ -906,47 +925,3 @@ cleantest:
 | 
			
		||||
	if cmp -s .cleancount .lastclean ; then echo ; else \
 | 
			
		||||
		$(MAKE) clean; cp -f .cleancount .lastclean;\
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
patchlist:
 | 
			
		||||
	@echo "Experimental Patches:"
 | 
			
		||||
	@for x in patches/*; do \
 | 
			
		||||
		patch=`basename $$x`; \
 | 
			
		||||
		if [ "$$patch" = "CVS" ]; then \
 | 
			
		||||
			continue; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		if grep -q ^$$patch$$ patches/.applied; then \
 | 
			
		||||
			echo "$$patch (applied)"; \
 | 
			
		||||
		else \
 | 
			
		||||
			echo "$$patch (available)"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
apply: 
 | 
			
		||||
	@if [ -z "$(PATCH)" ]; then \
 | 
			
		||||
		echo "Usage: make PATCH=<patchname> apply"; \
 | 
			
		||||
	elif grep -q ^$(PATCH)$$ patches/.applied 2>/dev/null; then \
 | 
			
		||||
		echo "Patch $(PATCH) is already applied"; \
 | 
			
		||||
	elif [ -f "patches/$(PATCH)" ]; then \
 | 
			
		||||
		echo "Applying patch $(PATCH)"; \
 | 
			
		||||
		patch -p0 < patches/$(PATCH); \
 | 
			
		||||
		echo "$(PATCH)" >> patches/.applied; \
 | 
			
		||||
	else \
 | 
			
		||||
		echo "No such patch $(PATCH) in patches directory"; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
unapply: 
 | 
			
		||||
	@if [ -z "$(PATCH)" ]; then \
 | 
			
		||||
		echo "Usage: make PATCH=<patchname> unapply"; \
 | 
			
		||||
	elif grep -v -q ^$(PATCH)$$ patches/.applied 2>/dev/null; then \
 | 
			
		||||
		echo "Patch $(PATCH) is not applied"; \
 | 
			
		||||
	elif [ -f "patches/$(PATCH)" ]; then \
 | 
			
		||||
		echo "Un-applying patch $(PATCH)"; \
 | 
			
		||||
		patch -p0 -R < patches/$(PATCH); \
 | 
			
		||||
		rm -f patches/.tmpapplied || :; \
 | 
			
		||||
		mv patches/.applied patches/.tmpapplied; \
 | 
			
		||||
		cat patches/.tmpapplied | grep -v ^$(PATCH)$$ > patches/.applied; \
 | 
			
		||||
		rm -f patches/.tmpapplied; \
 | 
			
		||||
	else \
 | 
			
		||||
		echo "No such patch $(PATCH) in patches directory"; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								README
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										10
									
								
								README
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -67,7 +67,7 @@ made every effort possible to maintain backwards compatibility.
 | 
			
		||||
  In order to discover new features to use, please check the configuration
 | 
			
		||||
examples in the /configs directory of the source code distribution. 
 | 
			
		||||
To discover the major new features of Asterisk 1.2, please visit 
 | 
			
		||||
http://www.astricon.net/asterisk1-2/
 | 
			
		||||
http://edvina.net/asterisk1-2/
 | 
			
		||||
 | 
			
		||||
* NEW INSTALLATIONS
 | 
			
		||||
 | 
			
		||||
@@ -164,6 +164,14 @@ parameters.  For example, the line "channel => 25-47" creates objects for
 | 
			
		||||
the channels 25 through 47 of the card, obtaining the settings
 | 
			
		||||
from the variables specified above.
 | 
			
		||||
 | 
			
		||||
* NETWORK SECURITY DEVICES
 | 
			
		||||
 | 
			
		||||
This release of Asterisk contains support for network security devices
 | 
			
		||||
manufactured by Ranch Networks, Inc., using their MIDCOM interface
 | 
			
		||||
library. You will need the companion libmidcom-0.1.0.tar.gz file to
 | 
			
		||||
build the library. Contact Ranch Networks' support department for assistance
 | 
			
		||||
in building and configuring MIDCOM support.
 | 
			
		||||
 | 
			
		||||
* SPECIAL NOTE ON TIME
 | 
			
		||||
  
 | 
			
		||||
  Those using SIP phones should be aware that Asterisk is sensitive to
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +0,0 @@
 | 
			
		||||
About Hold Music
 | 
			
		||||
================
 | 
			
		||||
Digium has licensed the music included with
 | 
			
		||||
the Asterisk distribution From FreePlayMusic
 | 
			
		||||
for use and distribution with Asterisk.  It
 | 
			
		||||
is licensed ONLY for use as hold music within
 | 
			
		||||
an Asterisk based PBX.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										22
									
								
								README.opsound
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								README.opsound
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
About Hold Music
 | 
			
		||||
================
 | 
			
		||||
These files were obtained from http://opsound.org, where the authors placed them
 | 
			
		||||
under the Creative Commons Attribution-Share Alike 2.5 license, a copy of which
 | 
			
		||||
may be found at http://creativecommons.org.
 | 
			
		||||
 | 
			
		||||
Credits
 | 
			
		||||
================
 | 
			
		||||
macroform-cold_day - Paul Shuler (Macroform)
 | 
			
		||||
paulshuler@gmail.com - http://macroform.bandcamp.com/
 | 
			
		||||
 | 
			
		||||
macroform-robot_dity - Paul Shuler (Macroform)
 | 
			
		||||
paulshuler@gmail.com - http://macroform.bandcamp.com/
 | 
			
		||||
 | 
			
		||||
macroform-the_simplicity - Paul Shuler (Macroform)
 | 
			
		||||
paulshuler@gmail.com - http://macroform.bandcamp.com/
 | 
			
		||||
 | 
			
		||||
manolo_camp-morning_coffee - Manolo Camp
 | 
			
		||||
beatbastard@gmx.net - http://ccmixter.org/people/ManoloCamp
 | 
			
		||||
 | 
			
		||||
reno_project-system - Reno Project
 | 
			
		||||
renoproject@hotmail.com - http://www.jamendo.com/en/album/23661
 | 
			
		||||
							
								
								
									
										6
									
								
								SECURITY
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										6
									
								
								SECURITY
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -65,3 +65,9 @@ exten => 6123,Dial(Zap/1)
 | 
			
		||||
DON'T FORGET TO TAKE THE DEMO CONTEXT OUT OF YOUR DEFAULT CONTEXT.  There
 | 
			
		||||
isn't really a security reason, it just will keep people from wanting to 
 | 
			
		||||
play with your Asterisk setup remotely.
 | 
			
		||||
 | 
			
		||||
* LOG SECURITY
 | 
			
		||||
 | 
			
		||||
Please note that the Asterisk log files, as well as information printed to the
 | 
			
		||||
Asterisk CLI, may contain sensitive information such as passwords and call 
 | 
			
		||||
history.  Keep this in mind when providing access to these resources.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								UPGRADE.txt
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										11
									
								
								UPGRADE.txt
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -52,8 +52,10 @@ Dialing:
 | 
			
		||||
 | 
			
		||||
IAX: 
 | 
			
		||||
 | 
			
		||||
* The naming convention for IAX channels has changed in a minor way such 
 | 
			
		||||
  that the call number follows a "-" rather than a "/" character.
 | 
			
		||||
* The naming convention for IAX channels has changed in two ways: 
 | 
			
		||||
   1. The call number follows a "-" rather than a "/" character.
 | 
			
		||||
   2. The name of the channel has been simplified to IAX2/peer-callno,
 | 
			
		||||
   rather than IAX2/peer@peer-callno or even IAX2/peer@peer/callno.
 | 
			
		||||
 | 
			
		||||
SIP:
 | 
			
		||||
 | 
			
		||||
@@ -129,6 +131,11 @@ Applications:
 | 
			
		||||
  'mailbox options' menu, and 'change your password' option has been
 | 
			
		||||
  moved to option 5.
 | 
			
		||||
 | 
			
		||||
* The application VoiceMailMain now only matches the 'default' context if
 | 
			
		||||
  none is specified in the arguments.  (This was the previously 
 | 
			
		||||
  documented behavior, however, we didn't follow that behavior.)  The old
 | 
			
		||||
  behavior can be restored by setting searchcontexts=yes in voicemail.conf.
 | 
			
		||||
 | 
			
		||||
Queues:
 | 
			
		||||
 | 
			
		||||
* A queue is now considered empty not only if there are no members but if
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								acl.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										4
									
								
								acl.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -176,12 +176,12 @@ struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path)
 | 
			
		||||
		} else if (!inet_aton(nm, &ha->netmask)) {
 | 
			
		||||
			ast_log(LOG_WARNING, "%s is not a valid netmask\n", nm);
 | 
			
		||||
			free(ha);
 | 
			
		||||
			return path;
 | 
			
		||||
			return ret;
 | 
			
		||||
		}
 | 
			
		||||
		if (!inet_aton(tmp, &ha->netaddr)) {
 | 
			
		||||
			ast_log(LOG_WARNING, "%s is not a valid IP\n", tmp);
 | 
			
		||||
			free(ha);
 | 
			
		||||
			return path;
 | 
			
		||||
			return ret;
 | 
			
		||||
		}
 | 
			
		||||
		ha->netaddr.s_addr &= ha->netmask.s_addr;
 | 
			
		||||
		if (!strncasecmp(sense, "p", 1)) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								aescrypt.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								aescrypt.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -1,3 +0,0 @@
 | 
			
		||||
eagi-test
 | 
			
		||||
eagi-sphinx-test
 | 
			
		||||
.depend
 | 
			
		||||
							
								
								
									
										0
									
								
								agi/DialAnMp3.agi
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								agi/DialAnMp3.agi
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										2
									
								
								agi/Makefile
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								agi/Makefile
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -13,7 +13,7 @@
 | 
			
		||||
 | 
			
		||||
AGIS=agi-test.agi eagi-test eagi-sphinx-test
 | 
			
		||||
 | 
			
		||||
CFLAGS+=
 | 
			
		||||
CFLAGS+=-DNO_AST_MM
 | 
			
		||||
 | 
			
		||||
LIBS=
 | 
			
		||||
ifeq ($(OSARCH),SunOS)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								agi/agi-test.agi
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								agi/agi-test.agi
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								agi/eagi-sphinx-test.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								agi/eagi-sphinx-test.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								agi/eagi-test.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								agi/eagi-test.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								agi/fastagi-test
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								agi/fastagi-test
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								agi/numeralize
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								agi/numeralize
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										128
									
								
								app.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										128
									
								
								app.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -84,14 +84,11 @@ int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect,
 | 
			
		||||
			ast_playtones_stop(chan);
 | 
			
		||||
		if (res < 1)
 | 
			
		||||
			break;
 | 
			
		||||
		collect[x++] = res;
 | 
			
		||||
		if (!ast_matchmore_extension(chan, context, collect, 1, chan->cid.cid_num)) {
 | 
			
		||||
			if (collect[x-1] == '#') {
 | 
			
		||||
				/* Not a valid extension, ending in #, assume the # was to finish dialing */
 | 
			
		||||
				collect[x-1] = '\0';
 | 
			
		||||
			}
 | 
			
		||||
		if (res == '#')
 | 
			
		||||
			break;
 | 
			
		||||
		collect[x++] = res;
 | 
			
		||||
		if (!ast_matchmore_extension(chan, context, collect, 1, chan->cid.cid_num))
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if (res >= 0) {
 | 
			
		||||
		if (ast_exists_extension(chan, context, collect, 1, chan->cid.cid_num))
 | 
			
		||||
@@ -316,8 +313,12 @@ int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digi
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if (peer)
 | 
			
		||||
			res = ast_autoservice_stop(peer);
 | 
			
		||||
		if (peer) {
 | 
			
		||||
			/* Stop autoservice on the peer channel, but don't overwrite any error condition 
 | 
			
		||||
			   that has occurred previously while acting on the primary channel */	
 | 
			
		||||
			if (ast_autoservice_stop(peer) && !res)
 | 
			
		||||
				res = -1;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
@@ -430,11 +431,11 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file,
 | 
			
		||||
			   const char *stop, const char *pause,
 | 
			
		||||
			   const char *restart, int skipms) 
 | 
			
		||||
{
 | 
			
		||||
	long elapsed = 0, last_elapsed = 0;
 | 
			
		||||
	char *breaks = NULL;
 | 
			
		||||
	char *end = NULL;
 | 
			
		||||
	int blen = 2;
 | 
			
		||||
	int res;
 | 
			
		||||
	long pause_restart_point = 0;
 | 
			
		||||
 | 
			
		||||
	if (stop)
 | 
			
		||||
		blen += strlen(stop);
 | 
			
		||||
@@ -456,9 +457,6 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file,
 | 
			
		||||
	if (chan->_state != AST_STATE_UP)
 | 
			
		||||
		res = ast_answer(chan);
 | 
			
		||||
 | 
			
		||||
	if (chan)
 | 
			
		||||
		ast_stopstream(chan);
 | 
			
		||||
 | 
			
		||||
	if (file) {
 | 
			
		||||
		if ((end = strchr(file,':'))) {
 | 
			
		||||
			if (!strcasecmp(end, ":end")) {
 | 
			
		||||
@@ -469,25 +467,18 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (;;) {
 | 
			
		||||
		struct timeval started = ast_tvnow();
 | 
			
		||||
 | 
			
		||||
		if (chan)
 | 
			
		||||
			ast_stopstream(chan);
 | 
			
		||||
		ast_stopstream(chan);
 | 
			
		||||
		res = ast_streamfile(chan, file, chan->language);
 | 
			
		||||
		if (!res) {
 | 
			
		||||
			if (end) {
 | 
			
		||||
			if (pause_restart_point) {
 | 
			
		||||
				ast_seekstream(chan->stream, pause_restart_point, SEEK_SET);
 | 
			
		||||
				pause_restart_point = 0;
 | 
			
		||||
			}
 | 
			
		||||
			else if (end) {
 | 
			
		||||
				ast_seekstream(chan->stream, 0, SEEK_END);
 | 
			
		||||
				end=NULL;
 | 
			
		||||
			}
 | 
			
		||||
			res = 1;
 | 
			
		||||
			if (elapsed) {
 | 
			
		||||
				ast_stream_fastforward(chan->stream, elapsed);
 | 
			
		||||
				last_elapsed = elapsed - 200;
 | 
			
		||||
			}
 | 
			
		||||
			if (res)
 | 
			
		||||
				res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms);
 | 
			
		||||
			else
 | 
			
		||||
				break;
 | 
			
		||||
				end = NULL;
 | 
			
		||||
			};
 | 
			
		||||
			res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (res < 1)
 | 
			
		||||
@@ -496,17 +487,16 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file,
 | 
			
		||||
		/* We go at next loop if we got the restart char */
 | 
			
		||||
		if (restart && strchr(restart, res)) {
 | 
			
		||||
			ast_log(LOG_DEBUG, "we'll restart the stream here at next loop\n");
 | 
			
		||||
			elapsed=0; /* To make sure the next stream will start at beginning */
 | 
			
		||||
			pause_restart_point = 0;
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (pause != NULL && strchr(pause, res)) {
 | 
			
		||||
			elapsed = ast_tvdiff_ms(ast_tvnow(), started) + last_elapsed;
 | 
			
		||||
			for(;;) {
 | 
			
		||||
				if (chan)
 | 
			
		||||
					ast_stopstream(chan);
 | 
			
		||||
		if (pause && strchr(pause, res)) {
 | 
			
		||||
			pause_restart_point = ast_tellstream(chan->stream);
 | 
			
		||||
			for (;;) {
 | 
			
		||||
				ast_stopstream(chan);
 | 
			
		||||
				res = ast_waitfordigit(chan, 1000);
 | 
			
		||||
				if (res == 0)
 | 
			
		||||
				if (!res)
 | 
			
		||||
					continue;
 | 
			
		||||
				else if (res == -1 || strchr(pause, res) || (stop && strchr(stop, res)))
 | 
			
		||||
					break;
 | 
			
		||||
@@ -516,17 +506,16 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file,
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (res == -1)
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
		/* if we get one of our stop chars, return it to the calling function */
 | 
			
		||||
		if (stop && strchr(stop, res)) {
 | 
			
		||||
			/* res = 0; */
 | 
			
		||||
		if (stop && strchr(stop, res))
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if (chan)
 | 
			
		||||
		ast_stopstream(chan);
 | 
			
		||||
 | 
			
		||||
	ast_stopstream(chan);
 | 
			
		||||
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
@@ -545,7 +534,7 @@ int ast_play_and_wait(struct ast_channel *chan, const char *fn)
 | 
			
		||||
static int global_silence_threshold = 128;
 | 
			
		||||
static int global_maxsilence = 0;
 | 
			
		||||
 | 
			
		||||
int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path)
 | 
			
		||||
int ast_play_and_record_full(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path, const char *acceptdtmf, const char *canceldtmf)
 | 
			
		||||
{
 | 
			
		||||
	int d;
 | 
			
		||||
	char *fmts;
 | 
			
		||||
@@ -559,7 +548,6 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
 | 
			
		||||
	struct ast_dsp *sildet=NULL;   	/* silence detector dsp */
 | 
			
		||||
	int totalsilence = 0;
 | 
			
		||||
	int dspsilence = 0;
 | 
			
		||||
	int gotsilence = 0;		/* did we timeout for silence? */
 | 
			
		||||
	int rfmt=0;
 | 
			
		||||
	struct ast_silence_generator *silgen = NULL;
 | 
			
		||||
 | 
			
		||||
@@ -597,7 +585,7 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
 | 
			
		||||
 | 
			
		||||
	while((fmt = strsep(&stringp, "|"))) {
 | 
			
		||||
		if (fmtcnt > MAX_OTHER_FORMATS - 1) {
 | 
			
		||||
			ast_log(LOG_WARNING, "Please increase MAX_OTHER_FORMATS in app_voicemail.c\n");
 | 
			
		||||
			ast_log(LOG_WARNING, "Please increase MAX_OTHER_FORMATS in app.c\n");
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		sfmt[fmtcnt++] = ast_strdupa(fmt);
 | 
			
		||||
@@ -682,7 +670,7 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
 | 
			
		||||
						if (option_verbose > 2)
 | 
			
		||||
							ast_verbose( VERBOSE_PREFIX_3 "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
 | 
			
		||||
						ast_frfree(f);
 | 
			
		||||
						gotsilence = 1;
 | 
			
		||||
						res = 'S';
 | 
			
		||||
						outmsg=2;
 | 
			
		||||
						break;
 | 
			
		||||
					}
 | 
			
		||||
@@ -697,19 +685,18 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
 | 
			
		||||
				/* Write only once */
 | 
			
		||||
				ast_writestream(others[0], f);
 | 
			
		||||
			} else if (f->frametype == AST_FRAME_DTMF) {
 | 
			
		||||
				if (f->subclass == '#') {
 | 
			
		||||
				if (strchr(acceptdtmf, f->subclass)) {
 | 
			
		||||
					if (option_verbose > 2)
 | 
			
		||||
						ast_verbose( VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
 | 
			
		||||
					res = '#';
 | 
			
		||||
						ast_verbose(VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
 | 
			
		||||
					res = f->subclass;
 | 
			
		||||
					outmsg = 2;
 | 
			
		||||
					ast_frfree(f);
 | 
			
		||||
					break;
 | 
			
		||||
				}
 | 
			
		||||
				if (f->subclass == '0') {
 | 
			
		||||
				/* Check for a '0' during message recording also, in case caller wants operator */
 | 
			
		||||
				if (strchr(canceldtmf, f->subclass)) {
 | 
			
		||||
					if (option_verbose > 2)
 | 
			
		||||
						ast_verbose(VERBOSE_PREFIX_3 "User cancelled by pressing %c\n", f->subclass);
 | 
			
		||||
					res = '0';
 | 
			
		||||
						ast_verbose(VERBOSE_PREFIX_3 "User cancelled message by pressing %c\n", f->subclass);
 | 
			
		||||
					res = f->subclass;
 | 
			
		||||
					outmsg = 0;
 | 
			
		||||
					ast_frfree(f);
 | 
			
		||||
					break;
 | 
			
		||||
@@ -771,6 +758,14 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char default_acceptdtmf[] = "#";
 | 
			
		||||
static char default_canceldtmf[] = "0";
 | 
			
		||||
 | 
			
		||||
int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path)
 | 
			
		||||
{
 | 
			
		||||
	return ast_play_and_record_full(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence, path, default_acceptdtmf, default_canceldtmf);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, char *fmt, int *duration, int beep, int silencethreshold, int maxsilence)
 | 
			
		||||
{
 | 
			
		||||
	int d = 0;
 | 
			
		||||
@@ -786,7 +781,6 @@ int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordf
 | 
			
		||||
	struct ast_dsp *sildet;   	/* silence detector dsp */
 | 
			
		||||
	int totalsilence = 0;
 | 
			
		||||
	int dspsilence = 0;
 | 
			
		||||
	int gotsilence = 0;		/* did we timeout for silence? */
 | 
			
		||||
	int rfmt=0;	
 | 
			
		||||
	char prependfile[80];
 | 
			
		||||
	
 | 
			
		||||
@@ -827,7 +821,7 @@ int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordf
 | 
			
		||||
	
 | 
			
		||||
	while((fmt = strsep(&stringp, "|"))) {
 | 
			
		||||
		if (fmtcnt > MAX_OTHER_FORMATS - 1) {
 | 
			
		||||
			ast_log(LOG_WARNING, "Please increase MAX_OTHER_FORMATS in app_voicemail.c\n");
 | 
			
		||||
			ast_log(LOG_WARNING, "Please increase MAX_OTHER_FORMATS in app.c\n");
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		sfmt[fmtcnt++] = ast_strdupa(fmt);
 | 
			
		||||
@@ -855,6 +849,7 @@ int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordf
 | 
			
		||||
		res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
 | 
			
		||||
		if (res < 0) {
 | 
			
		||||
			ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n");
 | 
			
		||||
			ast_dsp_free(sildet);
 | 
			
		||||
			return -1;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -904,7 +899,7 @@ int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordf
 | 
			
		||||
					if (option_verbose > 2) 
 | 
			
		||||
						ast_verbose( VERBOSE_PREFIX_3 "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
 | 
			
		||||
					ast_frfree(f);
 | 
			
		||||
					gotsilence = 1;
 | 
			
		||||
					res = 'S';
 | 
			
		||||
					outmsg=2;
 | 
			
		||||
					break;
 | 
			
		||||
					}
 | 
			
		||||
@@ -959,6 +954,7 @@ int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordf
 | 
			
		||||
	} else {
 | 
			
		||||
		ast_log(LOG_WARNING, "Error creating writestream '%s', format '%s'\n", prependfile, sfmt[x]); 
 | 
			
		||||
	}
 | 
			
		||||
	ast_dsp_free(sildet);
 | 
			
		||||
	*duration = end - start;
 | 
			
		||||
#if 0
 | 
			
		||||
	if (outmsg > 1) {
 | 
			
		||||
@@ -1159,7 +1155,7 @@ enum AST_LOCK_RESULT ast_lock_path(const char *path)
 | 
			
		||||
	snprintf(fs, strlen(path) + 19, "%s/.lock-%08x", path, rand());
 | 
			
		||||
	fd = open(fs, O_WRONLY | O_CREAT | O_EXCL, 0600);
 | 
			
		||||
	if (fd < 0) {
 | 
			
		||||
		fprintf(stderr, "Unable to create lock file '%s': %s\n", path, strerror(errno));
 | 
			
		||||
		ast_log(LOG_ERROR, "Unable to create lock file '%s': %s\n", path, strerror(errno));
 | 
			
		||||
		return AST_LOCK_PATH_NOT_FOUND;
 | 
			
		||||
	}
 | 
			
		||||
	close(fd);
 | 
			
		||||
@@ -1168,11 +1164,13 @@ enum AST_LOCK_RESULT ast_lock_path(const char *path)
 | 
			
		||||
	time(&start);
 | 
			
		||||
	while (((res = link(fs, s)) < 0) && (errno == EEXIST) && (time(NULL) - start < 5))
 | 
			
		||||
		usleep(1);
 | 
			
		||||
 | 
			
		||||
	unlink(fs);
 | 
			
		||||
 | 
			
		||||
	if (res) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Failed to lock path '%s': %s\n", path, strerror(errno));
 | 
			
		||||
		return AST_LOCK_TIMEOUT;
 | 
			
		||||
	} else {
 | 
			
		||||
		unlink(fs);
 | 
			
		||||
		ast_log(LOG_DEBUG, "Locked path '%s'\n", path);
 | 
			
		||||
		return AST_LOCK_SUCCESS;
 | 
			
		||||
	}
 | 
			
		||||
@@ -1181,12 +1179,22 @@ enum AST_LOCK_RESULT ast_lock_path(const char *path)
 | 
			
		||||
int ast_unlock_path(const char *path)
 | 
			
		||||
{
 | 
			
		||||
	char *s;
 | 
			
		||||
	int res;
 | 
			
		||||
 | 
			
		||||
	s = alloca(strlen(path) + 10);
 | 
			
		||||
	if (!s)
 | 
			
		||||
	if (!s) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Out of memory!\n");
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	snprintf(s, strlen(path) + 9, "%s/%s", path, ".lock");
 | 
			
		||||
	ast_log(LOG_DEBUG, "Unlocked path '%s'\n", path);
 | 
			
		||||
	return unlink(s);
 | 
			
		||||
 | 
			
		||||
	if ((res = unlink(s)))
 | 
			
		||||
		ast_log(LOG_ERROR, "Could not unlock path '%s': %s\n", path, strerror(errno));
 | 
			
		||||
	else
 | 
			
		||||
		ast_log(LOG_DEBUG, "Unlocked path '%s'\n", path);
 | 
			
		||||
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ast_record_review(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, const char *path) 
 | 
			
		||||
 
 | 
			
		||||
@@ -1 +0,0 @@
 | 
			
		||||
.depend
 | 
			
		||||
							
								
								
									
										7
									
								
								apps/Makefile
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										7
									
								
								apps/Makefile
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -86,7 +86,7 @@ endif
 | 
			
		||||
all: $(APPS)
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f *.so *.o look .depend
 | 
			
		||||
	rm -f *.so *.o .depend
 | 
			
		||||
 | 
			
		||||
%.so : %.o
 | 
			
		||||
	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
 | 
			
		||||
@@ -103,7 +103,7 @@ app_curl.so: app_curl.o
 | 
			
		||||
	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
 | 
			
		||||
 | 
			
		||||
app_sql_postgres.o: app_sql_postgres.c
 | 
			
		||||
	$(CC) -pipe -I/usr/local/pgsql/include $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
 | 
			
		||||
	$(CC) -pipe -I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include -I$(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
 | 
			
		||||
 | 
			
		||||
app_sql_postgres.so: app_sql_postgres.o
 | 
			
		||||
	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
 | 
			
		||||
@@ -111,9 +111,6 @@ app_sql_postgres.so: app_sql_postgres.o
 | 
			
		||||
app_sql_odbc.so: app_sql_odbc.o
 | 
			
		||||
	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
 | 
			
		||||
 | 
			
		||||
look:	look.c
 | 
			
		||||
	$(CC) -pipe -O6 -g look.c -o look -lncurses
 | 
			
		||||
 | 
			
		||||
ifeq (SunOS,$(shell uname))
 | 
			
		||||
app_chanspy.so: app_chanspy.o
 | 
			
		||||
	$(CC) $(SOLINK) -o $@ $< -lrt
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_adsiprog.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_adsiprog.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										7
									
								
								apps/app_alarmreceiver.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										7
									
								
								apps/app_alarmreceiver.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -145,7 +145,7 @@ static void database_increment( char *key )
 | 
			
		||||
	res = ast_db_put(db_family, key, value);
 | 
			
		||||
	
 | 
			
		||||
	if((res)&&(option_verbose >= 4))
 | 
			
		||||
		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: database_increment write error");
 | 
			
		||||
		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: database_increment write error\n");
 | 
			
		||||
	
 | 
			
		||||
	return;	
 | 
			
		||||
}
 | 
			
		||||
@@ -215,6 +215,7 @@ static int send_tone_burst(struct ast_channel *chan, float freq, int duration, i
 | 
			
		||||
 | 
			
		||||
			i += wf.datalen / 8;
 | 
			
		||||
			if (i > duration) {
 | 
			
		||||
				ast_frfree(f);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			if (ast_write(chan, &wf)){
 | 
			
		||||
@@ -222,6 +223,7 @@ static int send_tone_burst(struct ast_channel *chan, float freq, int duration, i
 | 
			
		||||
					ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Failed to write frame on %s\n", chan->name);
 | 
			
		||||
				ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name);
 | 
			
		||||
				res = -1;
 | 
			
		||||
				ast_frfree(f);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -558,11 +560,10 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int
 | 
			
		||||
 | 
			
		||||
		if(checksum){
 | 
			
		||||
			database_increment("checksum-errors");
 | 
			
		||||
			if(option_verbose >= 2){
 | 
			
		||||
			if(option_verbose >= 2)
 | 
			
		||||
				ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Nonzero checksum\n");
 | 
			
		||||
			ast_log(LOG_DEBUG, "AlarmReceiver: Nonzero checksum\n");
 | 
			
		||||
			continue;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* Check the message type for correctness */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								apps/app_authenticate.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								apps/app_authenticate.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -186,7 +186,7 @@ static int auth_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		if (!res)
 | 
			
		||||
			res = ast_waitstream(chan, "");
 | 
			
		||||
	} else {
 | 
			
		||||
		if (jump && ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
 | 
			
		||||
		if (jump && ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101) == 0) {
 | 
			
		||||
			res = 0;
 | 
			
		||||
		} else {
 | 
			
		||||
			if (!ast_streamfile(chan, "vm-goodbye", chan->language))
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_cdr.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_cdr.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_chanisavail.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_chanisavail.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										203
									
								
								apps/app_chanspy.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										203
									
								
								apps/app_chanspy.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -3,7 +3,8 @@
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2005 Anthony Minessale II (anthmct@yahoo.com)
 | 
			
		||||
 *
 | 
			
		||||
 * Disclaimed to Digium
 | 
			
		||||
 * A license has been granted to Digium (via disclaimer) for the use of
 | 
			
		||||
 * this code.
 | 
			
		||||
 *
 | 
			
		||||
 * See http://www.asterisk.org for more information about
 | 
			
		||||
 * the Asterisk project. Please do not directly contact
 | 
			
		||||
@@ -52,7 +53,7 @@ AST_MUTEX_DEFINE_STATIC(modlock);
 | 
			
		||||
#define ALL_DONE(u, ret) LOCAL_USER_REMOVE(u); return ret;
 | 
			
		||||
#define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0
 | 
			
		||||
 | 
			
		||||
static const char *synopsis = "Listen to the audio of an active channel\n";
 | 
			
		||||
static const char *synopsis = "Listen to the audio of an active channel";
 | 
			
		||||
static const char *app = "ChanSpy";
 | 
			
		||||
static const char *desc = 
 | 
			
		||||
"  ChanSpy([chanprefix][|options]): This application is used to listen to the\n"
 | 
			
		||||
@@ -130,7 +131,7 @@ static struct ast_channel *local_get_channel_begin_name(char *name)
 | 
			
		||||
	ast_mutex_lock(&modlock);
 | 
			
		||||
	chan = local_channel_walk(NULL);
 | 
			
		||||
	while (chan) {
 | 
			
		||||
		if (!strncmp(chan->name, name, strlen(name))) {
 | 
			
		||||
		if (!strncmp(chan->name, name, strlen(name)) && strncmp(chan->name, "Zap/pseudo", 10)) {
 | 
			
		||||
			ret = chan;
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
@@ -206,21 +207,6 @@ static int start_spying(struct ast_channel *chan, struct ast_channel *spychan, s
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void stop_spying(struct ast_channel *chan, struct ast_channel_spy *spy) 
 | 
			
		||||
{
 | 
			
		||||
	/* If our status has changed, then the channel we're spying on is gone....
 | 
			
		||||
	   DON'T TOUCH IT!!!  RUN AWAY!!! */
 | 
			
		||||
	if (spy->status != CHANSPY_RUNNING)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (!chan)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	ast_mutex_lock(&chan->lock);
 | 
			
		||||
	ast_channel_spy_remove(chan, spy);
 | 
			
		||||
	ast_mutex_unlock(&chan->lock);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Map 'volume' levels from -4 through +4 into
 | 
			
		||||
   decibel (dB) settings for channel drivers
 | 
			
		||||
*/
 | 
			
		||||
@@ -251,102 +237,111 @@ static void set_volume(struct ast_channel *chan, struct chanspy_translation_help
 | 
			
		||||
static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int *volfactor, int fd) 
 | 
			
		||||
{
 | 
			
		||||
	struct chanspy_translation_helper csth;
 | 
			
		||||
	int running, res = 0, x = 0;
 | 
			
		||||
	char inp[24];
 | 
			
		||||
	char *name=NULL;
 | 
			
		||||
	struct ast_frame *f;
 | 
			
		||||
	int running = 0, res = 0, x = 0;
 | 
			
		||||
	char inp[24] = "", *name = NULL;
 | 
			
		||||
	struct ast_frame *f = NULL;
 | 
			
		||||
 | 
			
		||||
	running = (chan && !ast_check_hangup(chan) && spyee && !ast_check_hangup(spyee));
 | 
			
		||||
	if ((chan && ast_check_hangup(chan)) || (spyee && ast_check_hangup(spyee)))
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	if (running) {
 | 
			
		||||
		memset(inp, 0, sizeof(inp));
 | 
			
		||||
		name = ast_strdupa(spyee->name);
 | 
			
		||||
		if (option_verbose >= 2)
 | 
			
		||||
			ast_verbose(VERBOSE_PREFIX_2 "Spying on channel %s\n", name);
 | 
			
		||||
	name = ast_strdupa(spyee->name);
 | 
			
		||||
	if (option_verbose > 1)
 | 
			
		||||
		ast_verbose(VERBOSE_PREFIX_2 "Spying on channel %s\n", name);
 | 
			
		||||
 | 
			
		||||
		memset(&csth, 0, sizeof(csth));
 | 
			
		||||
		ast_set_flag(&csth.spy, CHANSPY_FORMAT_AUDIO);
 | 
			
		||||
		ast_set_flag(&csth.spy, CHANSPY_TRIGGER_NONE);
 | 
			
		||||
		ast_set_flag(&csth.spy, CHANSPY_MIXAUDIO);
 | 
			
		||||
		csth.spy.type = chanspy_spy_type;
 | 
			
		||||
		csth.spy.status = CHANSPY_RUNNING;
 | 
			
		||||
		csth.spy.read_queue.format = AST_FORMAT_SLINEAR;
 | 
			
		||||
		csth.spy.write_queue.format = AST_FORMAT_SLINEAR;
 | 
			
		||||
		ast_mutex_init(&csth.spy.lock);
 | 
			
		||||
		csth.volfactor = *volfactor;
 | 
			
		||||
		set_volume(chan, &csth);
 | 
			
		||||
	memset(&csth, 0, sizeof(csth));
 | 
			
		||||
	ast_set_flag(&csth.spy, CHANSPY_FORMAT_AUDIO);
 | 
			
		||||
	ast_set_flag(&csth.spy, CHANSPY_TRIGGER_NONE);
 | 
			
		||||
	ast_set_flag(&csth.spy, CHANSPY_MIXAUDIO);
 | 
			
		||||
	csth.spy.type = chanspy_spy_type;
 | 
			
		||||
	csth.spy.status = CHANSPY_RUNNING;
 | 
			
		||||
	csth.spy.read_queue.format = AST_FORMAT_SLINEAR;
 | 
			
		||||
	csth.spy.write_queue.format = AST_FORMAT_SLINEAR;
 | 
			
		||||
	ast_mutex_init(&csth.spy.lock);
 | 
			
		||||
	csth.volfactor = *volfactor;
 | 
			
		||||
	set_volume(chan, &csth);
 | 
			
		||||
	if (csth.volfactor) {
 | 
			
		||||
		ast_set_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
 | 
			
		||||
		csth.spy.read_vol_adjustment = csth.volfactor;
 | 
			
		||||
		ast_set_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
 | 
			
		||||
		csth.spy.write_vol_adjustment = csth.volfactor;
 | 
			
		||||
		csth.fd = fd;
 | 
			
		||||
	}
 | 
			
		||||
	csth.fd = fd;
 | 
			
		||||
 | 
			
		||||
		if (start_spying(spyee, chan, &csth.spy))
 | 
			
		||||
			running = 0;
 | 
			
		||||
	if (start_spying(spyee, chan, &csth.spy)) {
 | 
			
		||||
		ast_channel_spy_free(&csth.spy);
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (running) {
 | 
			
		||||
		running = 1;
 | 
			
		||||
		ast_activate_generator(chan, &spygen, &csth);
 | 
			
		||||
	ast_activate_generator(chan, &spygen, &csth);
 | 
			
		||||
 | 
			
		||||
		while (csth.spy.status == CHANSPY_RUNNING &&
 | 
			
		||||
		       chan && !ast_check_hangup(chan) &&
 | 
			
		||||
		       spyee &&
 | 
			
		||||
		       !ast_check_hangup(spyee) &&
 | 
			
		||||
		       running == 1 &&
 | 
			
		||||
		       (res = ast_waitfor(chan, -1) > -1)) {
 | 
			
		||||
			if ((f = ast_read(chan))) {
 | 
			
		||||
				res = 0;
 | 
			
		||||
				if (f->frametype == AST_FRAME_DTMF) {
 | 
			
		||||
					res = f->subclass;
 | 
			
		||||
				}
 | 
			
		||||
				ast_frfree(f);
 | 
			
		||||
				if (!res) {
 | 
			
		||||
					continue;
 | 
			
		||||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
	while (csth.spy.status == CHANSPY_RUNNING &&
 | 
			
		||||
	       (res = ast_waitfor(chan, -1) > -1)) {
 | 
			
		||||
		
 | 
			
		||||
		/* Read in frame from channel, break out if no frame */
 | 
			
		||||
		if (!(f = ast_read(chan)))
 | 
			
		||||
			break;
 | 
			
		||||
		
 | 
			
		||||
		/* Now if this is DTMF then we have to handle it as such, otherwise just skip it */
 | 
			
		||||
		res = 0;
 | 
			
		||||
		if (f->frametype == AST_FRAME_DTMF)
 | 
			
		||||
			res = f->subclass;
 | 
			
		||||
		ast_frfree(f);
 | 
			
		||||
		if (!res)
 | 
			
		||||
			continue;
 | 
			
		||||
		
 | 
			
		||||
		if (x == sizeof(inp))
 | 
			
		||||
			x = 0;
 | 
			
		||||
		
 | 
			
		||||
		if (res < 0) {
 | 
			
		||||
			running = -1;
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		/* Process DTMF digits */
 | 
			
		||||
		if (res == '#') {
 | 
			
		||||
			if (!ast_strlen_zero(inp)) {
 | 
			
		||||
				running = x ? atoi(inp) : -1;
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			if (x == sizeof(inp)) {
 | 
			
		||||
				x = 0;
 | 
			
		||||
			}
 | 
			
		||||
			if (res < 0) {
 | 
			
		||||
				running = -1;
 | 
			
		||||
			}
 | 
			
		||||
			if (res == 0) {
 | 
			
		||||
				continue;
 | 
			
		||||
			} else if (res == '*') {
 | 
			
		||||
				running = 0; 
 | 
			
		||||
			} else if (res == '#') {
 | 
			
		||||
				if (!ast_strlen_zero(inp)) {
 | 
			
		||||
					running = x ? atoi(inp) : -1;
 | 
			
		||||
					break;
 | 
			
		||||
				} else {
 | 
			
		||||
					(*volfactor)++;
 | 
			
		||||
					if (*volfactor > 4) {
 | 
			
		||||
						*volfactor = -4;
 | 
			
		||||
					}
 | 
			
		||||
					if (option_verbose > 2) {
 | 
			
		||||
						ast_verbose(VERBOSE_PREFIX_3 "Setting spy volume on %s to %d\n", chan->name, *volfactor);
 | 
			
		||||
					}
 | 
			
		||||
					csth.volfactor = *volfactor;
 | 
			
		||||
					set_volume(chan, &csth);
 | 
			
		||||
			} else {
 | 
			
		||||
				(*volfactor)++;
 | 
			
		||||
				if (*volfactor > 4)
 | 
			
		||||
					*volfactor = -1;
 | 
			
		||||
				if (option_verbose > 2)
 | 
			
		||||
					ast_verbose(VERBOSE_PREFIX_3 "Setting spy volume on %s to %d\n", chan->name, *volfactor);
 | 
			
		||||
				csth.volfactor = *volfactor;
 | 
			
		||||
				set_volume(chan, &csth);
 | 
			
		||||
				if (csth.volfactor) {
 | 
			
		||||
					ast_set_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
 | 
			
		||||
					csth.spy.read_vol_adjustment = csth.volfactor;
 | 
			
		||||
					ast_set_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
 | 
			
		||||
					csth.spy.write_vol_adjustment = csth.volfactor;
 | 
			
		||||
				} else {
 | 
			
		||||
					ast_clear_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
 | 
			
		||||
					ast_clear_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
 | 
			
		||||
				}
 | 
			
		||||
			} else if (res >= 48 && res <= 57) {
 | 
			
		||||
				inp[x++] = res;
 | 
			
		||||
			}
 | 
			
		||||
		} else if (res == '*') {
 | 
			
		||||
			break;
 | 
			
		||||
		} else if (res >= 48 && res <= 57) {
 | 
			
		||||
			inp[x++] = res;
 | 
			
		||||
		}
 | 
			
		||||
		ast_deactivate_generator(chan);
 | 
			
		||||
		stop_spying(spyee, &csth.spy);
 | 
			
		||||
 | 
			
		||||
		if (option_verbose >= 2) {
 | 
			
		||||
			ast_verbose(VERBOSE_PREFIX_2 "Done Spying on channel %s\n", name);
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		running = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ast_mutex_destroy(&csth.spy.lock);
 | 
			
		||||
	ast_deactivate_generator(chan);
 | 
			
		||||
	
 | 
			
		||||
	ast_mutex_lock(&csth.spy.lock);
 | 
			
		||||
	if (csth.spy.chan) {
 | 
			
		||||
		csth.spy.status = CHANSPY_DONE;
 | 
			
		||||
		ast_mutex_lock(&csth.spy.chan->lock);
 | 
			
		||||
		ast_channel_spy_remove(csth.spy.chan, &csth.spy);
 | 
			
		||||
		ast_mutex_unlock(&csth.spy.chan->lock);
 | 
			
		||||
	}
 | 
			
		||||
	ast_mutex_unlock(&csth.spy.lock);
 | 
			
		||||
 | 
			
		||||
	if (option_verbose > 1)
 | 
			
		||||
		ast_verbose(VERBOSE_PREFIX_2 "Done Spying on channel %s\n", name);
 | 
			
		||||
 | 
			
		||||
	ast_channel_spy_free(&csth.spy);
 | 
			
		||||
 | 
			
		||||
	return running;
 | 
			
		||||
}
 | 
			
		||||
@@ -418,19 +413,19 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		char *opts[OPT_ARG_ARRAY_SIZE];
 | 
			
		||||
		ast_app_parse_options(chanspy_opts, &flags, opts, options);
 | 
			
		||||
		if (ast_test_flag(&flags, OPTION_GROUP)) {
 | 
			
		||||
			mygroup = opts[1];
 | 
			
		||||
			mygroup = opts[OPT_ARG_GROUP];
 | 
			
		||||
		}
 | 
			
		||||
		if (ast_test_flag(&flags, OPTION_RECORD)) {
 | 
			
		||||
			if (!(recbase = opts[2])) {
 | 
			
		||||
			if (!(recbase = opts[OPT_ARG_RECORD])) {
 | 
			
		||||
				recbase = "chanspy";
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		silent = ast_test_flag(&flags, OPTION_QUIET);
 | 
			
		||||
		bronly = ast_test_flag(&flags, OPTION_BRIDGED);
 | 
			
		||||
		if (ast_test_flag(&flags, OPTION_VOLUME) && opts[1]) {
 | 
			
		||||
		if (ast_test_flag(&flags, OPTION_VOLUME) && opts[OPT_ARG_VOLUME]) {
 | 
			
		||||
			int vol;
 | 
			
		||||
 | 
			
		||||
			if ((sscanf(opts[0], "%d", &vol) != 1) || (vol > 4) || (vol < -4))
 | 
			
		||||
			if ((sscanf(opts[OPT_ARG_VOLUME], "%d", &vol) != 1) || (vol > 4) || (vol < -4))
 | 
			
		||||
				ast_log(LOG_NOTICE, "Volume factor must be a number between -4 and 4\n");
 | 
			
		||||
			else
 | 
			
		||||
				volfactor = vol;
 | 
			
		||||
@@ -439,8 +434,8 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
 | 
			
		||||
	if (recbase) {
 | 
			
		||||
		char filename[512];
 | 
			
		||||
		snprintf(filename,sizeof(filename),"%s/%s.%ld.raw",ast_config_AST_MONITOR_DIR, recbase, time(NULL));
 | 
			
		||||
		if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC)) <= 0) {
 | 
			
		||||
		snprintf(filename,sizeof(filename),"%s/%s.%d.raw",ast_config_AST_MONITOR_DIR, recbase, (int)time(NULL));
 | 
			
		||||
		if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC, 0644)) <= 0) {
 | 
			
		||||
			ast_log(LOG_WARNING, "Cannot open %s for recording\n", filename);
 | 
			
		||||
			fd = 0;
 | 
			
		||||
		}
 | 
			
		||||
@@ -482,7 +477,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				
 | 
			
		||||
				if (igrp && (!spec || ((strlen(spec) < strlen(peer->name) &&
 | 
			
		||||
				if (igrp && (!spec || ((strlen(spec) <= strlen(peer->name) &&
 | 
			
		||||
							!strncasecmp(peer->name, spec, strlen(spec)))))) {
 | 
			
		||||
					if (peer && (!bronly || ast_bridged_channel(peer)) &&
 | 
			
		||||
					    !ast_check_hangup(peer) && !ast_test_flag(peer, AST_FLAG_SPYING)) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								apps/app_controlplayback.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								apps/app_controlplayback.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -140,7 +140,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	} else {
 | 
			
		||||
		if (res < 0) {
 | 
			
		||||
			if (priority_jump || option_priority_jumping) {
 | 
			
		||||
				if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
 | 
			
		||||
				if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
 | 
			
		||||
					ast_log(LOG_WARNING, "ControlPlayback tried to jump to priority n+101 as requested, but priority didn't exist\n");
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								apps/app_curl.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										3
									
								
								apps/app_curl.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -94,7 +94,6 @@ static int curl_internal(struct MemoryStruct *chunk, char *url, char *post)
 | 
			
		||||
{
 | 
			
		||||
	CURL *curl;
 | 
			
		||||
 | 
			
		||||
	curl_global_init(CURL_GLOBAL_ALL);
 | 
			
		||||
	curl = curl_easy_init();
 | 
			
		||||
 | 
			
		||||
	if (!curl) {
 | 
			
		||||
@@ -224,6 +223,7 @@ int unload_module(void)
 | 
			
		||||
	res |= ast_unregister_application(app);
 | 
			
		||||
 | 
			
		||||
	STANDARD_HANGUP_LOCALUSERS;
 | 
			
		||||
	curl_global_cleanup();
 | 
			
		||||
	
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
@@ -232,6 +232,7 @@ int load_module(void)
 | 
			
		||||
{
 | 
			
		||||
	int res;
 | 
			
		||||
 | 
			
		||||
	curl_global_init(CURL_GLOBAL_ALL);
 | 
			
		||||
	res = ast_custom_function_register(&acf_curl);
 | 
			
		||||
	res |= ast_register_application(app, curl_exec, synopsis, descrip);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								apps/app_cut.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										12
									
								
								apps/app_cut.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -36,7 +36,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/channel.h"
 | 
			
		||||
#include "asterisk/pbx.h"
 | 
			
		||||
#include "asterisk/module.h"
 | 
			
		||||
#include "asterisk/version.h"
 | 
			
		||||
#include "asterisk/app.h"
 | 
			
		||||
 | 
			
		||||
/* Maximum length of any variable */
 | 
			
		||||
@@ -49,7 +48,7 @@ static char *app_cut = "Cut";
 | 
			
		||||
static char *cut_synopsis = "Splits a variable's contents using the specified delimiter";
 | 
			
		||||
 | 
			
		||||
static char *cut_descrip =
 | 
			
		||||
"  Cut(newvar=varname,delimiter,fieldspec): This applicaiton will split the\n"
 | 
			
		||||
"  Cut(newvar=varname,delimiter,fieldspec): This application will split the\n"
 | 
			
		||||
"contents of a variable based on the given delimeter and store the result in\n"
 | 
			
		||||
"a new variable.\n"
 | 
			
		||||
"Parameters:\n"
 | 
			
		||||
@@ -67,7 +66,7 @@ static char *app_sort_descrip =
 | 
			
		||||
"  Sort(newvar=key1:val1[,key2:val2[[...],keyN:valN]]): This application will\n"
 | 
			
		||||
"sort the list provided in ascending order. The result will be stored in the\n"
 | 
			
		||||
"specified variable name.\n"
 | 
			
		||||
"  This applicaiton has been deprecated in favor of the SORT function.\n";
 | 
			
		||||
"  This application has been deprecated in favor of the SORT function.\n";
 | 
			
		||||
 | 
			
		||||
STANDARD_LOCAL_USER;
 | 
			
		||||
 | 
			
		||||
@@ -146,8 +145,9 @@ static int sort_internal(struct ast_channel *chan, char *data, char *buffer, siz
 | 
			
		||||
		int blen = strlen(buffer);
 | 
			
		||||
		if (element_count++) {
 | 
			
		||||
			strncat(buffer + blen, ",", buflen - blen - 1);
 | 
			
		||||
			blen++;
 | 
			
		||||
		}
 | 
			
		||||
		strncat(buffer + blen + 1, sortable_keys[count2].key, buflen - blen - 2);
 | 
			
		||||
		strncat(buffer + blen, sortable_keys[count2].key, buflen - blen - 1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
@@ -253,6 +253,8 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		return ERROR_NOARG;
 | 
			
		||||
	}
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -386,7 +388,7 @@ static char *acf_cut_exec(struct ast_channel *chan, char *cmd, char *data, char
 | 
			
		||||
 | 
			
		||||
	switch (cut_internal(chan, data, buf, len)) {
 | 
			
		||||
	case ERROR_NOARG:
 | 
			
		||||
		ast_log(LOG_ERROR, "Cut() requires an argument\n");
 | 
			
		||||
		ast_log(LOG_ERROR, "CUT() requires an argument\n");
 | 
			
		||||
		break;
 | 
			
		||||
	case ERROR_NOMEM:
 | 
			
		||||
		ast_log(LOG_ERROR, "Out of memory\n");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_datetime.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_datetime.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										2
									
								
								apps/app_db.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								apps/app_db.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -63,7 +63,7 @@ static char *p_descrip =
 | 
			
		||||
"  This application has been deprecated in favor of the DB function.\n";
 | 
			
		||||
 | 
			
		||||
static char *d_descrip =
 | 
			
		||||
"  DBdel(family/key): This applicaiton will delete a key from the Asterisk\n"
 | 
			
		||||
"  DBdel(family/key): This application will delete a key from the Asterisk\n"
 | 
			
		||||
"database.\n";
 | 
			
		||||
 | 
			
		||||
static char *dt_descrip =
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										161
									
								
								apps/app_dial.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										161
									
								
								apps/app_dial.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Asterisk -- An open source telephony toolkit.
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 1999 - 2005, Digium, Inc.
 | 
			
		||||
 * Copyright (C) 1999 - 2006, Digium, Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Mark Spencer <markster@digium.com>
 | 
			
		||||
 *
 | 
			
		||||
@@ -31,6 +31,7 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <sys/time.h>
 | 
			
		||||
#include <sys/signal.h>
 | 
			
		||||
#include <sys/stat.h>
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
 | 
			
		||||
#include "asterisk.h"
 | 
			
		||||
@@ -64,7 +65,7 @@ static char *synopsis = "Place a call and connect to the current channel";
 | 
			
		||||
 | 
			
		||||
static char *descrip =
 | 
			
		||||
"  Dial(Technology/resource[&Tech2/resource2...][|timeout][|options][|URL]):\n"
 | 
			
		||||
"This applicaiton will place calls to one or more specified channels. As soon\n"
 | 
			
		||||
"This application will place calls to one or more specified channels. As soon\n"
 | 
			
		||||
"as one of the requested channels answers, the originating channel will be\n"
 | 
			
		||||
"answered, if it has not already been answered. These two channels will then\n"
 | 
			
		||||
"be active in a bridged call. All other channels that were requested will then\n"
 | 
			
		||||
@@ -75,11 +76,11 @@ static char *descrip =
 | 
			
		||||
"continue if no requested channels can be called, or if the timeout expires.\n\n"
 | 
			
		||||
"  This application sets the following channel variables upon completion:\n"
 | 
			
		||||
"    DIALEDTIME   - This is the time from dialing a channel until when it\n"
 | 
			
		||||
"                   answers.\n" 
 | 
			
		||||
"                   is disconnected.\n" 
 | 
			
		||||
"    ANSWEREDTIME - This is the amount of time for actual call.\n"
 | 
			
		||||
"    DIALSTATUS   - This is the status of the call:\n"
 | 
			
		||||
"                   CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL\n" 
 | 
			
		||||
"                   DONTCALL | TORTURE\n"
 | 
			
		||||
"                   DONTCALL | TORTURE | INVALIDARGS\n"
 | 
			
		||||
"  For the Privacy and Screening Modes, the DIALSTATUS variable will be set to\n"
 | 
			
		||||
"DONTCALL if the called party chooses to send the calling party to the 'Go Away'\n"
 | 
			
		||||
"script. The DIALSTATUS variable will be set to TORTURE if the called party\n"
 | 
			
		||||
@@ -89,7 +90,10 @@ static char *descrip =
 | 
			
		||||
"ends the call.\n"
 | 
			
		||||
"  The optional URL will be sent to the called party if the channel supports it.\n"
 | 
			
		||||
"  If the OUTBOUND_GROUP variable is set, all peer channels created by this\n"
 | 
			
		||||
"application will be put into that group (as in Set(GROUP()=...).\n\n"
 | 
			
		||||
"application will be put into that group (as in Set(GROUP()=...).\n"
 | 
			
		||||
"  If the OUTBOUND_GROUP_ONCE variable is set, all peer channels created by this\n"
 | 
			
		||||
"application will be put into that group (as in Set(GROUP()=...). Unlike OUTBOUND_GROUP,\n"
 | 
			
		||||
"however, the variable will be unset after use.\n\n"
 | 
			
		||||
"  Options:\n"
 | 
			
		||||
"    A(x) - Play an announcement to the called party, using 'x' as the file.\n"
 | 
			
		||||
"    C    - Reset the CDR for this call.\n"
 | 
			
		||||
@@ -108,9 +112,11 @@ static char *descrip =
 | 
			
		||||
"           other than the number assigned to the caller.\n"
 | 
			
		||||
"    g    - Proceed with dialplan execution at the current extension if the\n"
 | 
			
		||||
"           destination channel hangs up.\n"
 | 
			
		||||
"    G(context^exten^pri) - If the call is answered, transfer both parties to\n"
 | 
			
		||||
"           the specified priority. Optionally, an extension, or extension and\n"
 | 
			
		||||
"           context may be specified. Otherwise, the current extension is used.\n"
 | 
			
		||||
"    G(context^exten^pri) - If the call is answered, transfer the calling party to\n"
 | 
			
		||||
"           the specified priority and the called party to the specified priority+1.\n"
 | 
			
		||||
"           Optionally, an extension, or extension and context may be specified. \n"
 | 
			
		||||
"           Otherwise, the current extension is used. You cannot use any additional\n"
 | 
			
		||||
"           action post answer options in conjunction with this option.\n" 
 | 
			
		||||
"    h    - Allow the called party to hang up by sending the '*' DTMF digit.\n"
 | 
			
		||||
"    H    - Allow the calling party to hang up by hitting the '*' DTMF digit.\n"
 | 
			
		||||
"    j    - Jump to priority n+101 if all of the requested channels were busy.\n"
 | 
			
		||||
@@ -143,6 +149,8 @@ static char *descrip =
 | 
			
		||||
"           * GOTO:<context>^<exten>^<priority> - Transfer the call to the\n"
 | 
			
		||||
"                          specified priority. Optionally, an extension, or\n"
 | 
			
		||||
"                          extension and priority can be specified.\n"
 | 
			
		||||
"           You cannot use any additional action post answer options in conjunction\n"
 | 
			
		||||
"           with this option.\n"
 | 
			
		||||
"    n    - This option is a modifier for the screen/privacy mode. It specifies\n"
 | 
			
		||||
"           that no introductions are to be saved in the priv-callerintros\n"
 | 
			
		||||
"           directory.\n"
 | 
			
		||||
@@ -161,7 +169,7 @@ static char *descrip =
 | 
			
		||||
"    S(x) - Hang up the call after 'x' seconds *after* the called party has\n"
 | 
			
		||||
"           answered the call.\n"  	
 | 
			
		||||
"    t    - Allow the called party to transfer the calling party by sending the\n"
 | 
			
		||||
"           DTMF sequence defiend in features.conf.\n"
 | 
			
		||||
"           DTMF sequence defined in features.conf.\n"
 | 
			
		||||
"    T    - Allow the calling party to transfer the called party by sending the\n"
 | 
			
		||||
"           DTMF sequence defined in features.conf.\n"
 | 
			
		||||
"    w    - Allow the called party to enable recording of the call by sending\n"
 | 
			
		||||
@@ -303,6 +311,8 @@ static void hanguptree(struct localuser *outgoing, struct ast_channel *exception
 | 
			
		||||
			ast_cdr_failed(chan->cdr); \
 | 
			
		||||
		numnochan++; \
 | 
			
		||||
		break; \
 | 
			
		||||
	case AST_CAUSE_NORMAL_CLEARING: \
 | 
			
		||||
		break; \
 | 
			
		||||
	default: \
 | 
			
		||||
		numnochan++; \
 | 
			
		||||
		break; \
 | 
			
		||||
@@ -463,7 +473,11 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
 | 
			
		||||
							ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
 | 
			
		||||
						/* Setup parameters */
 | 
			
		||||
						o->chan = ast_request(tech, in->nativeformats, stuff, &cause);
 | 
			
		||||
						if (!o->chan)
 | 
			
		||||
						if (o->chan) {
 | 
			
		||||
							if (single)
 | 
			
		||||
								ast_channel_make_compatible(o->chan, in);
 | 
			
		||||
							ast_channel_inherit_variables(in, o->chan);
 | 
			
		||||
						} else
 | 
			
		||||
							ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
 | 
			
		||||
					} else {
 | 
			
		||||
						if (option_verbose > 2)
 | 
			
		||||
@@ -512,10 +526,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
 | 
			
		||||
						if (in->cid.cid_ani) {
 | 
			
		||||
							if (o->chan->cid.cid_ani)
 | 
			
		||||
								free(o->chan->cid.cid_ani);
 | 
			
		||||
							o->chan->cid.cid_ani = malloc(strlen(in->cid.cid_ani) + 1);
 | 
			
		||||
							if (o->chan->cid.cid_ani)
 | 
			
		||||
								ast_copy_string(o->chan->cid.cid_ani, in->cid.cid_ani, sizeof(o->chan->cid.cid_ani));
 | 
			
		||||
							else
 | 
			
		||||
							o->chan->cid.cid_ani = strdup(in->cid.cid_ani);
 | 
			
		||||
							if (!o->chan->cid.cid_ani)
 | 
			
		||||
								ast_log(LOG_WARNING, "Out of memory\n");
 | 
			
		||||
						}
 | 
			
		||||
						if (o->chan->cid.cid_rdnis) 
 | 
			
		||||
@@ -650,6 +662,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
 | 
			
		||||
					ast_hangup(o->chan);
 | 
			
		||||
					o->chan = NULL;
 | 
			
		||||
					ast_clear_flag(o, DIAL_STILLGOING);
 | 
			
		||||
					HANDLE_CAUSE(in->hangupcause, in);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			o = o->next;
 | 
			
		||||
@@ -720,7 +733,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags)
 | 
			
		||||
static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags, int *continue_exec)
 | 
			
		||||
{
 | 
			
		||||
	int res=-1;
 | 
			
		||||
	struct localuser *u;
 | 
			
		||||
@@ -737,6 +750,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
	char numsubst[AST_MAX_EXTENSION];
 | 
			
		||||
	char restofit[AST_MAX_EXTENSION];
 | 
			
		||||
	char cidname[AST_MAX_EXTENSION];
 | 
			
		||||
	char toast[80];
 | 
			
		||||
	char *newnum;
 | 
			
		||||
	char *l;
 | 
			
		||||
	int privdb_val=0;
 | 
			
		||||
@@ -750,7 +764,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
	char *start_sound=NULL;
 | 
			
		||||
	char *dtmfcalled=NULL, *dtmfcalling=NULL;
 | 
			
		||||
	char *var;
 | 
			
		||||
	char status[256];
 | 
			
		||||
	char status[256] = "INVALIDARGS";
 | 
			
		||||
	int play_to_caller=0,play_to_callee=0;
 | 
			
		||||
	int sentringing=0, moh=0;
 | 
			
		||||
	char *outbound_group = NULL;
 | 
			
		||||
@@ -771,21 +785,19 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
 | 
			
		||||
	if (ast_strlen_zero(data)) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	LOCAL_USER_ADD(u);
 | 
			
		||||
 | 
			
		||||
	if (!(parse = ast_strdupa(data))) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Memory allocation failure\n");
 | 
			
		||||
		LOCAL_USER_REMOVE(u);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
	parse = ast_strdupa(data);
 | 
			
		||||
	
 | 
			
		||||
	AST_STANDARD_APP_ARGS(args, parse);
 | 
			
		||||
 | 
			
		||||
	if (!ast_strlen_zero(args.options)) {
 | 
			
		||||
		if (ast_app_parse_options(dial_exec_options, &opts, opt_args, args.options)) {
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
 | 
			
		||||
			LOCAL_USER_REMOVE(u);
 | 
			
		||||
			return -1;
 | 
			
		||||
		}
 | 
			
		||||
@@ -793,6 +805,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
 | 
			
		||||
	if (ast_strlen_zero(args.peers)) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
 | 
			
		||||
		LOCAL_USER_REMOVE(u);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
@@ -826,6 +839,21 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
		if (!timelimit) {
 | 
			
		||||
			timelimit = play_to_caller = play_to_callee = play_warning = warning_freq = 0;
 | 
			
		||||
			warning_sound = NULL;
 | 
			
		||||
		} else if (play_warning > timelimit) {
 | 
			
		||||
			/* If the first warning is requested _after_ the entire call would end,
 | 
			
		||||
			   and no warning frequency is requested, then turn off the warning. If
 | 
			
		||||
			   a warning frequency is requested, reduce the 'first warning' time by
 | 
			
		||||
			   that frequency until it falls within the call's total time limit.
 | 
			
		||||
			*/
 | 
			
		||||
 | 
			
		||||
			if (!warning_freq) {
 | 
			
		||||
				play_warning = 0;
 | 
			
		||||
			} else {
 | 
			
		||||
				while (play_warning > timelimit)
 | 
			
		||||
					play_warning -= warning_freq;
 | 
			
		||||
				if (play_warning < 1)
 | 
			
		||||
					play_warning = warning_freq = 0;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		var = pbx_builtin_getvar_helper(chan,"LIMIT_PLAYAUDIO_CALLER");
 | 
			
		||||
@@ -916,27 +944,39 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if( privdb_val == AST_PRIVACY_DENY ) {
 | 
			
		||||
			strcpy(status, "NOANSWER");
 | 
			
		||||
			ast_verbose( VERBOSE_PREFIX_3  "Privacy DB reports PRIVACY_DENY for this callerid. Dial reports unavailable\n");
 | 
			
		||||
			res=0;
 | 
			
		||||
			goto out;
 | 
			
		||||
		}
 | 
			
		||||
		else if( privdb_val == AST_PRIVACY_KILL ) {
 | 
			
		||||
			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 201);
 | 
			
		||||
			strcpy(status, "DONTCALL");
 | 
			
		||||
			if (option_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) {
 | 
			
		||||
				ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 201);
 | 
			
		||||
			}
 | 
			
		||||
			res = 0;
 | 
			
		||||
			goto out; /* Is this right? */
 | 
			
		||||
		}
 | 
			
		||||
		else if( privdb_val == AST_PRIVACY_TORTURE ) {
 | 
			
		||||
			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 301);
 | 
			
		||||
			strcpy(status, "TORTURE");
 | 
			
		||||
			if (option_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) {
 | 
			
		||||
				ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 301);
 | 
			
		||||
			}
 | 
			
		||||
			res = 0;
 | 
			
		||||
			goto out; /* is this right??? */
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
		else if( privdb_val == AST_PRIVACY_UNKNOWN ) {
 | 
			
		||||
			/* Get the user's intro, store it in priv-callerintros/$CID, 
 | 
			
		||||
			   unless it is already there-- this should be done before the 
 | 
			
		||||
			   call is actually dialed  */
 | 
			
		||||
 | 
			
		||||
			/* make sure the priv-callerintros dir exists? */
 | 
			
		||||
			/* make sure the priv-callerintros dir actually exists */
 | 
			
		||||
			snprintf(privintro, sizeof(privintro), "%s/sounds/priv-callerintros", ast_config_AST_VAR_DIR);
 | 
			
		||||
			if (mkdir(privintro, 0755) && errno != EEXIST) {
 | 
			
		||||
				ast_log(LOG_WARNING, "privacy: can't create directory priv-callerintros: %s\n", strerror(errno));
 | 
			
		||||
				res = -1;
 | 
			
		||||
				goto out;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			snprintf(privintro,sizeof(privintro),"priv-callerintros/%s", privcid);
 | 
			
		||||
			if( ast_fileexists(privintro,NULL,NULL ) > 0 && strncmp(privcid,"NOCALLERID",10) != 0) {
 | 
			
		||||
@@ -953,17 +993,35 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
				   "At the tone, please say your name:"
 | 
			
		||||
 | 
			
		||||
				*/
 | 
			
		||||
				ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0);  /* NOTE: I've reduced the total time to 4 sec */
 | 
			
		||||
															/* don't think we'll need a lock removed, we took care of
 | 
			
		||||
															   conflicts by naming the privintro file */
 | 
			
		||||
				ast_answer(chan);
 | 
			
		||||
				res = ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0);  /* NOTE: I've reduced the total time to */
 | 
			
		||||
															/* 4 sec don't think we'll need a lock removed, we 
 | 
			
		||||
															   took care of conflicts by naming the privintro file */
 | 
			
		||||
				if (res == -1) {
 | 
			
		||||
					/* Delete the file regardless since they hung up during recording */
 | 
			
		||||
                                        ast_filedelete(privintro, NULL);
 | 
			
		||||
                                        if( ast_fileexists(privintro,NULL,NULL ) > 0 )
 | 
			
		||||
                                                ast_log(LOG_NOTICE,"privacy: ast_filedelete didn't do its job on %s\n", privintro);
 | 
			
		||||
                                        else if (option_verbose > 2)
 | 
			
		||||
                                                ast_verbose( VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", privintro);
 | 
			
		||||
					goto out;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (continue_exec)
 | 
			
		||||
		*continue_exec = 0;
 | 
			
		||||
	
 | 
			
		||||
	/* If a channel group has been specified, get it for use when we create peer channels */
 | 
			
		||||
	outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
 | 
			
		||||
 | 
			
		||||
	ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID);
 | 
			
		||||
	if ((outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP_ONCE"))) {
 | 
			
		||||
		outbound_group = ast_strdupa(outbound_group);
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "OUTBOUND_GROUP_ONCE", NULL);
 | 
			
		||||
	} else {
 | 
			
		||||
		outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
 | 
			
		||||
	}
 | 
			
		||||
	    
 | 
			
		||||
	ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP);
 | 
			
		||||
	cur = args.peers;
 | 
			
		||||
	do {
 | 
			
		||||
		/* Remember where to start next time */
 | 
			
		||||
@@ -1013,6 +1071,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
			cur = rest;
 | 
			
		||||
			if (!cur)
 | 
			
		||||
				chan->hangupcause = cause;
 | 
			
		||||
			free(tmp);
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
		pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
 | 
			
		||||
@@ -1039,6 +1098,8 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
				tmp->chan = ast_request(tech, chan->nativeformats, stuff, &cause);
 | 
			
		||||
				if (!tmp->chan)
 | 
			
		||||
					ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
 | 
			
		||||
				else
 | 
			
		||||
					ast_channel_inherit_variables(chan, tmp->chan);
 | 
			
		||||
			} else {
 | 
			
		||||
				if (option_verbose > 2)
 | 
			
		||||
					ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", tmp->chan->name);
 | 
			
		||||
@@ -1049,6 +1110,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
			if (!tmp->chan) {
 | 
			
		||||
				HANDLE_CAUSE(cause, chan);
 | 
			
		||||
				cur = rest;
 | 
			
		||||
				free(tmp);
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -1111,11 +1173,12 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
			/* Again, keep going even if there's an error */
 | 
			
		||||
			if (option_debug)
 | 
			
		||||
				ast_log(LOG_DEBUG, "ast call on peer returned %d\n", res);
 | 
			
		||||
			else if (option_verbose > 2)
 | 
			
		||||
			if (option_verbose > 2)
 | 
			
		||||
				ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
 | 
			
		||||
			ast_hangup(tmp->chan);
 | 
			
		||||
			tmp->chan = NULL;
 | 
			
		||||
			cur = rest;
 | 
			
		||||
			free(tmp);
 | 
			
		||||
			continue;
 | 
			
		||||
		} else {
 | 
			
		||||
			senddialevent(chan, tmp->chan);
 | 
			
		||||
@@ -1150,6 +1213,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
		strcpy(status, "NOANSWER");
 | 
			
		||||
		if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
 | 
			
		||||
			moh=1;
 | 
			
		||||
			ast_indicate(chan, AST_CONTROL_PROGRESS);
 | 
			
		||||
			ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK]);
 | 
			
		||||
		} else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
 | 
			
		||||
			ast_indicate(chan, AST_CONTROL_RINGING);
 | 
			
		||||
@@ -1227,18 +1291,18 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
					do {
 | 
			
		||||
						if (!res2)
 | 
			
		||||
							res2 = ast_play_and_wait(peer,"priv-callpending");
 | 
			
		||||
						if( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
 | 
			
		||||
						if ( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
 | 
			
		||||
							res2 = 0;
 | 
			
		||||
						
 | 
			
		||||
						/* priv-callpending script: 
 | 
			
		||||
						   "I have a caller waiting, who introduces themselves as:"
 | 
			
		||||
						*/
 | 
			
		||||
						if (!res2)
 | 
			
		||||
							res2 = ast_play_and_wait(peer,privintro);
 | 
			
		||||
						if( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
 | 
			
		||||
							res2 = ast_play_and_wait(peer, privintro);
 | 
			
		||||
						if ( res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2>'5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) /* uh, interrupting with a bad answer is ... ignorable! */
 | 
			
		||||
							res2 = 0;
 | 
			
		||||
						/* now get input from the called party, as to their choice */
 | 
			
		||||
						if( !res2 ) {
 | 
			
		||||
						if (!res2) {
 | 
			
		||||
							if( ast_test_flag(&opts, OPT_PRIVACY) )
 | 
			
		||||
								res2 = ast_play_and_wait(peer,"priv-callee-options");
 | 
			
		||||
							if( ast_test_flag(&opts, OPT_SCREENING) )
 | 
			
		||||
@@ -1285,6 +1349,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
								     opt_args[OPT_ARG_PRIVACY], privcid);
 | 
			
		||||
						ast_privacy_set(opt_args[OPT_ARG_PRIVACY], privcid, AST_PRIVACY_DENY);
 | 
			
		||||
					}
 | 
			
		||||
					strcpy(status,"NOANSWER");
 | 
			
		||||
					if (ast_test_flag(&opts, OPT_MUSICBACK)) {
 | 
			
		||||
						ast_moh_stop(chan);
 | 
			
		||||
					} else if (ast_test_flag(&opts, OPT_RINGBACK)) {
 | 
			
		||||
@@ -1418,6 +1483,8 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
			ast_pbx_start(peer);
 | 
			
		||||
			hanguptree(outgoing, NULL);
 | 
			
		||||
			LOCAL_USER_REMOVE(u);
 | 
			
		||||
			if (continue_exec)
 | 
			
		||||
				*continue_exec = 1;
 | 
			
		||||
			return 0;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -1515,8 +1582,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if (!res) {
 | 
			
		||||
			char toast[80];
 | 
			
		||||
 | 
			
		||||
			memset(&config,0,sizeof(struct ast_bridge_config));
 | 
			
		||||
			if (play_to_caller)
 | 
			
		||||
				ast_set_flag(&(config.features_caller), AST_FEATURE_PLAY_WARNING);
 | 
			
		||||
@@ -1560,13 +1625,15 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 | 
			
		||||
			}
 | 
			
		||||
			res = ast_bridge_call(chan,peer,&config);
 | 
			
		||||
			time(&end_time);
 | 
			
		||||
			snprintf(toast, sizeof(toast), "%ld", (long)(end_time - start_time));
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "DIALEDTIME", toast);
 | 
			
		||||
			snprintf(toast, sizeof(toast), "%ld", (long)(end_time - answer_time));
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", toast);
 | 
			
		||||
			
 | 
			
		||||
		} else 
 | 
			
		||||
		} else {
 | 
			
		||||
			time(&end_time);
 | 
			
		||||
			res = -1;
 | 
			
		||||
		}
 | 
			
		||||
		snprintf(toast, sizeof(toast), "%ld", (long)(end_time - start_time));
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "DIALEDTIME", toast);
 | 
			
		||||
		
 | 
			
		||||
		if (res != AST_PBX_NO_HANGUP_PEER) {
 | 
			
		||||
			if (!chan->_softhangup)
 | 
			
		||||
@@ -1597,8 +1664,10 @@ out:
 | 
			
		||||
static int dial_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct ast_flags peerflags;
 | 
			
		||||
 | 
			
		||||
	memset(&peerflags, 0, sizeof(peerflags));
 | 
			
		||||
	return dial_exec_full(chan, data, &peerflags);
 | 
			
		||||
 | 
			
		||||
	return dial_exec_full(chan, data, &peerflags, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int retrydial_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
@@ -1663,11 +1732,16 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	context = pbx_builtin_getvar_helper(chan, "EXITCONTEXT");
 | 
			
		||||
	
 | 
			
		||||
	while (loops) {
 | 
			
		||||
		int continue_exec;
 | 
			
		||||
 | 
			
		||||
		chan->data = "Retrying";
 | 
			
		||||
		if (ast_test_flag(chan, AST_FLAG_MOH))
 | 
			
		||||
			ast_moh_stop(chan);
 | 
			
		||||
 | 
			
		||||
		if ((res = dial_exec_full(chan, dialdata, &peerflags)) == 0) {
 | 
			
		||||
		res = dial_exec_full(chan, dialdata, &peerflags, &continue_exec);
 | 
			
		||||
		if (continue_exec)
 | 
			
		||||
			break;
 | 
			
		||||
		if (res == 0) {
 | 
			
		||||
			if (ast_test_flag(&peerflags, OPT_DTMF_EXIT)) {
 | 
			
		||||
				if (!(res = ast_streamfile(chan, announce, chan->language)))
 | 
			
		||||
					res = ast_waitstream(chan, AST_DIGIT_ANY);
 | 
			
		||||
@@ -1704,7 +1778,6 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
 | 
			
		||||
	LOCAL_USER_REMOVE(u);
 | 
			
		||||
	return loops ? res : 0;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int unload_module(void)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								apps/app_dictate.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										3
									
								
								apps/app_dictate.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -257,7 +257,8 @@ static int dictate_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
						if (lastop != DFLAG_PLAY) {
 | 
			
		||||
							lastop = DFLAG_PLAY;
 | 
			
		||||
							ast_closestream(fs);
 | 
			
		||||
							fs = ast_openstream(chan, path, chan->language);
 | 
			
		||||
							if (!(fs = ast_openstream(chan, path, chan->language)))
 | 
			
		||||
								break;
 | 
			
		||||
							ast_seekstream(fs, samples, SEEK_SET);
 | 
			
		||||
							chan->stream = NULL;
 | 
			
		||||
						}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								apps/app_directed_pickup.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										6
									
								
								apps/app_directed_pickup.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -3,7 +3,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2005, Joshua Colp
 | 
			
		||||
 *
 | 
			
		||||
 * Joshua Colp <jcolp@asterlink.com>
 | 
			
		||||
 * Joshua Colp <jcolp@digium.com>
 | 
			
		||||
 *
 | 
			
		||||
 * See http://www.asterisk.org for more information about
 | 
			
		||||
 * the Asterisk project. Please do not directly contact
 | 
			
		||||
@@ -77,7 +77,7 @@ static int pickup_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
 | 
			
		||||
	/* Find a channel to pickup */
 | 
			
		||||
	origin = ast_get_channel_by_exten_locked(exten, context);
 | 
			
		||||
	if (origin) {
 | 
			
		||||
	if (origin && origin->cdr) {
 | 
			
		||||
		ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace,
 | 
			
		||||
			       sizeof(workspace), 0);
 | 
			
		||||
		if (tmp) {
 | 
			
		||||
@@ -89,6 +89,8 @@ static int pickup_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		}
 | 
			
		||||
		ast_mutex_unlock(&origin->lock);
 | 
			
		||||
	} else {
 | 
			
		||||
		if (origin)
 | 
			
		||||
			ast_mutex_unlock(&origin->lock);
 | 
			
		||||
		ast_log(LOG_DEBUG, "No originating channel found.\n");
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										170
									
								
								apps/app_directory.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										170
									
								
								apps/app_directory.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -42,6 +42,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/say.h"
 | 
			
		||||
#include "asterisk/utils.h"
 | 
			
		||||
 | 
			
		||||
#ifdef USE_ODBC_STORAGE
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <sys/mman.h>
 | 
			
		||||
#include "asterisk/res_odbc.h"
 | 
			
		||||
 | 
			
		||||
static char odbc_database[80] = "asterisk";
 | 
			
		||||
static char odbc_table[80] = "voicemessages";
 | 
			
		||||
static char vmfmts[80] = "wav";
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static char *tdesc = "Extension Directory";
 | 
			
		||||
static char *app = "Directory";
 | 
			
		||||
 | 
			
		||||
@@ -51,7 +61,7 @@ static char *descrip =
 | 
			
		||||
"the calling channel with a directory of extensions from which they can search\n"
 | 
			
		||||
"by name. The list of names and corresponding extensions is retrieved from the\n"
 | 
			
		||||
"voicemail configuration file, voicemail.conf.\n"
 | 
			
		||||
"  This applicaiton will immediate exit if one of the following DTMF digits are\n"
 | 
			
		||||
"  This application will immediately exit if one of the following DTMF digits are\n"
 | 
			
		||||
"received and the extension to jump to exists:\n"
 | 
			
		||||
"    0 - Jump to the 'o' extension, if it exists.\n"
 | 
			
		||||
"    * - Jump to the 'a' extension, if it exists.\n\n"
 | 
			
		||||
@@ -77,6 +87,101 @@ STANDARD_LOCAL_USER;
 | 
			
		||||
 | 
			
		||||
LOCAL_USER_DECL;
 | 
			
		||||
 | 
			
		||||
#ifdef USE_ODBC_STORAGE
 | 
			
		||||
static void retrieve_file(char *dir)
 | 
			
		||||
{
 | 
			
		||||
	int x = 0;
 | 
			
		||||
	int res;
 | 
			
		||||
	int fd=-1;
 | 
			
		||||
	size_t fdlen = 0;
 | 
			
		||||
	void *fdm = MAP_FAILED;
 | 
			
		||||
	SQLHSTMT stmt;
 | 
			
		||||
	char sql[256];
 | 
			
		||||
	char fmt[80]="";
 | 
			
		||||
	char *c;
 | 
			
		||||
	SQLLEN colsize;
 | 
			
		||||
	char full_fn[256];
 | 
			
		||||
 | 
			
		||||
	odbc_obj *obj;
 | 
			
		||||
	obj = fetch_odbc_obj(odbc_database, 0);
 | 
			
		||||
	if (obj) {
 | 
			
		||||
		do {
 | 
			
		||||
			ast_copy_string(fmt, vmfmts, sizeof(fmt));
 | 
			
		||||
			c = strchr(fmt, '|');
 | 
			
		||||
			if (c)
 | 
			
		||||
				*c = '\0';
 | 
			
		||||
			if (!strcasecmp(fmt, "wav49"))
 | 
			
		||||
				strcpy(fmt, "WAV");
 | 
			
		||||
			snprintf(full_fn, sizeof(full_fn), "%s.%s", dir, fmt);
 | 
			
		||||
			res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
 | 
			
		||||
			if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 | 
			
		||||
				ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			snprintf(sql, sizeof(sql), "SELECT recording FROM %s WHERE dir=? AND msgnum=-1", odbc_table);
 | 
			
		||||
			res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
 | 
			
		||||
			if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 | 
			
		||||
				ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
 | 
			
		||||
				SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(dir), 0, (void *)dir, 0, NULL);
 | 
			
		||||
			res = odbc_smart_execute(obj, stmt);
 | 
			
		||||
			if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 | 
			
		||||
				ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
 | 
			
		||||
				SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			res = SQLFetch(stmt);
 | 
			
		||||
			if (res == SQL_NO_DATA) {
 | 
			
		||||
				SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
				break;
 | 
			
		||||
			} else if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 | 
			
		||||
				ast_log(LOG_WARNING, "SQL Fetch error!\n[%s]\n\n", sql);
 | 
			
		||||
				SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC, 0770);
 | 
			
		||||
			if (fd < 0) {
 | 
			
		||||
				ast_log(LOG_WARNING, "Failed to write '%s': %s\n", full_fn, strerror(errno));
 | 
			
		||||
				SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			res = SQLGetData(stmt, 1, SQL_BINARY, NULL, 0, &colsize);
 | 
			
		||||
			fdlen = colsize;
 | 
			
		||||
			if (fd > -1) {
 | 
			
		||||
				char tmp[1]="";
 | 
			
		||||
				lseek(fd, fdlen - 1, SEEK_SET);
 | 
			
		||||
				if (write(fd, tmp, 1) != 1) {
 | 
			
		||||
					close(fd);
 | 
			
		||||
					fd = -1;
 | 
			
		||||
					break;
 | 
			
		||||
				}
 | 
			
		||||
				if (fd > -1)
 | 
			
		||||
					fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
 | 
			
		||||
			}
 | 
			
		||||
			if (fdm != MAP_FAILED) {
 | 
			
		||||
				memset(fdm, 0, fdlen);
 | 
			
		||||
				res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, fdlen, &colsize);
 | 
			
		||||
				if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 | 
			
		||||
					ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
 | 
			
		||||
					SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
					break;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
		} while (0);
 | 
			
		||||
	} else
 | 
			
		||||
		ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
 | 
			
		||||
	if (fdm != MAP_FAILED)
 | 
			
		||||
		munmap(fdm, fdlen);
 | 
			
		||||
	if (fd > -1)
 | 
			
		||||
		close(fd);
 | 
			
		||||
	return;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static char *convert(char *lastname)
 | 
			
		||||
{
 | 
			
		||||
	char *tmp;
 | 
			
		||||
@@ -151,7 +256,7 @@ static char *convert(char *lastname)
 | 
			
		||||
 *           '1' for selected entry from directory
 | 
			
		||||
 *           '*' for skipped entry from directory
 | 
			
		||||
 */
 | 
			
		||||
static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dialcontext, char *ext, char *name) {
 | 
			
		||||
static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dialcontext, char *ext, char *name, int fromappvm) {
 | 
			
		||||
	int res = 0;
 | 
			
		||||
	int loop = 3;
 | 
			
		||||
	char fn[256];
 | 
			
		||||
@@ -160,10 +265,16 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
 | 
			
		||||
	/* Check for the VoiceMail2 greeting first */
 | 
			
		||||
	snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/greet",
 | 
			
		||||
		(char *)ast_config_AST_SPOOL_DIR, context, ext);
 | 
			
		||||
#ifdef USE_ODBC_STORAGE
 | 
			
		||||
	retrieve_file(fn);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	/* Otherwise, check for an old-style Voicemail greeting */
 | 
			
		||||
	snprintf(fn2, sizeof(fn2), "%s/vm/%s/greet",
 | 
			
		||||
		(char *)ast_config_AST_SPOOL_DIR, ext);
 | 
			
		||||
#ifdef USE_ODBC_STORAGE
 | 
			
		||||
	retrieve_file(fn2);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (ast_fileexists(fn, NULL, chan->language) > 0) {
 | 
			
		||||
		res = ast_streamfile(chan, fn, chan->language);
 | 
			
		||||
@@ -181,6 +292,10 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
 | 
			
		||||
		res = ast_say_character_str(chan, !ast_strlen_zero(name) ? name : ext,
 | 
			
		||||
					AST_DIGIT_ANY, chan->language);
 | 
			
		||||
	}
 | 
			
		||||
#ifdef USE_ODBC_STORAGE
 | 
			
		||||
	ast_filedelete(fn, NULL);	
 | 
			
		||||
	ast_filedelete(fn2, NULL);	
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	while (loop) {
 | 
			
		||||
		if (!res) {
 | 
			
		||||
@@ -199,12 +314,17 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
 | 
			
		||||
				case '1':
 | 
			
		||||
					/* Name selected */
 | 
			
		||||
					loop = 0;
 | 
			
		||||
					if (ast_goto_if_exists(chan, dialcontext, ext, 1)) {
 | 
			
		||||
						ast_log(LOG_WARNING,
 | 
			
		||||
							"Can't find extension '%s' in context '%s'.  "
 | 
			
		||||
							"Did you pass the wrong context to Directory?\n",
 | 
			
		||||
							ext, dialcontext);
 | 
			
		||||
						res = -1;
 | 
			
		||||
					if (fromappvm) {
 | 
			
		||||
						/* We still want to set the exten */
 | 
			
		||||
						ast_copy_string(chan->exten, ext, sizeof(chan->exten));
 | 
			
		||||
					} else {
 | 
			
		||||
						if (ast_goto_if_exists(chan, dialcontext, ext, 1)) {
 | 
			
		||||
							ast_log(LOG_WARNING,
 | 
			
		||||
								"Can't find extension '%s' in context '%s'.  "
 | 
			
		||||
								"Did you pass the wrong context to Directory?\n",
 | 
			
		||||
								ext, dialcontext);
 | 
			
		||||
							res = -1;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					break;
 | 
			
		||||
	
 | 
			
		||||
@@ -288,7 +408,7 @@ static struct ast_config *realtime_directory(char *context)
 | 
			
		||||
	return cfg;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *context, char *dialcontext, char digit, int last)
 | 
			
		||||
static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *context, char *dialcontext, char digit, int last, int fromappvm)
 | 
			
		||||
{
 | 
			
		||||
	/* Read in the first three digits..  "digit" is the first digit, already read */
 | 
			
		||||
	char ext[NUMDIGITS + 1];
 | 
			
		||||
@@ -306,7 +426,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
	if (digit == '0') {
 | 
			
		||||
		if (!ast_goto_if_exists(chan, chan->context, "o", 1) ||
 | 
			
		||||
		if (!ast_goto_if_exists(chan, dialcontext, "o", 1) ||
 | 
			
		||||
		    (!ast_strlen_zero(chan->macrocontext) &&
 | 
			
		||||
		     !ast_goto_if_exists(chan, chan->macrocontext, "o", 1))) {
 | 
			
		||||
			return 0;
 | 
			
		||||
@@ -317,7 +437,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
 | 
			
		||||
		}
 | 
			
		||||
	}	
 | 
			
		||||
	if (digit == '*') {
 | 
			
		||||
		if (!ast_goto_if_exists(chan, chan->context, "a", 1) ||
 | 
			
		||||
		if (!ast_goto_if_exists(chan, dialcontext, "a", 1) ||
 | 
			
		||||
		    (!ast_strlen_zero(chan->macrocontext) &&
 | 
			
		||||
		     !ast_goto_if_exists(chan, chan->macrocontext, "a", 1))) {
 | 
			
		||||
			return 0;
 | 
			
		||||
@@ -350,7 +470,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
 | 
			
		||||
							pos = strrchr(pos, ' ') + 1;
 | 
			
		||||
						conv = convert(pos);
 | 
			
		||||
						if (conv) {
 | 
			
		||||
							if (!strcmp(conv, ext)) {
 | 
			
		||||
							if (!strncmp(conv, ext, strlen(ext))) {
 | 
			
		||||
								/* Match! */
 | 
			
		||||
								found++;
 | 
			
		||||
								free(conv);
 | 
			
		||||
@@ -367,7 +487,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
 | 
			
		||||
 | 
			
		||||
			if (v) {
 | 
			
		||||
				/* We have a match -- play a greeting if they have it */
 | 
			
		||||
				res = play_mailbox_owner(chan, context, dialcontext, v->name, name);
 | 
			
		||||
				res = play_mailbox_owner(chan, context, dialcontext, v->name, name, fromappvm);
 | 
			
		||||
				switch (res) {
 | 
			
		||||
					case -1:
 | 
			
		||||
						/* user pressed '1' but extension does not exist, or
 | 
			
		||||
@@ -414,6 +534,7 @@ static int directory_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	struct localuser *u;
 | 
			
		||||
	struct ast_config *cfg;
 | 
			
		||||
	int last = 1;
 | 
			
		||||
	int fromappvm = 0;
 | 
			
		||||
	char *context, *dialcontext, *dirintro, *options;
 | 
			
		||||
 | 
			
		||||
	if (ast_strlen_zero(data)) {
 | 
			
		||||
@@ -434,6 +555,8 @@ static int directory_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
			options++; 
 | 
			
		||||
			if (strchr(options, 'f'))
 | 
			
		||||
				last = 0;
 | 
			
		||||
			if (strchr(options, 'v'))
 | 
			
		||||
				fromappvm = 1;
 | 
			
		||||
		}
 | 
			
		||||
	} else	
 | 
			
		||||
		dialcontext = context;
 | 
			
		||||
@@ -466,7 +589,7 @@ static int directory_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		if (!res)
 | 
			
		||||
			res = ast_waitfordigit(chan, 5000);
 | 
			
		||||
		if (res > 0) {
 | 
			
		||||
			res = do_directory(chan, cfg, context, dialcontext, res, last);
 | 
			
		||||
			res = do_directory(chan, cfg, context, dialcontext, res, last, fromappvm);
 | 
			
		||||
			if (res > 0) {
 | 
			
		||||
				res = ast_waitstream(chan, AST_DIGIT_ANY);
 | 
			
		||||
				ast_stopstream(chan);
 | 
			
		||||
@@ -495,6 +618,25 @@ int unload_module(void)
 | 
			
		||||
 | 
			
		||||
int load_module(void)
 | 
			
		||||
{
 | 
			
		||||
#ifdef USE_ODBC_STORAGE
 | 
			
		||||
	struct ast_config *cfg = ast_config_load(VOICEMAIL_CONFIG);
 | 
			
		||||
	char *tmp;
 | 
			
		||||
 | 
			
		||||
	if (cfg) {
 | 
			
		||||
		if ((tmp = ast_variable_retrieve(cfg, "general", "odbcstorage"))) {
 | 
			
		||||
			ast_copy_string(odbc_database, tmp, sizeof(odbc_database));
 | 
			
		||||
		}
 | 
			
		||||
		if ((tmp = ast_variable_retrieve(cfg, "general", "odbctable"))) {
 | 
			
		||||
			ast_copy_string(odbc_table, tmp, sizeof(odbc_table));
 | 
			
		||||
		}
 | 
			
		||||
		if ((tmp = ast_variable_retrieve(cfg, "general", "format"))) {
 | 
			
		||||
			ast_copy_string(vmfmts, tmp, sizeof(vmfmts));
 | 
			
		||||
		}
 | 
			
		||||
		ast_config_destroy(cfg);
 | 
			
		||||
	} else
 | 
			
		||||
		ast_log(LOG_WARNING, "Unable to load " VOICEMAIL_CONFIG " - ODBC defaults will be used\n");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	return ast_register_application(app, directory_exec, synopsis, descrip);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_disa.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_disa.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										3
									
								
								apps/app_dumpchan.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										3
									
								
								apps/app_dumpchan.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -5,7 +5,8 @@
 | 
			
		||||
 *
 | 
			
		||||
 * Anthony Minessale <anthmct@yahoo.com>
 | 
			
		||||
 *
 | 
			
		||||
 * disclaimed to Digium
 | 
			
		||||
 * A license has been granted to Digium (via disclaimer) for the use of
 | 
			
		||||
 * this code.
 | 
			
		||||
 *
 | 
			
		||||
 * See http://www.asterisk.org for more information about
 | 
			
		||||
 * the Asterisk project. Please do not directly contact
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_echo.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_echo.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_enumlookup.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_enumlookup.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_eval.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_eval.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_exec.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_exec.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										54
									
								
								apps/app_externalivr.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										54
									
								
								apps/app_externalivr.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -31,6 +31,7 @@
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <signal.h>
 | 
			
		||||
 | 
			
		||||
#include "asterisk.h"
 | 
			
		||||
 | 
			
		||||
@@ -43,6 +44,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/pbx.h"
 | 
			
		||||
#include "asterisk/module.h"
 | 
			
		||||
#include "asterisk/linkedlists.h"
 | 
			
		||||
#include "asterisk/app.h"
 | 
			
		||||
#include "asterisk/options.h"
 | 
			
		||||
 | 
			
		||||
static const char *tdesc = "External IVR Interface Application";
 | 
			
		||||
 | 
			
		||||
@@ -93,9 +96,9 @@ static void send_child_event(FILE *handle, const char event, const char *data,
 | 
			
		||||
	char tmp[256];
 | 
			
		||||
 | 
			
		||||
	if (!data) {
 | 
			
		||||
		snprintf(tmp, sizeof(tmp), "%c,%10ld", event, time(NULL));
 | 
			
		||||
		snprintf(tmp, sizeof(tmp), "%c,%10d", event, (int)time(NULL));
 | 
			
		||||
	} else {
 | 
			
		||||
		snprintf(tmp, sizeof(tmp), "%c,%10ld,%s", event, time(NULL), data);
 | 
			
		||||
		snprintf(tmp, sizeof(tmp), "%c,%10d,%s", event, (int)time(NULL), data);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fprintf(handle, "%s\n", tmp);
 | 
			
		||||
@@ -150,7 +153,7 @@ static int gen_nextfile(struct gen_state *state)
 | 
			
		||||
		if (state->current) {
 | 
			
		||||
			file_to_stream = state->current->filename;
 | 
			
		||||
		} else {
 | 
			
		||||
			file_to_stream = "silence-10";
 | 
			
		||||
			file_to_stream = "silence/10";
 | 
			
		||||
			u->playing_silence = 1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -250,16 +253,19 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	int res = -1;
 | 
			
		||||
	int gen_active = 0;
 | 
			
		||||
	int pid;
 | 
			
		||||
	char *command;
 | 
			
		||||
	char *argv[32];
 | 
			
		||||
	int argc = 1;
 | 
			
		||||
	char *buf;
 | 
			
		||||
	char *buf, *command;
 | 
			
		||||
	FILE *child_commands = NULL;
 | 
			
		||||
	FILE *child_errors = NULL;
 | 
			
		||||
	FILE *child_events = NULL;
 | 
			
		||||
	sigset_t fullset, oldset;
 | 
			
		||||
 | 
			
		||||
	LOCAL_USER_ADD(u);
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	sigfillset(&fullset);
 | 
			
		||||
	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 | 
			
		||||
 | 
			
		||||
	AST_LIST_HEAD_INIT(&u->playlist);
 | 
			
		||||
	AST_LIST_HEAD_INIT(&u->finishlist);
 | 
			
		||||
	u->abort_current_sound = 0;
 | 
			
		||||
@@ -270,11 +276,13 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	buf = ast_strdupa(data);
 | 
			
		||||
	command = strsep(&buf, "|");
 | 
			
		||||
	memset(argv, 0, sizeof(argv) / sizeof(argv[0]));
 | 
			
		||||
	argv[0] = command;
 | 
			
		||||
	while ((argc < 31) && (argv[argc++] = strsep(&buf, "|")));
 | 
			
		||||
	argv[argc] = NULL;
 | 
			
		||||
	if (!buf) {
 | 
			
		||||
		ast_log(LOG_ERROR, "Out of memory!\n");
 | 
			
		||||
		LOCAL_USER_REMOVE(u);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	argc = ast_app_separate_args(buf, '|', argv, sizeof(argv) / sizeof(argv[0]));
 | 
			
		||||
 | 
			
		||||
	if (pipe(child_stdin)) {
 | 
			
		||||
		ast_chan_log(LOG_WARNING, chan, "Could not create pipe for child input: %s\n", strerror(errno));
 | 
			
		||||
@@ -311,14 +319,20 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		/* child process */
 | 
			
		||||
		int i;
 | 
			
		||||
 | 
			
		||||
		signal(SIGPIPE, SIG_DFL);
 | 
			
		||||
		pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 | 
			
		||||
 | 
			
		||||
		if (option_highpriority)
 | 
			
		||||
			ast_set_priority(0);
 | 
			
		||||
 | 
			
		||||
		dup2(child_stdin[0], STDIN_FILENO);
 | 
			
		||||
		dup2(child_stdout[1], STDOUT_FILENO);
 | 
			
		||||
		dup2(child_stderr[1], STDERR_FILENO);
 | 
			
		||||
		for (i = STDERR_FILENO + 1; i < 1024; i++)
 | 
			
		||||
			close(i);
 | 
			
		||||
		execv(command, argv);
 | 
			
		||||
		fprintf(stderr, "Failed to execute '%s': %s\n", command, strerror(errno));
 | 
			
		||||
		exit(1);
 | 
			
		||||
		execv(argv[0], argv);
 | 
			
		||||
		fprintf(stderr, "Failed to execute '%s': %s\n", argv[0], strerror(errno));
 | 
			
		||||
		_exit(1);
 | 
			
		||||
	} else {
 | 
			
		||||
		/* parent process */
 | 
			
		||||
		int child_events_fd = child_stdin[1];
 | 
			
		||||
@@ -331,6 +345,8 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		int waitfds[2] = { child_errors_fd, child_commands_fd };
 | 
			
		||||
		struct ast_channel *rchan;
 | 
			
		||||
 | 
			
		||||
		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 | 
			
		||||
 | 
			
		||||
		close(child_stdin[0]);
 | 
			
		||||
		child_stdin[0] = 0;
 | 
			
		||||
		close(child_stdout[1]);
 | 
			
		||||
@@ -343,8 +359,6 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
			goto exit;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		setvbuf(child_events, NULL, _IONBF, 0);
 | 
			
		||||
 | 
			
		||||
		if (!(child_commands = fdopen(child_commands_fd, "r"))) {
 | 
			
		||||
			ast_chan_log(LOG_WARNING, chan, "Could not open stream for child commands\n");
 | 
			
		||||
			goto exit;
 | 
			
		||||
@@ -355,6 +369,10 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
			goto exit;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		setvbuf(child_events, NULL, _IONBF, 0);
 | 
			
		||||
		setvbuf(child_commands, NULL, _IONBF, 0);
 | 
			
		||||
		setvbuf(child_errors, NULL, _IONBF, 0);
 | 
			
		||||
 | 
			
		||||
		res = 0;
 | 
			
		||||
 | 
			
		||||
		while (1) {
 | 
			
		||||
@@ -439,7 +457,7 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
					continue;
 | 
			
		||||
 | 
			
		||||
				if (input[0] == 'S') {
 | 
			
		||||
					if (ast_fileexists(&input[2], NULL, NULL) == -1) {
 | 
			
		||||
					if (ast_fileexists(&input[2], NULL, u->chan->language) == -1) {
 | 
			
		||||
						ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);
 | 
			
		||||
						send_child_event(child_events, 'Z', NULL, chan);
 | 
			
		||||
						strcpy(&input[2], "exception");
 | 
			
		||||
@@ -458,7 +476,7 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
						AST_LIST_INSERT_TAIL(&u->playlist, entry, list);
 | 
			
		||||
					AST_LIST_UNLOCK(&u->playlist);
 | 
			
		||||
				} else if (input[0] == 'A') {
 | 
			
		||||
					if (ast_fileexists(&input[2], NULL, NULL) == -1) {
 | 
			
		||||
					if (ast_fileexists(&input[2], NULL, u->chan->language) == -1) {
 | 
			
		||||
						ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);
 | 
			
		||||
						send_child_event(child_events, 'Z', NULL, chan);
 | 
			
		||||
						strcpy(&input[2], "exception");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										35
									
								
								apps/app_festival.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										35
									
								
								apps/app_festival.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -53,6 +53,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/config.h"
 | 
			
		||||
#include "asterisk/utils.h"
 | 
			
		||||
#include "asterisk/lock.h"
 | 
			
		||||
#include "asterisk/options.h"
 | 
			
		||||
 | 
			
		||||
#define FESTIVAL_CONFIG "festival.conf"
 | 
			
		||||
 | 
			
		||||
@@ -126,16 +127,26 @@ static int send_waveform_to_fd(char *waveform, int length, int fd) {
 | 
			
		||||
#ifdef __PPC__ 
 | 
			
		||||
	char c;
 | 
			
		||||
#endif
 | 
			
		||||
	sigset_t fullset, oldset;
 | 
			
		||||
 | 
			
		||||
	sigfillset(&fullset);
 | 
			
		||||
	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 | 
			
		||||
 | 
			
		||||
        res = fork();
 | 
			
		||||
        if (res < 0)
 | 
			
		||||
                ast_log(LOG_WARNING, "Fork failed\n");
 | 
			
		||||
        if (res)
 | 
			
		||||
        if (res) {
 | 
			
		||||
		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 | 
			
		||||
                return res;
 | 
			
		||||
	}
 | 
			
		||||
        for (x=0;x<256;x++) {
 | 
			
		||||
                if (x != fd)
 | 
			
		||||
                        close(x);
 | 
			
		||||
        }
 | 
			
		||||
	if (option_highpriority)
 | 
			
		||||
		ast_set_priority(0);
 | 
			
		||||
	signal(SIGPIPE, SIG_DFL);
 | 
			
		||||
	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 | 
			
		||||
/*IAS */
 | 
			
		||||
#ifdef __PPC__  
 | 
			
		||||
	for( x=0; x<length; x+=2)
 | 
			
		||||
@@ -175,7 +186,8 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in
 | 
			
		||||
	if (chan->_state != AST_STATE_UP)
 | 
			
		||||
		ast_answer(chan);
 | 
			
		||||
	ast_stopstream(chan);
 | 
			
		||||
 | 
			
		||||
	ast_indicate(chan, -1);
 | 
			
		||||
	
 | 
			
		||||
	owriteformat = chan->writeformat;
 | 
			
		||||
	res = ast_set_write_format(chan, AST_FORMAT_SLINEAR);
 | 
			
		||||
	if (res < 0) {
 | 
			
		||||
@@ -229,11 +241,13 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in
 | 
			
		||||
					myf.f.data = myf.frdata;
 | 
			
		||||
					if (ast_write(chan, &myf.f) < 0) {
 | 
			
		||||
						res = -1;
 | 
			
		||||
						ast_frfree(f);
 | 
			
		||||
						break;
 | 
			
		||||
					}
 | 
			
		||||
					if (res < needed) { /* last frame */
 | 
			
		||||
						ast_log(LOG_DEBUG, "Last frame\n");
 | 
			
		||||
						res=0;
 | 
			
		||||
						ast_frfree(f);
 | 
			
		||||
						break;
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
@@ -455,8 +469,23 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
 | 
			
		||||
	/* This assumes only one waveform will come back, also LP is unlikely */
 | 
			
		||||
	wave = 0;
 | 
			
		||||
	do {
 | 
			
		||||
               int read_data;
 | 
			
		||||
		for (n=0; n < 3; )
 | 
			
		||||
			n += read(fd,ack+n,3-n);
 | 
			
		||||
               {
 | 
			
		||||
                       read_data = read(fd,ack+n,3-n);
 | 
			
		||||
                       /* this avoids falling in infinite loop
 | 
			
		||||
                        * in case that festival server goes down
 | 
			
		||||
                        * */
 | 
			
		||||
                       if ( read_data == -1 )
 | 
			
		||||
                       {
 | 
			
		||||
                               ast_log(LOG_WARNING,"Unable to read from cache/festival fd\n");
 | 
			
		||||
			       close(fd);
 | 
			
		||||
			       ast_config_destroy(cfg);
 | 
			
		||||
			       LOCAL_USER_REMOVE(u);
 | 
			
		||||
                               return -1;
 | 
			
		||||
                       }
 | 
			
		||||
                       n += read_data;
 | 
			
		||||
               }
 | 
			
		||||
		ack[3] = '\0';
 | 
			
		||||
		if (strcmp(ack,"WV\n") == 0) {         /* receive a waveform */
 | 
			
		||||
			ast_log(LOG_DEBUG,"Festival WV command\n");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_flash.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_flash.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_forkcdr.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_forkcdr.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_getcpeid.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_getcpeid.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										16
									
								
								apps/app_groupcount.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										16
									
								
								apps/app_groupcount.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -70,7 +70,8 @@ static int group_count_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
 | 
			
		||||
	if (ast_strlen_zero(group)) {
 | 
			
		||||
		grp = pbx_builtin_getvar_helper(chan, category);
 | 
			
		||||
		strncpy(group, grp, sizeof(group) - 1);
 | 
			
		||||
		if (!ast_strlen_zero(grp))
 | 
			
		||||
			ast_copy_string(group, grp, sizeof(group));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	count = ast_app_group_get_count(group, category);
 | 
			
		||||
@@ -154,6 +155,11 @@ static int group_check_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		deprecation_warning = 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (ast_strlen_zero(data)) {
 | 
			
		||||
		ast_log(LOG_WARNING, "CheckGroup requires an argument(max[@category][|options])\n");
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!(parse = ast_strdupa(data))) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Memory Error!\n");
 | 
			
		||||
		LOCAL_USER_REMOVE(u);
 | 
			
		||||
@@ -257,8 +263,8 @@ static char *group_count_descrip =
 | 
			
		||||
"  Calculates the group count for the specified group, or uses\n"
 | 
			
		||||
"the current channel's group if not specifed (and non-empty).\n"
 | 
			
		||||
"Stores result in GROUPCOUNT. \n"
 | 
			
		||||
"This application has been deprecated, please use the function\n"
 | 
			
		||||
"GroupCount.\n";
 | 
			
		||||
"Note: This application has been deprecated, please use the function\n"
 | 
			
		||||
"GROUP_COUNT.\n";
 | 
			
		||||
 | 
			
		||||
static char *group_set_descrip =
 | 
			
		||||
"Usage: SetGroup(groupname[@category])\n"
 | 
			
		||||
@@ -284,8 +290,8 @@ static char *group_match_count_descrip =
 | 
			
		||||
"  Calculates the group count for all groups that match the specified\n"
 | 
			
		||||
"pattern. Uses standard regular expression matching (see regex(7)).\n"
 | 
			
		||||
"Stores result in GROUPCOUNT.  Always returns 0.\n"
 | 
			
		||||
"This application has been deprecated, please use the function\n"
 | 
			
		||||
"GroupMatchCount.\n";
 | 
			
		||||
"Note: This application has been deprecated, please use the function\n"
 | 
			
		||||
"GROUP_MATCH_COUNT.\n";
 | 
			
		||||
 | 
			
		||||
static char show_channels_usage[] = 
 | 
			
		||||
"Usage: group show channels [pattern]\n"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										134
									
								
								apps/app_hasnewvoicemail.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										134
									
								
								apps/app_hasnewvoicemail.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -47,6 +47,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/utils.h"
 | 
			
		||||
#include "asterisk/app.h"
 | 
			
		||||
#include "asterisk/options.h"
 | 
			
		||||
#ifdef USE_ODBC_STORAGE
 | 
			
		||||
#include "asterisk/res_odbc.h"
 | 
			
		||||
 | 
			
		||||
static char odbc_database[80];
 | 
			
		||||
static char odbc_table[80];
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static char *tdesc = "Indicator for whether a voice mailbox has messages in a given folder.";
 | 
			
		||||
static char *app_hasvoicemail = "HasVoicemail";
 | 
			
		||||
@@ -68,7 +74,7 @@ static char *hasnewvoicemail_descrip =
 | 
			
		||||
"Assumes folder 'INBOX' if folder is not specified. Optionally sets <varname> to the number of messages\n" 
 | 
			
		||||
"in that folder.\n"
 | 
			
		||||
"  The option string may contain zero of the following character:\n"
 | 
			
		||||
"	'j' -- jump to priority n+101, if there is new voicemail in tolder 'folder' or INBOX\n"
 | 
			
		||||
"	'j' -- jump to priority n+101, if there is new voicemail in folder 'folder' or INBOX\n"
 | 
			
		||||
"  This application sets the following channel variable upon completion:\n"
 | 
			
		||||
"	HASVMSTATUS		The result of the new voicemail check returned as a text string as follows\n"
 | 
			
		||||
"		<# of messages in the folder, 0 for NONE>\n";
 | 
			
		||||
@@ -77,26 +83,93 @@ STANDARD_LOCAL_USER;
 | 
			
		||||
 | 
			
		||||
LOCAL_USER_DECL;
 | 
			
		||||
 | 
			
		||||
static int hasvoicemail_internal(char *context, char *box, char *folder)
 | 
			
		||||
#ifdef USE_ODBC_STORAGE
 | 
			
		||||
static int hasvoicemail_internal(const char *context, const char *mailbox, const char *folder)
 | 
			
		||||
{
 | 
			
		||||
	char vmpath[256];
 | 
			
		||||
	DIR *vmdir;
 | 
			
		||||
	struct dirent *vment;
 | 
			
		||||
	int count=0;
 | 
			
		||||
	int nummsgs = 0;
 | 
			
		||||
	int res;
 | 
			
		||||
	SQLHSTMT stmt;
 | 
			
		||||
	char sql[256];
 | 
			
		||||
	char rowdata[20];
 | 
			
		||||
 | 
			
		||||
	snprintf(vmpath,sizeof(vmpath), "%s/voicemail/%s/%s/%s", (char *)ast_config_AST_SPOOL_DIR, context, box, folder);
 | 
			
		||||
	if ((vmdir = opendir(vmpath))) {
 | 
			
		||||
		/* No matter what the format of VM, there will always be a .txt file for each message. */
 | 
			
		||||
		while ((vment = readdir(vmdir))) {
 | 
			
		||||
			if (!strncmp(vment->d_name + 7, ".txt", 4)) {
 | 
			
		||||
				count++;
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
	if (!folder)
 | 
			
		||||
		folder = "INBOX";
 | 
			
		||||
	/* If no mailbox, return immediately */
 | 
			
		||||
	if (ast_strlen_zero(mailbox))
 | 
			
		||||
		return 0;
 | 
			
		||||
	if (ast_strlen_zero(context))
 | 
			
		||||
		context = "default";
 | 
			
		||||
 | 
			
		||||
	odbc_obj *obj;
 | 
			
		||||
	obj = fetch_odbc_obj(odbc_database, 0);
 | 
			
		||||
	if (obj) {
 | 
			
		||||
		res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
 | 
			
		||||
		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 | 
			
		||||
			ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
 | 
			
		||||
			goto yuck;
 | 
			
		||||
		}
 | 
			
		||||
		closedir(vmdir);
 | 
			
		||||
		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s/voicemail/%s/%s/%s'", odbc_table, ast_config_AST_SPOOL_DIR, context, mailbox, folder);
 | 
			
		||||
		res = SQLPrepare(stmt, sql, SQL_NTS);
 | 
			
		||||
		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {  
 | 
			
		||||
			ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
 | 
			
		||||
			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
			goto yuck;
 | 
			
		||||
		}
 | 
			
		||||
		res = odbc_smart_execute(obj, stmt);
 | 
			
		||||
		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 | 
			
		||||
			ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
 | 
			
		||||
			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
			goto yuck;
 | 
			
		||||
		}
 | 
			
		||||
		res = SQLFetch(stmt);
 | 
			
		||||
		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 | 
			
		||||
			ast_log(LOG_WARNING, "SQL Fetch error!\n[%s]\n\n", sql);
 | 
			
		||||
			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
			goto yuck;
 | 
			
		||||
		}
 | 
			
		||||
		res = SQLGetData(stmt, 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
 | 
			
		||||
		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 | 
			
		||||
			ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
 | 
			
		||||
			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
			goto yuck;
 | 
			
		||||
		}
 | 
			
		||||
		nummsgs = atoi(rowdata);
 | 
			
		||||
		SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 | 
			
		||||
	} else
 | 
			
		||||
		ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
 | 
			
		||||
 | 
			
		||||
yuck:
 | 
			
		||||
	return nummsgs;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
static int hasvoicemail_internal(const char *context, const char *mailbox, const char *folder)
 | 
			
		||||
{
 | 
			
		||||
	DIR *dir;
 | 
			
		||||
	struct dirent *de;
 | 
			
		||||
	char fn[256];
 | 
			
		||||
	int count = 0;
 | 
			
		||||
 | 
			
		||||
	if (ast_strlen_zero(folder))
 | 
			
		||||
		folder = "INBOX";
 | 
			
		||||
	if (ast_strlen_zero(context))
 | 
			
		||||
		context = "default";
 | 
			
		||||
	/* If no mailbox, return immediately */
 | 
			
		||||
	if (ast_strlen_zero(mailbox))
 | 
			
		||||
		return 0;
 | 
			
		||||
	snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/%s", ast_config_AST_SPOOL_DIR, context, mailbox, folder);
 | 
			
		||||
	dir = opendir(fn);
 | 
			
		||||
	if (!dir)
 | 
			
		||||
		return 0;
 | 
			
		||||
	while ((de = readdir(dir))) {
 | 
			
		||||
		if (!strncasecmp(de->d_name, "msg", 3) && !strcasecmp(de->d_name + 8, "txt"))
 | 
			
		||||
			count++;
 | 
			
		||||
	}
 | 
			
		||||
	closedir(dir);
 | 
			
		||||
	return count;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static int hasvoicemail_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
{
 | 
			
		||||
@@ -163,7 +236,7 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	if (vmcount > 0) {
 | 
			
		||||
		/* Branch to the next extension */
 | 
			
		||||
		if (priority_jump || option_priority_jumping) {
 | 
			
		||||
			if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) 
 | 
			
		||||
			if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) 
 | 
			
		||||
				ast_log(LOG_WARNING, "VM box %s@%s has new voicemail, but extension %s, priority %d doesn't exist\n", vmbox, context, chan->exten, chan->priority + 101);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -187,7 +260,7 @@ static char *acf_vmcount_exec(struct ast_channel *chan, char *cmd, char *data, c
 | 
			
		||||
 | 
			
		||||
	args = ast_strdupa(data);
 | 
			
		||||
	if (!args) {
 | 
			
		||||
		ast_log(LOG_ERROR, "Out of memory");
 | 
			
		||||
		ast_log(LOG_ERROR, "Out of memory\n");
 | 
			
		||||
		LOCAL_USER_REMOVE(u);
 | 
			
		||||
		return buf;
 | 
			
		||||
	}
 | 
			
		||||
@@ -223,6 +296,31 @@ struct ast_custom_function acf_vmcount = {
 | 
			
		||||
	.read = acf_vmcount_exec,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static int load_config(void)
 | 
			
		||||
{
 | 
			
		||||
#ifdef USE_ODBC_STORAGE
 | 
			
		||||
	struct ast_config *cfg;
 | 
			
		||||
	char *tmp;
 | 
			
		||||
	cfg = ast_config_load("voicemail.conf");
 | 
			
		||||
	if (cfg) {
 | 
			
		||||
		if (! (tmp = ast_variable_retrieve(cfg, "general", "odbcstorage")))
 | 
			
		||||
			tmp = "asterisk";
 | 
			
		||||
		ast_copy_string(odbc_database, tmp, sizeof(odbc_database));
 | 
			
		||||
 | 
			
		||||
		if (! (tmp = ast_variable_retrieve(cfg, "general", "odbctable")))
 | 
			
		||||
			tmp = "voicemessages";
 | 
			
		||||
		ast_copy_string(odbc_table, tmp, sizeof(odbc_table));
 | 
			
		||||
		ast_config_destroy(cfg);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int reload(void)
 | 
			
		||||
{
 | 
			
		||||
	return load_config();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int unload_module(void)
 | 
			
		||||
{
 | 
			
		||||
	int res;
 | 
			
		||||
@@ -239,7 +337,7 @@ int unload_module(void)
 | 
			
		||||
int load_module(void)
 | 
			
		||||
{
 | 
			
		||||
	int res;
 | 
			
		||||
 | 
			
		||||
	load_config();
 | 
			
		||||
	res = ast_custom_function_register(&acf_vmcount);
 | 
			
		||||
	res |= ast_register_application(app_hasvoicemail, hasvoicemail_exec, hasvoicemail_synopsis, hasvoicemail_descrip);
 | 
			
		||||
	res |= ast_register_application(app_hasnewvoicemail, hasvoicemail_exec, hasnewvoicemail_synopsis, hasnewvoicemail_descrip);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										22
									
								
								apps/app_ices.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										22
									
								
								apps/app_ices.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -44,6 +44,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/pbx.h"
 | 
			
		||||
#include "asterisk/module.h"
 | 
			
		||||
#include "asterisk/translate.h"
 | 
			
		||||
#include "asterisk/options.h"
 | 
			
		||||
 | 
			
		||||
#define ICES "/usr/bin/ices"
 | 
			
		||||
#define LOCAL_ICES "/usr/local/bin/ices"
 | 
			
		||||
@@ -67,13 +68,27 @@ static int icesencode(char *filename, int fd)
 | 
			
		||||
{
 | 
			
		||||
	int res;
 | 
			
		||||
	int x;
 | 
			
		||||
	sigset_t fullset, oldset;
 | 
			
		||||
 | 
			
		||||
	sigfillset(&fullset);
 | 
			
		||||
	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 | 
			
		||||
 | 
			
		||||
	res = fork();
 | 
			
		||||
	if (res < 0) 
 | 
			
		||||
		ast_log(LOG_WARNING, "Fork failed\n");
 | 
			
		||||
	if (res)
 | 
			
		||||
	if (res) {
 | 
			
		||||
		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Stop ignoring PIPE */
 | 
			
		||||
	signal(SIGPIPE, SIG_DFL);
 | 
			
		||||
	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 | 
			
		||||
 | 
			
		||||
	if (option_highpriority)
 | 
			
		||||
		ast_set_priority(0);
 | 
			
		||||
	dup2(fd, STDIN_FILENO);
 | 
			
		||||
	for (x=STDERR_FILENO + 1;x<256;x++) {
 | 
			
		||||
	for (x=STDERR_FILENO + 1;x<1024;x++) {
 | 
			
		||||
		if ((x != STDIN_FILENO) && (x != STDOUT_FILENO))
 | 
			
		||||
			close(x);
 | 
			
		||||
	}
 | 
			
		||||
@@ -84,7 +99,7 @@ static int icesencode(char *filename, int fd)
 | 
			
		||||
	/* As a last-ditch effort, try to use PATH */
 | 
			
		||||
	execlp("ices", "ices", filename, (char *)NULL);
 | 
			
		||||
	ast_log(LOG_WARNING, "Execute of ices failed\n");
 | 
			
		||||
	return -1;
 | 
			
		||||
	_exit(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int ices_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
@@ -172,6 +187,7 @@ static int ices_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
					if (errno != EAGAIN) {
 | 
			
		||||
						ast_log(LOG_WARNING, "Write failed to pipe: %s\n", strerror(errno));
 | 
			
		||||
						res = -1;
 | 
			
		||||
						ast_frfree(f);
 | 
			
		||||
						break;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_image.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_image.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_intercom.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_intercom.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_ivrdemo.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_ivrdemo.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_lookupblacklist.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_lookupblacklist.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_lookupcidname.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_lookupcidname.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										190
									
								
								apps/app_macro.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										190
									
								
								apps/app_macro.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -60,7 +60,18 @@ static char *descrip =
 | 
			
		||||
"If you Goto out of the Macro context, the Macro will terminate and control\n"
 | 
			
		||||
"will be returned at the location of the Goto.\n"
 | 
			
		||||
"If ${MACRO_OFFSET} is set at termination, Macro will attempt to continue\n"
 | 
			
		||||
"at priority MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.\n";
 | 
			
		||||
"at priority MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.\n"
 | 
			
		||||
"Extensions: While a macro is being executed, it becomes the current context.\n"
 | 
			
		||||
"            This means that if a hangup occurs, for instance, that the macro\n"
 | 
			
		||||
"            will be searched for an 'h' extension, NOT the context from which\n"
 | 
			
		||||
"            the macro was called. So, make sure to define all appropriate\n"
 | 
			
		||||
"            extensions in your macro! (you can use 'catch' in AEL) \n"
 | 
			
		||||
"WARNING: Because of the way Macro is implemented (it executes the priorities\n"
 | 
			
		||||
"         contained within it via sub-engine), and a fixed per-thread\n"
 | 
			
		||||
"         memory stack allowance, macros are limited to 7 levels\n"
 | 
			
		||||
"         of nesting (macro calling macro calling macro, etc.); It\n"
 | 
			
		||||
"         may be possible that stack-intensive applications in deeply nested\n"
 | 
			
		||||
"         macros could cause asterisk to crash earlier than this limit.\n";
 | 
			
		||||
 | 
			
		||||
static char *if_descrip =
 | 
			
		||||
"  MacroIf(<expr>?macroname_a[|arg1][:macroname_b[|arg1]])\n"
 | 
			
		||||
@@ -87,6 +98,41 @@ STANDARD_LOCAL_USER;
 | 
			
		||||
 | 
			
		||||
LOCAL_USER_DECL;
 | 
			
		||||
 | 
			
		||||
static struct ast_exten *find_matching_priority(struct ast_context *c, const char *exten, int priority, const char *callerid)
 | 
			
		||||
{
 | 
			
		||||
	struct ast_exten *e;
 | 
			
		||||
	struct ast_include *i;
 | 
			
		||||
	struct ast_context *c2;
 | 
			
		||||
 | 
			
		||||
	for (e=ast_walk_context_extensions(c, NULL); e; e=ast_walk_context_extensions(c, e)) {
 | 
			
		||||
		if (ast_extension_match(ast_get_extension_name(e), exten)) {
 | 
			
		||||
			int needmatch = ast_get_extension_matchcid(e);
 | 
			
		||||
			if ((needmatch && ast_extension_match(ast_get_extension_cidmatch(e), callerid)) ||
 | 
			
		||||
				(!needmatch)) {
 | 
			
		||||
				/* This is the matching extension we want */
 | 
			
		||||
				struct ast_exten *p;
 | 
			
		||||
				for (p=ast_walk_extension_priorities(e, NULL); p; p=ast_walk_extension_priorities(e, p)) {
 | 
			
		||||
					if (priority != ast_get_extension_priority(p))
 | 
			
		||||
						continue;
 | 
			
		||||
					return p;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* No match; run through includes */
 | 
			
		||||
	for (i=ast_walk_context_includes(c, NULL); i; i=ast_walk_context_includes(c, i)) {
 | 
			
		||||
		for (c2=ast_walk_contexts(NULL); c2; c2=ast_walk_contexts(c2)) {
 | 
			
		||||
			if (!strcmp(ast_get_context_name(c2), ast_get_include_name(i))) {
 | 
			
		||||
				e = find_matching_priority(c2, exten, priority, callerid);
 | 
			
		||||
				if (e)
 | 
			
		||||
					return e;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int macro_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
{
 | 
			
		||||
	char *tmp;
 | 
			
		||||
@@ -98,13 +144,13 @@ static int macro_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	int argc, x;
 | 
			
		||||
	int res=0;
 | 
			
		||||
	char oldexten[256]="";
 | 
			
		||||
	int oldpriority;
 | 
			
		||||
	int oldpriority, gosub_level = 0;
 | 
			
		||||
	char pc[80], depthc[12];
 | 
			
		||||
	char oldcontext[AST_MAX_CONTEXT] = "";
 | 
			
		||||
	char *offsets;
 | 
			
		||||
	int offset, depth;
 | 
			
		||||
	char *offsets, *s, *inhangupc;
 | 
			
		||||
	int offset, depth = 0, maxdepth = 7;
 | 
			
		||||
	int setmacrocontext=0;
 | 
			
		||||
	int autoloopflag;
 | 
			
		||||
	int autoloopflag, dead = 0, inhangup = 0;
 | 
			
		||||
  
 | 
			
		||||
	char *save_macro_exten;
 | 
			
		||||
	char *save_macro_context;
 | 
			
		||||
@@ -112,6 +158,9 @@ static int macro_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	char *save_macro_offset;
 | 
			
		||||
	struct localuser *u;
 | 
			
		||||
 
 | 
			
		||||
	struct ast_context *c;
 | 
			
		||||
	struct ast_exten *e;
 | 
			
		||||
 | 
			
		||||
	if (ast_strlen_zero(data)) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Macro() requires arguments. See \"show application macro\" for help.\n");
 | 
			
		||||
		return -1;
 | 
			
		||||
@@ -119,6 +168,11 @@ static int macro_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
 | 
			
		||||
	LOCAL_USER_ADD(u);
 | 
			
		||||
 | 
			
		||||
	/* does the user want a deeper rabbit hole? */
 | 
			
		||||
	s = pbx_builtin_getvar_helper(chan, "MACRO_RECURSION");
 | 
			
		||||
	if (s)
 | 
			
		||||
		sscanf(s, "%d", &maxdepth);
 | 
			
		||||
 | 
			
		||||
	/* Count how many levels deep the rabbit hole goes */
 | 
			
		||||
	tmp = pbx_builtin_getvar_helper(chan, "MACRO_DEPTH");
 | 
			
		||||
	if (tmp) {
 | 
			
		||||
@@ -127,7 +181,14 @@ static int macro_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		depth = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (depth >= 7) {
 | 
			
		||||
	/* Used for detecting whether to return when a Macro is called from another Macro after hangup */
 | 
			
		||||
	if (strcmp(chan->exten, "h") == 0)
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "MACRO_IN_HANGUP", "1");
 | 
			
		||||
	inhangupc = pbx_builtin_getvar_helper(chan, "MACRO_IN_HANGUP");
 | 
			
		||||
	if (!ast_strlen_zero(inhangupc))
 | 
			
		||||
		sscanf(inhangupc, "%d", &inhangup);
 | 
			
		||||
 | 
			
		||||
	if (depth >= maxdepth) {
 | 
			
		||||
		ast_log(LOG_ERROR, "Macro():  possible infinite loop detected.  Returning early.\n");
 | 
			
		||||
		LOCAL_USER_REMOVE(u);
 | 
			
		||||
		return 0;
 | 
			
		||||
@@ -205,8 +266,17 @@ static int macro_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP);
 | 
			
		||||
	ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP);
 | 
			
		||||
	while(ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
 | 
			
		||||
		/* What application will execute? */
 | 
			
		||||
		for (c = ast_walk_contexts(NULL), e = NULL; c; c = ast_walk_contexts(c)) {
 | 
			
		||||
			if (!strcmp(ast_get_context_name(c), chan->context)) {
 | 
			
		||||
				e = find_matching_priority(c, chan->exten, chan->priority, chan->cid.cid_num);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* Reset the macro depth, if it was changed in the last iteration */
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
 | 
			
		||||
 | 
			
		||||
		if ((res = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num))) {
 | 
			
		||||
			/* Something bad happened, or a hangup has been requested. */
 | 
			
		||||
			if (((res >= '0') && (res <= '9')) || ((res >= 'A') && (res <= 'F')) ||
 | 
			
		||||
@@ -216,33 +286,93 @@ static int macro_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			switch(res) {
 | 
			
		||||
	        	case MACRO_EXIT_RESULT:
 | 
			
		||||
                        	res = 0;
 | 
			
		||||
			case MACRO_EXIT_RESULT:
 | 
			
		||||
				res = 0;
 | 
			
		||||
				goto out;
 | 
			
		||||
			case AST_PBX_KEEPALIVE:
 | 
			
		||||
				if (option_debug)
 | 
			
		||||
					ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited KEEPALIVE in macro %s on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
 | 
			
		||||
				else if (option_verbose > 1)
 | 
			
		||||
				if (option_verbose > 1)
 | 
			
		||||
					ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
 | 
			
		||||
				goto out;
 | 
			
		||||
				break;
 | 
			
		||||
			default:
 | 
			
		||||
				if (option_debug)
 | 
			
		||||
					ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
 | 
			
		||||
				else if (option_verbose > 1)
 | 
			
		||||
				if (option_verbose > 1)
 | 
			
		||||
					ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
 | 
			
		||||
				dead = 1;
 | 
			
		||||
				goto out;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if (strcasecmp(chan->context, fullmacro)) {
 | 
			
		||||
 | 
			
		||||
		ast_log(LOG_DEBUG, "Executed application: %s\n", ast_get_extension_app(e));
 | 
			
		||||
 | 
			
		||||
		if (e && !strcasecmp(ast_get_extension_app(e), "GOSUB")) {
 | 
			
		||||
			gosub_level++;
 | 
			
		||||
			ast_log(LOG_DEBUG, "Incrementing gosub_level\n");
 | 
			
		||||
		} else if (e && !strcasecmp(ast_get_extension_app(e), "GOSUBIF")) {
 | 
			
		||||
			const char *tmp = ast_get_extension_app_data(e);
 | 
			
		||||
			char tmp2[1024] = "", *cond, *app, *app2 = tmp2;
 | 
			
		||||
			pbx_substitute_variables_helper(chan, tmp, tmp2, sizeof(tmp2) - 1);
 | 
			
		||||
			cond = strsep(&app2, "?");
 | 
			
		||||
			app = strsep(&app2, ":");
 | 
			
		||||
			if (pbx_checkcondition(cond)) {
 | 
			
		||||
				if (!ast_strlen_zero(app)) {
 | 
			
		||||
					gosub_level++;
 | 
			
		||||
					ast_log(LOG_DEBUG, "Incrementing gosub_level\n");
 | 
			
		||||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
				if (!ast_strlen_zero(app2)) {
 | 
			
		||||
					gosub_level++;
 | 
			
		||||
					ast_log(LOG_DEBUG, "Incrementing gosub_level\n");
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		} else if (e && !strcasecmp(ast_get_extension_app(e), "RETURN")) {
 | 
			
		||||
			gosub_level--;
 | 
			
		||||
			ast_log(LOG_DEBUG, "Decrementing gosub_level\n");
 | 
			
		||||
		} else if (e && !strcasecmp(ast_get_extension_app(e), "STACKPOP")) {
 | 
			
		||||
			gosub_level--;
 | 
			
		||||
			ast_log(LOG_DEBUG, "Decrementing gosub_level\n");
 | 
			
		||||
		} else if (e && !strncasecmp(ast_get_extension_app(e), "EXEC", 4)) {
 | 
			
		||||
			/* Must evaluate args to find actual app */
 | 
			
		||||
			const char *tmp = ast_get_extension_app_data(e);
 | 
			
		||||
			char tmp2[1024] = "", *tmp3 = NULL;
 | 
			
		||||
			pbx_substitute_variables_helper(chan, tmp, tmp2, sizeof(tmp2) - 1);
 | 
			
		||||
			if (!strcasecmp(ast_get_extension_app(e), "EXECIF")) {
 | 
			
		||||
				tmp3 = strchr(tmp2, '|');
 | 
			
		||||
				if (tmp3)
 | 
			
		||||
					*tmp3++ = '\0';
 | 
			
		||||
				if (!pbx_checkcondition(tmp2))
 | 
			
		||||
					tmp3 = NULL;
 | 
			
		||||
			} else
 | 
			
		||||
				tmp3 = tmp2;
 | 
			
		||||
 | 
			
		||||
			if (tmp3)
 | 
			
		||||
				ast_log(LOG_DEBUG, "Last app: %s\n", tmp3);
 | 
			
		||||
 | 
			
		||||
			if (tmp3 && !strncasecmp(tmp3, "GOSUB", 5)) {
 | 
			
		||||
				gosub_level++;
 | 
			
		||||
				ast_log(LOG_DEBUG, "Incrementing gosub_level\n");
 | 
			
		||||
			} else if (tmp3 && !strncasecmp(tmp3, "RETURN", 6)) {
 | 
			
		||||
				gosub_level--;
 | 
			
		||||
				ast_log(LOG_DEBUG, "Decrementing gosub_level\n");
 | 
			
		||||
			} else if (tmp3 && !strncasecmp(tmp3, "STACKPOP", 8)) {
 | 
			
		||||
				gosub_level--;
 | 
			
		||||
				ast_log(LOG_DEBUG, "Decrementing gosub_level\n");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (gosub_level == 0 && strcasecmp(chan->context, fullmacro)) {
 | 
			
		||||
			if (option_verbose > 1)
 | 
			
		||||
				ast_verbose(VERBOSE_PREFIX_2 "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* don't stop executing extensions when we're in "h" */
 | 
			
		||||
		if (chan->_softhangup && strcasecmp(oldexten,"h")) {
 | 
			
		||||
			ast_log(LOG_DEBUG, "Extension %s, priority %d returned normally even though call was hung up\n",
 | 
			
		||||
				chan->exten, chan->priority);
 | 
			
		||||
		if (chan->_softhangup && !inhangup) {
 | 
			
		||||
			ast_log(LOG_DEBUG, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n",
 | 
			
		||||
				chan->exten, chan->macroexten, chan->priority);
 | 
			
		||||
			goto out;
 | 
			
		||||
		}
 | 
			
		||||
		chan->priority++;
 | 
			
		||||
@@ -250,37 +380,44 @@ static int macro_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	out:
 | 
			
		||||
	/* Reset the depth back to what it was when the routine was entered (like if we called Macro recursively) */
 | 
			
		||||
	snprintf(depthc, sizeof(depthc), "%d", depth);
 | 
			
		||||
	pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
 | 
			
		||||
	if (!dead) {
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
 | 
			
		||||
 | 
			
		||||
	ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
 | 
			
		||||
  	for (x=1; x<argc; x++) {
 | 
			
		||||
		ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
  	for (x = 1; x < argc; x++) {
 | 
			
		||||
  		/* Restore old arguments and delete ours */
 | 
			
		||||
		snprintf(varname, sizeof(varname), "ARG%d", x);
 | 
			
		||||
  		if (oldargs[x]) {
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
 | 
			
		||||
			if (!dead)
 | 
			
		||||
				pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
 | 
			
		||||
			free(oldargs[x]);
 | 
			
		||||
		} else {
 | 
			
		||||
		} else if (!dead) {
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, varname, NULL);
 | 
			
		||||
		}
 | 
			
		||||
  	}
 | 
			
		||||
 | 
			
		||||
	/* Restore macro variables */
 | 
			
		||||
	pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
 | 
			
		||||
	if (!dead) {
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
 | 
			
		||||
	}
 | 
			
		||||
	if (save_macro_exten)
 | 
			
		||||
		free(save_macro_exten);
 | 
			
		||||
	pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
 | 
			
		||||
	if (save_macro_context)
 | 
			
		||||
		free(save_macro_context);
 | 
			
		||||
	pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
 | 
			
		||||
	if (save_macro_priority)
 | 
			
		||||
		free(save_macro_priority);
 | 
			
		||||
	if (setmacrocontext) {
 | 
			
		||||
 | 
			
		||||
	if (!dead && setmacrocontext) {
 | 
			
		||||
		chan->macrocontext[0] = '\0';
 | 
			
		||||
		chan->macroexten[0] = '\0';
 | 
			
		||||
		chan->macropriority = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!strcasecmp(chan->context, fullmacro)) {
 | 
			
		||||
	if (!dead && !strcasecmp(chan->context, fullmacro)) {
 | 
			
		||||
  		/* If we're leaving the macro normally, restore original information */
 | 
			
		||||
		chan->priority = oldpriority;
 | 
			
		||||
		ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
 | 
			
		||||
@@ -299,7 +436,8 @@ static int macro_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
 | 
			
		||||
	if (!dead)
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
 | 
			
		||||
	if (save_macro_offset)
 | 
			
		||||
		free(save_macro_offset);
 | 
			
		||||
	LOCAL_USER_REMOVE(u);
 | 
			
		||||
@@ -328,7 +466,7 @@ static int macroif_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
			*label_b = '\0';
 | 
			
		||||
			label_b++;
 | 
			
		||||
		}
 | 
			
		||||
		if (ast_true(expr))
 | 
			
		||||
		if (pbx_checkcondition(expr))
 | 
			
		||||
			macro_exec(chan, label_a);
 | 
			
		||||
		else if (label_b) 
 | 
			
		||||
			macro_exec(chan, label_b);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								apps/app_math.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										3
									
								
								apps/app_math.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -69,7 +69,8 @@ static char *math_descrip =
 | 
			
		||||
"Perform floating point calculation on number 1 to number 2 and \n"
 | 
			
		||||
"store the result in returnvar.  Valid ops are: \n"
 | 
			
		||||
"    +,-,/,*,%,<,>,>=,<=,==\n"
 | 
			
		||||
"and behave as their C equivalents.\n";
 | 
			
		||||
"and behave as their C equivalents.\n"
 | 
			
		||||
"  This application has been deprecated in favor of the MATH function.\n";
 | 
			
		||||
 | 
			
		||||
#define ADDFUNCTION 0
 | 
			
		||||
#define DIVIDEFUNCTION 1
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								apps/app_md5.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										4
									
								
								apps/app_md5.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -157,9 +157,9 @@ static int md5check_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		ast_log(LOG_DEBUG, "ERROR: MD5 not verified: %s -- %s\n", args.md5hash, args.string);
 | 
			
		||||
	pbx_builtin_setvar_helper(chan, "CHECKMD5STATUS", "NOMATCH");		
 | 
			
		||||
	if (priority_jump || option_priority_jumping) {
 | 
			
		||||
		if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
 | 
			
		||||
		if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
 | 
			
		||||
			if (option_debug > 2)
 | 
			
		||||
				ast_log(LOG_DEBUG, "ERROR: Can't jump to exten+101 (e%s,p%d), sorry\n", chan->exten,chan->priority+101);
 | 
			
		||||
				ast_log(LOG_DEBUG, "Can't jump to exten+101 (e%s,p%d), sorry\n", chan->exten,chan->priority+101);
 | 
			
		||||
	}
 | 
			
		||||
	LOCAL_USER_REMOVE(u);
 | 
			
		||||
	return res;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										518
									
								
								apps/app_meetme.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										518
									
								
								apps/app_meetme.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										15
									
								
								apps/app_milliwatt.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										15
									
								
								apps/app_milliwatt.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -73,30 +73,29 @@ static void milliwatt_release(struct ast_channel *chan, void *data)
 | 
			
		||||
static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int samples)
 | 
			
		||||
{
 | 
			
		||||
	struct ast_frame wf;
 | 
			
		||||
	unsigned char waste[AST_FRIENDLY_OFFSET];
 | 
			
		||||
	unsigned char buf[640];
 | 
			
		||||
	unsigned char buf[AST_FRIENDLY_OFFSET + 640];
 | 
			
		||||
	int i,*indexp = (int *) data;
 | 
			
		||||
 | 
			
		||||
	if (len > sizeof(buf))
 | 
			
		||||
	if (len + AST_FRIENDLY_OFFSET > sizeof(buf))
 | 
			
		||||
	{
 | 
			
		||||
		ast_log(LOG_WARNING,"Only doing %d bytes (%d bytes requested)\n",(int)sizeof(buf),len);
 | 
			
		||||
		len = sizeof(buf);
 | 
			
		||||
		ast_log(LOG_WARNING,"Only doing %d bytes (%d bytes requested)\n",(int)(sizeof(buf) - AST_FRIENDLY_OFFSET),len);
 | 
			
		||||
		len = sizeof(buf) - AST_FRIENDLY_OFFSET;
 | 
			
		||||
	}
 | 
			
		||||
	waste[0] = 0; /* make compiler happy */
 | 
			
		||||
	wf.frametype = AST_FRAME_VOICE;
 | 
			
		||||
	wf.subclass = AST_FORMAT_ULAW;
 | 
			
		||||
	wf.offset = AST_FRIENDLY_OFFSET;
 | 
			
		||||
	wf.mallocd = 0;
 | 
			
		||||
	wf.data = buf;
 | 
			
		||||
	wf.data = buf + AST_FRIENDLY_OFFSET;
 | 
			
		||||
	wf.datalen = len;
 | 
			
		||||
	wf.samples = wf.datalen;
 | 
			
		||||
	wf.src = "app_milliwatt";
 | 
			
		||||
	wf.delivery.tv_sec = 0;
 | 
			
		||||
	wf.delivery.tv_usec = 0;
 | 
			
		||||
	wf.prev = wf.next = NULL;
 | 
			
		||||
	/* create a buffer containing the digital milliwatt pattern */
 | 
			
		||||
	for(i = 0; i < len; i++)
 | 
			
		||||
	{
 | 
			
		||||
		buf[i] = digital_milliwatt[(*indexp)++];
 | 
			
		||||
		buf[AST_FRIENDLY_OFFSET + i] = digital_milliwatt[(*indexp)++];
 | 
			
		||||
		*indexp &= 7;
 | 
			
		||||
	}
 | 
			
		||||
	if (ast_write(chan,&wf) < 0)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										218
									
								
								apps/app_mixmonitor.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										218
									
								
								apps/app_mixmonitor.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -61,7 +61,8 @@ static const char *desc = ""
 | 
			
		||||
"Valid options:\n"
 | 
			
		||||
" a      - Append to the file instead of overwriting it.\n"
 | 
			
		||||
" b      - Only save audio to the file while the channel is bridged.\n"
 | 
			
		||||
"          Note: does not include conferences.\n"
 | 
			
		||||
"          Note: Does not include conferences or sounds played to each bridged\n"
 | 
			
		||||
"                party.\n"
 | 
			
		||||
" v(<x>) - Adjust the heard volume by a factor of <x> (range -4 to 4)\n"	
 | 
			
		||||
" V(<x>) - Adjust the spoken volume by a factor of <x> (range -4 to 4)\n"	
 | 
			
		||||
" W(<x>) - Adjust the both heard and spoken volumes by a factor of <x>\n"
 | 
			
		||||
@@ -79,12 +80,11 @@ LOCAL_USER_DECL;
 | 
			
		||||
static const char *mixmonitor_spy_type = "MixMonitor";
 | 
			
		||||
 | 
			
		||||
struct mixmonitor {
 | 
			
		||||
	struct ast_channel *chan;
 | 
			
		||||
	struct ast_channel_spy spy;
 | 
			
		||||
	char *filename;
 | 
			
		||||
	char *post_process;
 | 
			
		||||
	char *name;
 | 
			
		||||
	unsigned int flags;
 | 
			
		||||
	int readvol;
 | 
			
		||||
	int writevol;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
@@ -110,21 +110,6 @@ AST_APP_OPTIONS(mixmonitor_opts, {
 | 
			
		||||
	AST_APP_OPTION_ARG('W', MUXFLAG_VOLUME, OPT_ARG_VOLUME),
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
static void stopmon(struct ast_channel *chan, struct ast_channel_spy *spy) 
 | 
			
		||||
{
 | 
			
		||||
	/* If our status has changed, then the channel we're spying on is gone....
 | 
			
		||||
	   DON'T TOUCH IT!!!  RUN AWAY!!! */
 | 
			
		||||
	if (spy->status != CHANSPY_RUNNING)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (!chan)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	ast_mutex_lock(&chan->lock);
 | 
			
		||||
	ast_channel_spy_remove(chan, spy);
 | 
			
		||||
	ast_mutex_unlock(&chan->lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int startmon(struct ast_channel *chan, struct ast_channel_spy *spy) 
 | 
			
		||||
{
 | 
			
		||||
	struct ast_channel *peer;
 | 
			
		||||
@@ -136,7 +121,7 @@ static int startmon(struct ast_channel *chan, struct ast_channel_spy *spy)
 | 
			
		||||
	ast_mutex_lock(&chan->lock);
 | 
			
		||||
	res = ast_channel_spy_add(chan, spy);
 | 
			
		||||
	ast_mutex_unlock(&chan->lock);
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
	if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan)))
 | 
			
		||||
		ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);	
 | 
			
		||||
 | 
			
		||||
@@ -148,124 +133,83 @@ static int startmon(struct ast_channel *chan, struct ast_channel_spy *spy)
 | 
			
		||||
static void *mixmonitor_thread(void *obj) 
 | 
			
		||||
{
 | 
			
		||||
	struct mixmonitor *mixmonitor = obj;
 | 
			
		||||
	struct ast_channel_spy spy;
 | 
			
		||||
	struct ast_frame *f = NULL;
 | 
			
		||||
	struct ast_filestream *fs = NULL;
 | 
			
		||||
	char *ext, *name;
 | 
			
		||||
	unsigned int oflags;
 | 
			
		||||
	struct ast_frame *f;
 | 
			
		||||
	char post_process[1024] = "";
 | 
			
		||||
	char *ext;
 | 
			
		||||
	int errflag = 0;
 | 
			
		||||
	
 | 
			
		||||
	
 | 
			
		||||
	STANDARD_INCREMENT_USECOUNT;
 | 
			
		||||
 | 
			
		||||
	name = ast_strdupa(mixmonitor->chan->name);
 | 
			
		||||
 | 
			
		||||
	oflags = O_CREAT|O_WRONLY;
 | 
			
		||||
	oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
 | 
			
		||||
		
 | 
			
		||||
	if ((ext = strrchr(mixmonitor->filename, '.'))) {
 | 
			
		||||
		*(ext++) = '\0';
 | 
			
		||||
	} else {
 | 
			
		||||
		ext = "raw";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fs = ast_writefile(mixmonitor->filename, ext, NULL, oflags, 0, 0644);
 | 
			
		||||
	if (!fs) {
 | 
			
		||||
		ast_log(LOG_ERROR, "Cannot open %s.%s\n", mixmonitor->filename, ext);
 | 
			
		||||
		goto out;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (ast_test_flag(mixmonitor, MUXFLAG_APPEND))
 | 
			
		||||
		ast_seekstream(fs, 0, SEEK_END);
 | 
			
		||||
	
 | 
			
		||||
	memset(&spy, 0, sizeof(spy));
 | 
			
		||||
	ast_set_flag(&spy, CHANSPY_FORMAT_AUDIO);
 | 
			
		||||
	ast_set_flag(&spy, CHANSPY_MIXAUDIO);
 | 
			
		||||
	spy.type = mixmonitor_spy_type;
 | 
			
		||||
	spy.status = CHANSPY_RUNNING;
 | 
			
		||||
	spy.read_queue.format = AST_FORMAT_SLINEAR;
 | 
			
		||||
	spy.write_queue.format = AST_FORMAT_SLINEAR;
 | 
			
		||||
	if (mixmonitor->readvol) {
 | 
			
		||||
		ast_set_flag(&spy, CHANSPY_READ_VOLADJUST);
 | 
			
		||||
		spy.read_vol_adjustment = mixmonitor->readvol;
 | 
			
		||||
	}
 | 
			
		||||
	if (mixmonitor->writevol) {
 | 
			
		||||
		ast_set_flag(&spy, CHANSPY_WRITE_VOLADJUST);
 | 
			
		||||
		spy.write_vol_adjustment = mixmonitor->writevol;
 | 
			
		||||
	}
 | 
			
		||||
	ast_mutex_init(&spy.lock);
 | 
			
		||||
 | 
			
		||||
	if (startmon(mixmonitor->chan, &spy)) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Unable to add '%s' spy to channel '%s'\n",
 | 
			
		||||
			spy.type, mixmonitor->chan->name);
 | 
			
		||||
		goto out2;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (option_verbose > 1)
 | 
			
		||||
		ast_verbose(VERBOSE_PREFIX_2 "Begin MixMonitor Recording %s\n", name);
 | 
			
		||||
		ast_verbose(VERBOSE_PREFIX_2 "Begin MixMonitor Recording %s\n", mixmonitor->name);
 | 
			
		||||
	
 | 
			
		||||
	while (1) {
 | 
			
		||||
	ast_mutex_lock(&mixmonitor->spy.lock);
 | 
			
		||||
 | 
			
		||||
	while (mixmonitor->spy.chan) {
 | 
			
		||||
		struct ast_frame *next;
 | 
			
		||||
		int write;
 | 
			
		||||
 | 
			
		||||
		ast_mutex_lock(&spy.lock);
 | 
			
		||||
 | 
			
		||||
		ast_channel_spy_trigger_wait(&spy);
 | 
			
		||||
		ast_channel_spy_trigger_wait(&mixmonitor->spy);
 | 
			
		||||
		
 | 
			
		||||
		if (ast_check_hangup(mixmonitor->chan) || spy.status != CHANSPY_RUNNING) {
 | 
			
		||||
			ast_mutex_unlock(&spy.lock);
 | 
			
		||||
		if (!mixmonitor->spy.chan || mixmonitor->spy.status != CHANSPY_RUNNING)
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		while (1) {
 | 
			
		||||
			if (!(f = ast_channel_spy_read_frame(&spy, SAMPLES_PER_FRAME)))
 | 
			
		||||
			if (!(f = ast_channel_spy_read_frame(&mixmonitor->spy, SAMPLES_PER_FRAME)))
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			write = (!ast_test_flag(mixmonitor, MUXFLAG_BRIDGED) ||
 | 
			
		||||
				 ast_bridged_channel(mixmonitor->chan));
 | 
			
		||||
				 ast_bridged_channel(mixmonitor->spy.chan));
 | 
			
		||||
 | 
			
		||||
			/* it is possible for ast_channel_spy_read_frame() to return a chain
 | 
			
		||||
			   of frames if a queue flush was necessary, so process them
 | 
			
		||||
			*/
 | 
			
		||||
			for (; f; f = next) {
 | 
			
		||||
				next = f->next;
 | 
			
		||||
				if (write)
 | 
			
		||||
					ast_writestream(fs, f);
 | 
			
		||||
				if (write && errflag == 0) {
 | 
			
		||||
					if (!fs) {
 | 
			
		||||
						/* Determine creation flags and filename plus extension for filestream */
 | 
			
		||||
						oflags = O_CREAT | O_WRONLY;
 | 
			
		||||
						oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
 | 
			
		||||
 | 
			
		||||
						if ((ext = strrchr(mixmonitor->filename, '.')))
 | 
			
		||||
							*(ext++) = '\0';
 | 
			
		||||
						else
 | 
			
		||||
							ext = "raw";
 | 
			
		||||
 | 
			
		||||
						/* Move onto actually creating the filestream */
 | 
			
		||||
						if (!(fs = ast_writefile(mixmonitor->filename, ext, NULL, oflags, 0, 0644))) {
 | 
			
		||||
							ast_log(LOG_ERROR, "Cannot open %s.%s\n", mixmonitor->filename, ext);
 | 
			
		||||
							errflag = 1;
 | 
			
		||||
						}
 | 
			
		||||
 | 
			
		||||
					}
 | 
			
		||||
					if (fs)
 | 
			
		||||
						ast_writestream(fs, f);
 | 
			
		||||
				}
 | 
			
		||||
				ast_frfree(f);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		ast_mutex_unlock(&spy.lock);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ast_mutex_unlock(&mixmonitor->spy.lock);
 | 
			
		||||
	
 | 
			
		||||
	if (mixmonitor->post_process) {
 | 
			
		||||
		char *p;
 | 
			
		||||
 | 
			
		||||
		for (p = mixmonitor->post_process; *p ; p++) {
 | 
			
		||||
			if (*p == '^' && *(p+1) == '{') {
 | 
			
		||||
				*p = '$';
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		pbx_substitute_variables_helper(mixmonitor->chan, mixmonitor->post_process, post_process, sizeof(post_process) - 1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	stopmon(mixmonitor->chan, &spy);
 | 
			
		||||
	ast_channel_spy_free(&mixmonitor->spy);
 | 
			
		||||
 | 
			
		||||
	if (option_verbose > 1)
 | 
			
		||||
		ast_verbose(VERBOSE_PREFIX_2 "End MixMonitor Recording %s\n", name);
 | 
			
		||||
		ast_verbose(VERBOSE_PREFIX_2 "End MixMonitor Recording %s\n", mixmonitor->name);
 | 
			
		||||
 | 
			
		||||
	if (!ast_strlen_zero(post_process)) {
 | 
			
		||||
	if (mixmonitor->post_process) {
 | 
			
		||||
		if (option_verbose > 2)
 | 
			
		||||
			ast_verbose(VERBOSE_PREFIX_2 "Executing [%s]\n", post_process);
 | 
			
		||||
		ast_safe_system(post_process);
 | 
			
		||||
			ast_verbose(VERBOSE_PREFIX_2 "Executing [%s]\n", mixmonitor->post_process);
 | 
			
		||||
		ast_safe_system(mixmonitor->post_process);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
out2:
 | 
			
		||||
	ast_mutex_destroy(&spy.lock);
 | 
			
		||||
 | 
			
		||||
		
 | 
			
		||||
	if (fs)
 | 
			
		||||
		ast_closestream(fs);
 | 
			
		||||
 | 
			
		||||
out:
 | 
			
		||||
	free(mixmonitor);
 | 
			
		||||
 | 
			
		||||
	STANDARD_DECREMENT_USECOUNT;
 | 
			
		||||
@@ -279,32 +223,76 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename
 | 
			
		||||
	pthread_attr_t attr;
 | 
			
		||||
	pthread_t thread;
 | 
			
		||||
	struct mixmonitor *mixmonitor;
 | 
			
		||||
	int len;
 | 
			
		||||
	char postprocess2[1024] = "";
 | 
			
		||||
	size_t len;
 | 
			
		||||
 | 
			
		||||
	len = sizeof(*mixmonitor) + strlen(filename) + 1;
 | 
			
		||||
	if (!ast_strlen_zero(post_process))
 | 
			
		||||
		len += strlen(post_process) + 1;
 | 
			
		||||
	len = sizeof(*mixmonitor) + strlen(chan->name) + strlen(filename) + 2;
 | 
			
		||||
 | 
			
		||||
	/* If a post process system command is given attach it to the structure */
 | 
			
		||||
	if (!ast_strlen_zero(post_process)) {
 | 
			
		||||
		char *p1, *p2;
 | 
			
		||||
 | 
			
		||||
		p1 = ast_strdupa(post_process);
 | 
			
		||||
		for (p2 = p1; *p2 ; p2++) {
 | 
			
		||||
			if (*p2 == '^' && *(p2+1) == '{') {
 | 
			
		||||
				*p2 = '$';
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		pbx_substitute_variables_helper(chan, p1, postprocess2, sizeof(postprocess2) - 1);
 | 
			
		||||
		if (!ast_strlen_zero(postprocess2))
 | 
			
		||||
			len += strlen(postprocess2) + 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Pre-allocate mixmonitor structure and spy */
 | 
			
		||||
	if (!(mixmonitor = calloc(1, len))) {
 | 
			
		||||
		ast_log(LOG_ERROR, "Memory Error!\n");
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	mixmonitor->chan = chan;
 | 
			
		||||
	mixmonitor->filename = (char *) mixmonitor + sizeof(*mixmonitor);
 | 
			
		||||
	strcpy(mixmonitor->filename, filename);
 | 
			
		||||
	if (!ast_strlen_zero(post_process)) {
 | 
			
		||||
		mixmonitor->post_process = mixmonitor->filename + strlen(filename) + 1;
 | 
			
		||||
		strcpy(mixmonitor->post_process, post_process);
 | 
			
		||||
	}
 | 
			
		||||
	mixmonitor->readvol = readvol;
 | 
			
		||||
	mixmonitor->writevol = writevol;
 | 
			
		||||
	/* Copy over flags and channel name */
 | 
			
		||||
	mixmonitor->flags = flags;
 | 
			
		||||
	mixmonitor->name = (char *) mixmonitor + sizeof(*mixmonitor);
 | 
			
		||||
	strcpy(mixmonitor->name, chan->name);
 | 
			
		||||
	if (!ast_strlen_zero(postprocess2)) {
 | 
			
		||||
		mixmonitor->post_process = mixmonitor->name + strlen(mixmonitor->name) + strlen(filename) + 2;
 | 
			
		||||
		strcpy(mixmonitor->post_process, postprocess2);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	mixmonitor->filename = (char *) mixmonitor + sizeof(*mixmonitor) + strlen(chan->name) + 1;
 | 
			
		||||
	strcpy(mixmonitor->filename, filename);
 | 
			
		||||
 | 
			
		||||
	/* Setup the actual spy before creating our thread */
 | 
			
		||||
	ast_set_flag(&mixmonitor->spy, CHANSPY_FORMAT_AUDIO);
 | 
			
		||||
	ast_set_flag(&mixmonitor->spy, CHANSPY_MIXAUDIO);
 | 
			
		||||
	mixmonitor->spy.type = mixmonitor_spy_type;
 | 
			
		||||
	mixmonitor->spy.status = CHANSPY_RUNNING;
 | 
			
		||||
	mixmonitor->spy.read_queue.format = AST_FORMAT_SLINEAR;
 | 
			
		||||
	mixmonitor->spy.write_queue.format = AST_FORMAT_SLINEAR;
 | 
			
		||||
	if (readvol) {
 | 
			
		||||
		ast_set_flag(&mixmonitor->spy, CHANSPY_READ_VOLADJUST);
 | 
			
		||||
		mixmonitor->spy.read_vol_adjustment = readvol;
 | 
			
		||||
	}
 | 
			
		||||
	if (writevol) {
 | 
			
		||||
		ast_set_flag(&mixmonitor->spy, CHANSPY_WRITE_VOLADJUST);
 | 
			
		||||
		mixmonitor->spy.write_vol_adjustment = writevol;
 | 
			
		||||
	}
 | 
			
		||||
	ast_mutex_init(&mixmonitor->spy.lock);
 | 
			
		||||
 | 
			
		||||
	if (startmon(chan, &mixmonitor->spy)) {
 | 
			
		||||
		ast_log(LOG_WARNING, "Unable to add '%s' spy to channel '%s'\n",
 | 
			
		||||
			mixmonitor->spy.type, chan->name);
 | 
			
		||||
		/* Since we couldn't add ourselves - bail out! */
 | 
			
		||||
		ast_mutex_destroy(&mixmonitor->spy.lock);
 | 
			
		||||
		free(mixmonitor);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	pthread_attr_init(&attr);
 | 
			
		||||
	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 | 
			
		||||
	ast_pthread_create(&thread, &attr, mixmonitor_thread, mixmonitor);
 | 
			
		||||
	pthread_attr_destroy(&attr);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int mixmonitor_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										19
									
								
								apps/app_mp3.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										19
									
								
								apps/app_mp3.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -43,6 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/pbx.h"
 | 
			
		||||
#include "asterisk/module.h"
 | 
			
		||||
#include "asterisk/translate.h"
 | 
			
		||||
#include "asterisk/options.h"
 | 
			
		||||
 | 
			
		||||
#define LOCAL_MPG_123 "/usr/local/bin/mpg123"
 | 
			
		||||
#define MPG_123 "/usr/bin/mpg123"
 | 
			
		||||
@@ -66,13 +67,25 @@ static int mp3play(char *filename, int fd)
 | 
			
		||||
{
 | 
			
		||||
	int res;
 | 
			
		||||
	int x;
 | 
			
		||||
	sigset_t fullset, oldset;
 | 
			
		||||
 | 
			
		||||
	sigfillset(&fullset);
 | 
			
		||||
	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 | 
			
		||||
 | 
			
		||||
	res = fork();
 | 
			
		||||
	if (res < 0) 
 | 
			
		||||
		ast_log(LOG_WARNING, "Fork failed\n");
 | 
			
		||||
	if (res)
 | 
			
		||||
	if (res) {
 | 
			
		||||
		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
	if (option_highpriority)
 | 
			
		||||
		ast_set_priority(0);
 | 
			
		||||
	signal(SIGPIPE, SIG_DFL);
 | 
			
		||||
	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 | 
			
		||||
 | 
			
		||||
	dup2(fd, STDOUT_FILENO);
 | 
			
		||||
	for (x=0;x<256;x++) {
 | 
			
		||||
	for (x=STDERR_FILENO + 1;x<256;x++) {
 | 
			
		||||
		if (x != STDOUT_FILENO)
 | 
			
		||||
			close(x);
 | 
			
		||||
	}
 | 
			
		||||
@@ -94,7 +107,7 @@ static int mp3play(char *filename, int fd)
 | 
			
		||||
	    execlp("mpg123", "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
 | 
			
		||||
	}
 | 
			
		||||
	ast_log(LOG_WARNING, "Execute of mpg123 failed\n");
 | 
			
		||||
	return -1;
 | 
			
		||||
	_exit(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int timed_read(int fd, void *data, int datalen, int timeout)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								apps/app_nbscat.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										20
									
								
								apps/app_nbscat.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -44,6 +44,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/pbx.h"
 | 
			
		||||
#include "asterisk/module.h"
 | 
			
		||||
#include "asterisk/translate.h"
 | 
			
		||||
#include "asterisk/options.h"
 | 
			
		||||
 | 
			
		||||
#define LOCAL_NBSCAT "/usr/local/bin/nbscat8k"
 | 
			
		||||
#define NBSCAT "/usr/bin/nbscat8k"
 | 
			
		||||
@@ -70,13 +71,26 @@ static int NBScatplay(int fd)
 | 
			
		||||
{
 | 
			
		||||
	int res;
 | 
			
		||||
	int x;
 | 
			
		||||
	sigset_t fullset, oldset;
 | 
			
		||||
 | 
			
		||||
	sigfillset(&fullset);
 | 
			
		||||
	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 | 
			
		||||
 | 
			
		||||
	res = fork();
 | 
			
		||||
	if (res < 0) 
 | 
			
		||||
		ast_log(LOG_WARNING, "Fork failed\n");
 | 
			
		||||
	if (res)
 | 
			
		||||
	if (res) {
 | 
			
		||||
		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
	signal(SIGPIPE, SIG_DFL);
 | 
			
		||||
	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 | 
			
		||||
 | 
			
		||||
	if (option_highpriority)
 | 
			
		||||
		ast_set_priority(0);
 | 
			
		||||
 | 
			
		||||
	dup2(fd, STDOUT_FILENO);
 | 
			
		||||
	for (x=0;x<256;x++) {
 | 
			
		||||
	for (x = STDERR_FILENO + 1; x < 1024; x++) {
 | 
			
		||||
		if (x != STDOUT_FILENO)
 | 
			
		||||
			close(x);
 | 
			
		||||
	}
 | 
			
		||||
@@ -84,7 +98,7 @@ static int NBScatplay(int fd)
 | 
			
		||||
	execl(NBSCAT, "nbscat8k", "-d", (char *)NULL);
 | 
			
		||||
	execl(LOCAL_NBSCAT, "nbscat8k", "-d", (char *)NULL);
 | 
			
		||||
	ast_log(LOG_WARNING, "Execute of nbscat8k failed\n");
 | 
			
		||||
	return -1;
 | 
			
		||||
	_exit(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int timed_read(int fd, void *data, int datalen)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										32
									
								
								apps/app_osplookup.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										32
									
								
								apps/app_osplookup.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -216,27 +216,33 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	cause = str2cause(args.cause);
 | 
			
		||||
	temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
 | 
			
		||||
	result.handle = -1;
 | 
			
		||||
	if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
 | 
			
		||||
		if ((res = ast_osp_next(&result, cause)) > 0) {
 | 
			
		||||
			char tmp[80];
 | 
			
		||||
			snprintf(tmp, sizeof(tmp), "%d", result.handle);
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
 | 
			
		||||
			snprintf(tmp, sizeof(tmp), "%d", result.numresults);
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "SUCCESS");
 | 
			
		||||
		}
 | 
			
		||||
	if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.handle) != 1)) {
 | 
			
		||||
		result.handle = -1;
 | 
			
		||||
	}
 | 
			
		||||
	temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
 | 
			
		||||
	if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
 | 
			
		||||
		result.numresults = 0;
 | 
			
		||||
	}
 | 
			
		||||
	if ((res = ast_osp_next(&result, cause)) > 0) {
 | 
			
		||||
		char tmp[80];
 | 
			
		||||
		snprintf(tmp, sizeof(tmp), "%d", result.handle);
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
 | 
			
		||||
		snprintf(tmp, sizeof(tmp), "%d", result.numresults);
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "SUCCESS");
 | 
			
		||||
	} else {
 | 
			
		||||
		if (!res) {
 | 
			
		||||
			if (result.handle < 0)
 | 
			
		||||
				ast_log(LOG_NOTICE, "OSP Lookup Next failed for handle '%d'\n", result.handle);
 | 
			
		||||
			else
 | 
			
		||||
				ast_log(LOG_DEBUG, "No OSP handle specified\n");
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "FAILED");	
 | 
			
		||||
		} else
 | 
			
		||||
			ast_log(LOG_DEBUG, "Got hangup on '%s' while doing OSP Next!\n", chan->name);
 | 
			
		||||
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "FAILED");	
 | 
			
		||||
	}
 | 
			
		||||
	if (!res) {
 | 
			
		||||
		/* Look for a "busy" place */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										48
									
								
								apps/app_page.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										48
									
								
								apps/app_page.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Asterisk -- An open source telephony toolkit.
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 2004 - 2005 Digium, Inc.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 2004 - 2006 Digium, Inc.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Mark Spencer <markster@digium.com>
 | 
			
		||||
 *
 | 
			
		||||
@@ -40,6 +40,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/module.h"
 | 
			
		||||
#include "asterisk/file.h"
 | 
			
		||||
#include "asterisk/app.h"
 | 
			
		||||
#include "asterisk/chanvars.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static const char *tdesc = "Page Multiple Phones";
 | 
			
		||||
@@ -55,7 +56,7 @@ static const char *page_descrip =
 | 
			
		||||
"caller is dumped into the conference as a speaker and the room is\n"
 | 
			
		||||
"destroyed when the original caller leaves.  Valid options are:\n"
 | 
			
		||||
"        d - full duplex audio\n"
 | 
			
		||||
"	 q - quiet, do not play beep to caller\n";
 | 
			
		||||
"        q - quiet, do not play beep to caller\n";
 | 
			
		||||
 | 
			
		||||
STANDARD_LOCAL_USER;
 | 
			
		||||
 | 
			
		||||
@@ -77,13 +78,14 @@ struct calloutdata {
 | 
			
		||||
	char tech[64];
 | 
			
		||||
	char resource[256];
 | 
			
		||||
	char meetmeopts[64];
 | 
			
		||||
	struct ast_variable *variables;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void *page_thread(void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct calloutdata *cd = data;
 | 
			
		||||
	ast_pbx_outgoing_app(cd->tech, AST_FORMAT_SLINEAR, cd->resource, 30000,
 | 
			
		||||
		"MeetMe", cd->meetmeopts, NULL, 0, cd->cidnum, cd->cidname, NULL, NULL);
 | 
			
		||||
		"MeetMe", cd->meetmeopts, NULL, 0, cd->cidnum, cd->cidname, cd->variables, NULL, NULL);
 | 
			
		||||
	free(cd);
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
@@ -91,6 +93,9 @@ static void *page_thread(void *data)
 | 
			
		||||
static void launch_page(struct ast_channel *chan, const char *meetmeopts, const char *tech, const char *resource)
 | 
			
		||||
{
 | 
			
		||||
	struct calloutdata *cd;
 | 
			
		||||
	const char *varname;
 | 
			
		||||
	struct ast_variable *lastvar = NULL;
 | 
			
		||||
	struct ast_var_t *varptr;
 | 
			
		||||
	pthread_t t;
 | 
			
		||||
	pthread_attr_t attr;
 | 
			
		||||
	cd = malloc(sizeof(struct calloutdata));
 | 
			
		||||
@@ -101,12 +106,36 @@ static void launch_page(struct ast_channel *chan, const char *meetmeopts, const
 | 
			
		||||
		ast_copy_string(cd->tech, tech, sizeof(cd->tech));
 | 
			
		||||
		ast_copy_string(cd->resource, resource, sizeof(cd->resource));
 | 
			
		||||
		ast_copy_string(cd->meetmeopts, meetmeopts, sizeof(cd->meetmeopts));
 | 
			
		||||
 | 
			
		||||
		AST_LIST_TRAVERSE(&chan->varshead, varptr, entries) {
 | 
			
		||||
			if (!(varname = ast_var_full_name(varptr)))
 | 
			
		||||
				continue;
 | 
			
		||||
			if (varname[0] == '_') {
 | 
			
		||||
				struct ast_variable *newvar = NULL;
 | 
			
		||||
 | 
			
		||||
				if (varname[1] == '_') {
 | 
			
		||||
					newvar = ast_variable_new(varname, ast_var_value(varptr));
 | 
			
		||||
				} else {
 | 
			
		||||
					newvar = ast_variable_new(&varname[1], ast_var_value(varptr));
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				if (newvar) {
 | 
			
		||||
					if (lastvar)
 | 
			
		||||
						lastvar->next = newvar;
 | 
			
		||||
					else
 | 
			
		||||
						cd->variables = newvar;
 | 
			
		||||
					lastvar = newvar;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		pthread_attr_init(&attr);
 | 
			
		||||
		pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 | 
			
		||||
		if (ast_pthread_create(&t, &attr, page_thread, cd)) {
 | 
			
		||||
			ast_log(LOG_WARNING, "Unable to create paging thread: %s\n", strerror(errno));
 | 
			
		||||
			free(cd);
 | 
			
		||||
		}
 | 
			
		||||
		pthread_attr_destroy(&attr);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -121,6 +150,7 @@ static int page_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	struct ast_app *app;
 | 
			
		||||
	char *tmp;
 | 
			
		||||
	int res=0;
 | 
			
		||||
	char originator[AST_CHANNEL_NAME];
 | 
			
		||||
 | 
			
		||||
	if (ast_strlen_zero(data)) {
 | 
			
		||||
		ast_log(LOG_WARNING, "This application requires at least one argument (destination(s) to page)\n");
 | 
			
		||||
@@ -142,12 +172,21 @@ static int page_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ast_copy_string(originator, chan->name, sizeof(originator));
 | 
			
		||||
	if ((tmp = strchr(originator, '-')))
 | 
			
		||||
		*tmp = '\0';
 | 
			
		||||
 | 
			
		||||
	tmp = strsep(&options, "|");
 | 
			
		||||
	if (options)
 | 
			
		||||
		ast_app_parse_options(page_opts, &flags, NULL, options);
 | 
			
		||||
 | 
			
		||||
	snprintf(meetmeopts, sizeof(meetmeopts), "%ud|%sqxdw", confid, ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m");
 | 
			
		||||
	snprintf(meetmeopts, sizeof(meetmeopts), "%ud|%sqxdw(5)", confid, ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m");
 | 
			
		||||
 | 
			
		||||
	while ((tech = strsep(&tmp, "&"))) {
 | 
			
		||||
		/* don't call the originating device */
 | 
			
		||||
		if (!strcasecmp(tech, originator))
 | 
			
		||||
			continue;
 | 
			
		||||
 | 
			
		||||
		if ((resource = strchr(tech, '/'))) {
 | 
			
		||||
			*resource++ = '\0';
 | 
			
		||||
			launch_page(chan, meetmeopts, tech, resource);
 | 
			
		||||
@@ -155,6 +194,7 @@ static int page_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
			ast_log(LOG_WARNING, "Incomplete destination '%s' supplied.\n", tech);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!ast_test_flag(&flags, PAGE_QUIET)) {
 | 
			
		||||
		res = ast_streamfile(chan, "beep", chan->language);
 | 
			
		||||
		if (!res)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_parkandannounce.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_parkandannounce.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										9
									
								
								apps/app_playback.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										9
									
								
								apps/app_playback.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -110,6 +110,7 @@ static int playback_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	if (chan->_state != AST_STATE_UP) {
 | 
			
		||||
		if (option_skip) {
 | 
			
		||||
			/* At the user's option, skip if the line is not up */
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "SUCCESS");
 | 
			
		||||
			LOCAL_USER_REMOVE(u);
 | 
			
		||||
			return 0;
 | 
			
		||||
		} else if (!option_noanswer)
 | 
			
		||||
@@ -137,11 +138,11 @@ static int playback_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
			}
 | 
			
		||||
			front = back;
 | 
			
		||||
		}
 | 
			
		||||
		if (mres)
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "FAILED");
 | 
			
		||||
		else
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "SUCCESS");
 | 
			
		||||
	}
 | 
			
		||||
	if (mres)
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "FAILED");
 | 
			
		||||
	else
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "SUCCESS");
 | 
			
		||||
	LOCAL_USER_REMOVE(u);
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								apps/app_privacy.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										16
									
								
								apps/app_privacy.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -193,13 +193,21 @@ static int privacy_exec (struct ast_channel *chan, void *data)
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		/*Got a number, play sounds and send them on their way*/
 | 
			
		||||
		if ((retries < maxretries) && res == 1 ) {
 | 
			
		||||
		if ((retries < maxretries) && res >= 0 ) {
 | 
			
		||||
			res = ast_streamfile(chan, "privacy-thankyou", chan->language);
 | 
			
		||||
			if (!res)
 | 
			
		||||
				res = ast_waitstream(chan, "");
 | 
			
		||||
			ast_set_callerid (chan, phone, "Privacy Manager", NULL);
 | 
			
		||||
			if (option_verbose > 2)
 | 
			
		||||
				ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID to %s\n",phone);
 | 
			
		||||
 | 
			
		||||
			ast_set_callerid (chan, phone, "Privacy Manager", NULL); 
 | 
			
		||||
 | 
			
		||||
			/* Clear the unavailable presence bit so if it came in on PRI
 | 
			
		||||
			 * the caller id will now be passed out to other channels
 | 
			
		||||
			 */
 | 
			
		||||
			chan->cid.cid_pres &= (AST_PRES_UNAVAILABLE ^ 0xFF);
 | 
			
		||||
 | 
			
		||||
			if (option_verbose > 2) {
 | 
			
		||||
				ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID to %s, callerpres to %d\n",phone,chan->cid.cid_pres);
 | 
			
		||||
			}
 | 
			
		||||
			pbx_builtin_setvar_helper(chan, "PRIVACYMGRSTATUS", "SUCCESS");
 | 
			
		||||
		} else {
 | 
			
		||||
			if (priority_jump || option_priority_jumping)	
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										714
									
								
								apps/app_queue.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										714
									
								
								apps/app_queue.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										7
									
								
								apps/app_random.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										7
									
								
								apps/app_random.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -82,7 +82,7 @@ static int random_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	if ((!prob) || (sscanf(prob, "%d", &probint) != 1))
 | 
			
		||||
		probint = 0;
 | 
			
		||||
 | 
			
		||||
	if ((random() % 100) + probint > 100) {
 | 
			
		||||
	if ((random() % 100) + probint >= 100) {
 | 
			
		||||
		res = ast_parseable_goto(chan, s);
 | 
			
		||||
		if (option_verbose > 2)
 | 
			
		||||
			ast_verbose( VERBOSE_PREFIX_3 "Random branches to (%s,%s,%d)\n",
 | 
			
		||||
@@ -116,9 +116,8 @@ char *description(void)
 | 
			
		||||
 | 
			
		||||
int usecount(void)
 | 
			
		||||
{
 | 
			
		||||
	int res;
 | 
			
		||||
	STANDARD_USECOUNT(res);
 | 
			
		||||
	return res;
 | 
			
		||||
	/* Don't allow unload, since rand(3) depends upon this module being here. */
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *key()
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_read.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_read.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										17
									
								
								apps/app_readfile.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										17
									
								
								apps/app_readfile.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -95,15 +95,16 @@ static int readfile_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	returnvar = ast_read_textfile(file);
 | 
			
		||||
	if(len > 0){
 | 
			
		||||
		if(len < strlen(returnvar))
 | 
			
		||||
			returnvar[len]='\0';
 | 
			
		||||
		else
 | 
			
		||||
			ast_log(LOG_WARNING,"%s is longer than %d, and %d \n", file, len, (int)strlen(returnvar));
 | 
			
		||||
	if ((returnvar = ast_read_textfile(file))) {
 | 
			
		||||
		if (len > 0) {
 | 
			
		||||
			if (len < strlen(returnvar))
 | 
			
		||||
				returnvar[len]='\0';
 | 
			
		||||
			else
 | 
			
		||||
				ast_log(LOG_WARNING, "%s is longer than %d, and %d \n", file, len, (int)strlen(returnvar));
 | 
			
		||||
		}
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, varname, returnvar);
 | 
			
		||||
		free(returnvar);
 | 
			
		||||
	}
 | 
			
		||||
	pbx_builtin_setvar_helper(chan, varname, returnvar);
 | 
			
		||||
	free(returnvar);
 | 
			
		||||
	LOCAL_USER_REMOVE(u);
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_realtime.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_realtime.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										41
									
								
								apps/app_record.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										41
									
								
								apps/app_record.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -41,6 +41,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 | 
			
		||||
#include "asterisk/dsp.h"
 | 
			
		||||
#include "asterisk/utils.h"
 | 
			
		||||
#include "asterisk/options.h"
 | 
			
		||||
#include "asterisk/app.h"
 | 
			
		||||
 | 
			
		||||
static char *tdesc = "Trivial Record Application";
 | 
			
		||||
 | 
			
		||||
@@ -64,7 +65,8 @@ static char *descrip =
 | 
			
		||||
"     't' : use alternate '*' terminator key instead of default '#'\n"
 | 
			
		||||
"\n"
 | 
			
		||||
"If filename contains '%d', these characters will be replaced with a number\n"
 | 
			
		||||
"incremented by one each time the file is recorded. \n\n"
 | 
			
		||||
"incremented by one each time the file is recorded. A channel variable\n"
 | 
			
		||||
"named RECORDED_FILE will also be set, which contains the final filemname.\n\n"
 | 
			
		||||
"Use 'show file formats' to see the available formats on your system\n\n"
 | 
			
		||||
"User can press '#' to terminate the recording and continue to the next priority.\n\n"
 | 
			
		||||
"If the user should hangup during a recording, all data will be lost and the\n"
 | 
			
		||||
@@ -183,8 +185,35 @@ static int record_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	/* these are to allow the use of the %d in the config file for a wild card of sort to
 | 
			
		||||
	  create a new file with the inputed name scheme */
 | 
			
		||||
	if (percentflag) {
 | 
			
		||||
		AST_DECLARE_APP_ARGS(fname,
 | 
			
		||||
			AST_APP_ARG(piece)[100];
 | 
			
		||||
		);
 | 
			
		||||
		char *tmp2 = ast_strdupa(filename);
 | 
			
		||||
		char countstring[15];
 | 
			
		||||
		int i;
 | 
			
		||||
 | 
			
		||||
		/* Separate each piece out by the format specifier */
 | 
			
		||||
		/* AST_NONSTANDARD_APP_ARGS(fname, tmp2, '%'); */
 | 
			
		||||
		fname.argc = ast_app_separate_args(tmp2, '%', fname.argv, (sizeof(fname) - sizeof(fname.argc)) / sizeof(fname.argv[0]));
 | 
			
		||||
		do {
 | 
			
		||||
			snprintf(tmp, sizeof(tmp), filename, count);
 | 
			
		||||
			int tmplen;
 | 
			
		||||
			/* First piece has no leading percent, so it's copied verbatim */
 | 
			
		||||
			ast_copy_string(tmp, fname.piece[0], sizeof(tmp));
 | 
			
		||||
			tmplen = strlen(tmp);
 | 
			
		||||
			for (i = 1; i < fname.argc; i++) {
 | 
			
		||||
				if (fname.piece[i][0] == 'd') {
 | 
			
		||||
					/* Substitute the count */
 | 
			
		||||
					snprintf(countstring, sizeof(countstring), "%d", count);
 | 
			
		||||
					ast_copy_string(tmp + tmplen, countstring, sizeof(tmp) - tmplen);
 | 
			
		||||
					tmplen += strlen(countstring);
 | 
			
		||||
				} else if (tmplen + 2 < sizeof(tmp)) {
 | 
			
		||||
					/* Unknown format specifier - just copy it verbatim */
 | 
			
		||||
					tmp[tmplen++] = '%';
 | 
			
		||||
					tmp[tmplen++] = fname.piece[i][0];
 | 
			
		||||
				}
 | 
			
		||||
				/* Copy the remaining portion of the piece */
 | 
			
		||||
				ast_copy_string(tmp + tmplen, &(fname.piece[i][1]), sizeof(tmp) - tmplen);
 | 
			
		||||
			}
 | 
			
		||||
			count++;
 | 
			
		||||
		} while ( ast_fileexists(tmp, ext, chan->language) != -1 );
 | 
			
		||||
		pbx_builtin_setvar_helper(chan, "RECORDED_FILE", tmp);
 | 
			
		||||
@@ -277,6 +306,7 @@ static int record_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
			
 | 
			
		||||
			if (res) {
 | 
			
		||||
				ast_log(LOG_WARNING, "Problem writing frame\n");
 | 
			
		||||
				ast_frfree(f);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
@@ -295,16 +325,15 @@ static int record_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
					break;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if (f->frametype == AST_FRAME_VIDEO) {
 | 
			
		||||
		} else if (f->frametype == AST_FRAME_VIDEO) {
 | 
			
		||||
			res = ast_writestream(s, f);
 | 
			
		||||
			
 | 
			
		||||
			if (res) {
 | 
			
		||||
				ast_log(LOG_WARNING, "Problem writing frame\n");
 | 
			
		||||
				ast_frfree(f);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if ((f->frametype == AST_FRAME_DTMF) &&
 | 
			
		||||
		} else if ((f->frametype == AST_FRAME_DTMF) &&
 | 
			
		||||
		    (f->subclass == terminator)) {
 | 
			
		||||
			ast_frfree(f);
 | 
			
		||||
			break;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										100
									
								
								apps/app_rpt.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										100
									
								
								apps/app_rpt.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -897,55 +897,54 @@ static int telem_lookup(struct ast_channel *chan, char *node, char *name)
 | 
			
		||||
 | 
			
		||||
static int get_wait_interval(struct rpt *myrpt, int type)
 | 
			
		||||
{
 | 
			
		||||
        int interval;
 | 
			
		||||
        char *wait_times;
 | 
			
		||||
        char *wait_times_save;
 | 
			
		||||
                                                                                                                  
 | 
			
		||||
        wait_times_save = NULL;
 | 
			
		||||
        wait_times = ast_variable_retrieve(cfg, myrpt->name, "wait_times");
 | 
			
		||||
                                                                                                                  
 | 
			
		||||
        if(wait_times){
 | 
			
		||||
                wait_times_save = ast_strdupa(wait_times);
 | 
			
		||||
                if(!wait_times_save){
 | 
			
		||||
                        ast_log(LOG_WARNING, "Out of memory in wait_interval()\n");
 | 
			
		||||
                        wait_times = NULL;
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
                                                                                                                  
 | 
			
		||||
        switch(type){
 | 
			
		||||
                case DLY_TELEM:
 | 
			
		||||
                        if(wait_times)
 | 
			
		||||
                                interval = retrieve_astcfgint(wait_times_save, "telemwait", 500, 5000, 1000);
 | 
			
		||||
                        else
 | 
			
		||||
                                interval = 1000;
 | 
			
		||||
                        break;
 | 
			
		||||
                                                                                                                  
 | 
			
		||||
                case DLY_ID:
 | 
			
		||||
                        if(wait_times)
 | 
			
		||||
                                interval = retrieve_astcfgint(wait_times_save, "idwait",250,5000,500);
 | 
			
		||||
                        else
 | 
			
		||||
                                interval = 500;
 | 
			
		||||
                        break;
 | 
			
		||||
                                                                                                                  
 | 
			
		||||
                case DLY_UNKEY:
 | 
			
		||||
                        if(wait_times)
 | 
			
		||||
                                interval = retrieve_astcfgint(wait_times_save, "unkeywait",500,5000,1000);
 | 
			
		||||
                        else
 | 
			
		||||
                                interval = 1000;
 | 
			
		||||
                        break;
 | 
			
		||||
                                                                                                                  
 | 
			
		||||
                case DLY_CALLTERM:
 | 
			
		||||
                        if(wait_times)
 | 
			
		||||
                                interval = retrieve_astcfgint(wait_times_save, "calltermwait",500,5000,1500);
 | 
			
		||||
                        else
 | 
			
		||||
                                interval = 1500;
 | 
			
		||||
                        break;
 | 
			
		||||
                                                                                                                  
 | 
			
		||||
                default:
 | 
			
		||||
                        return 0;
 | 
			
		||||
        }
 | 
			
		||||
	int interval;
 | 
			
		||||
	char *wait_times;
 | 
			
		||||
	char *wait_times_save = NULL;
 | 
			
		||||
 | 
			
		||||
	wait_times = ast_variable_retrieve(cfg, myrpt->name, "wait_times");
 | 
			
		||||
 | 
			
		||||
	if (wait_times) {
 | 
			
		||||
		wait_times_save = ast_strdupa(wait_times);
 | 
			
		||||
		if (!wait_times_save) {
 | 
			
		||||
			ast_log(LOG_WARNING, "Out of memory in wait_interval()\n");
 | 
			
		||||
			wait_times = NULL;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch (type) {
 | 
			
		||||
	case DLY_TELEM:
 | 
			
		||||
		if (wait_times)
 | 
			
		||||
			interval = retrieve_astcfgint(wait_times_save, "telemwait", 500, 5000, 1000);
 | 
			
		||||
		else
 | 
			
		||||
			interval = 1000;
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
	case DLY_ID:
 | 
			
		||||
		if (wait_times)
 | 
			
		||||
			interval = retrieve_astcfgint(wait_times_save, "idwait", 250, 5000, 500);
 | 
			
		||||
		else
 | 
			
		||||
			interval = 500;
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
	case DLY_UNKEY:
 | 
			
		||||
		if (wait_times)
 | 
			
		||||
			interval = retrieve_astcfgint(wait_times_save, "unkeywait", 500, 5000, 1000);
 | 
			
		||||
		else
 | 
			
		||||
			interval = 1000;
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
	case DLY_CALLTERM:
 | 
			
		||||
		if (wait_times)
 | 
			
		||||
			interval = retrieve_astcfgint(wait_times_save, "calltermwait", 500, 5000, 1500);
 | 
			
		||||
		else
 | 
			
		||||
			interval = 1500;
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
	default:
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
	return interval;
 | 
			
		||||
}                                                                                                                  
 | 
			
		||||
}														  
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -1522,6 +1521,7 @@ pthread_attr_t attr;
 | 
			
		||||
        pthread_attr_init(&attr);
 | 
			
		||||
        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 | 
			
		||||
	ast_pthread_create(&tele->threadid,&attr,rpt_tele_thread,(void *) tele);
 | 
			
		||||
	pthread_attr_destroy(&attr);
 | 
			
		||||
	return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -2154,6 +2154,7 @@ static int function_autopatchup(struct rpt *myrpt, char *param, char *digitbuf,
 | 
			
		||||
	pthread_attr_init(&attr);
 | 
			
		||||
	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 | 
			
		||||
	ast_pthread_create(&myrpt->rpt_call_thread,&attr,rpt_call,(void *) myrpt);
 | 
			
		||||
	pthread_attr_destroy(&attr);
 | 
			
		||||
	return DC_COMPLETE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -5240,6 +5241,7 @@ char cmd[MAXDTMF+1] = "";
 | 
			
		||||
					        pthread_attr_init(&attr);
 | 
			
		||||
			 		        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 | 
			
		||||
						ast_pthread_create(&myrpt->rpt_call_thread,&attr,rpt_call,(void *)myrpt);
 | 
			
		||||
						pthread_attr_destroy(&attr);
 | 
			
		||||
						continue;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
@@ -5782,6 +5784,7 @@ pthread_attr_t attr;
 | 
			
		||||
	        pthread_attr_init(&attr);
 | 
			
		||||
	        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 | 
			
		||||
		ast_pthread_create(&rpt_vars[i].rpt_thread,&attr,rpt,(void *) &rpt_vars[i]);
 | 
			
		||||
		pthread_attr_destroy(&attr);
 | 
			
		||||
	}
 | 
			
		||||
	usleep(500000);
 | 
			
		||||
	for(;;)
 | 
			
		||||
@@ -5817,6 +5820,7 @@ pthread_attr_t attr;
 | 
			
		||||
			        pthread_attr_init(&attr);
 | 
			
		||||
	 		        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 | 
			
		||||
				ast_pthread_create(&rpt_vars[i].rpt_thread,&attr,rpt,(void *) &rpt_vars[i]);
 | 
			
		||||
				pthread_attr_destroy(&attr);
 | 
			
		||||
				ast_log(LOG_WARNING, "rpt_thread restarted on node %s\n", rpt_vars[i].name);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_sayunixtime.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_sayunixtime.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										2
									
								
								apps/app_senddtmf.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										2
									
								
								apps/app_senddtmf.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -50,7 +50,7 @@ static char *synopsis = "Sends arbitrary DTMF digits";
 | 
			
		||||
 | 
			
		||||
static char *descrip = 
 | 
			
		||||
" SendDTMF(digits[|timeout_ms]): Sends DTMF digits on a channel. \n"
 | 
			
		||||
" Accepted digits: 0-9, *#abcd\n"
 | 
			
		||||
" Accepted digits: 0-9, *#abcd, w (.5s pause)\n"
 | 
			
		||||
" The application will either pass the assigned digits or terminate if it\n"
 | 
			
		||||
" encounters an error.\n";
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_sendtext.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_sendtext.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_setcallerid.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_setcallerid.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_setcdruserfield.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_setcdruserfield.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_setcidname.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_setcidname.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_setcidnum.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_setcidnum.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_setrdnis.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_setrdnis.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										0
									
								
								apps/app_settransfercapability.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_settransfercapability.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
								
								
									
										9
									
								
								apps/app_skel.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										9
									
								
								apps/app_skel.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -3,7 +3,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) <Year>, <Your Name Here>
 | 
			
		||||
 *
 | 
			
		||||
 * <Your Name Here> <<You Email Here>>
 | 
			
		||||
 * <Your Name Here> <<Your Email Here>>
 | 
			
		||||
 *
 | 
			
		||||
 * See http://www.asterisk.org for more information about
 | 
			
		||||
 * the Asterisk project. Please do not directly contact
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 * \brief Skeleton application
 | 
			
		||||
 * 
 | 
			
		||||
 * This is a skeleton for development of an Asterisk application */
 | 
			
		||||
 * This is a skeleton for development of an Asterisk application
 | 
			
		||||
 * \ingroup applications
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@@ -53,7 +53,7 @@ static char *descrip = "This application is a template to build other applicatio
 | 
			
		||||
#define OPTION_C	(1 << 2)	/* Option C(str) */
 | 
			
		||||
#define OPTION_NULL	(1 << 3)	/* Dummy Termination */
 | 
			
		||||
 | 
			
		||||
AST_DECLARE_OPTIONS(app_opts,{
 | 
			
		||||
AST_APP_OPTIONS(app_opts,{
 | 
			
		||||
	['a'] = { OPTION_A },
 | 
			
		||||
	['b'] = { OPTION_B, 1 },
 | 
			
		||||
	['c'] = { OPTION_C, 2 }
 | 
			
		||||
@@ -77,7 +77,6 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
 | 
			
		||||
	if (ast_strlen_zero(data)) {
 | 
			
		||||
		ast_log(LOG_WARNING, "%s requires an argument (dummy|[options])\n",app);
 | 
			
		||||
		LOCAL_USER_REMOVE(u);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -96,7 +95,7 @@ static int app_exec(struct ast_channel *chan, void *data)
 | 
			
		||||
	if ((argc = ast_app_separate_args(args, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
 | 
			
		||||
		dummy = argv[0];
 | 
			
		||||
		options = argv[1];
 | 
			
		||||
		ast_parseoptions(app_opts, &flags, opts, options);
 | 
			
		||||
		ast_app_parse_options(app_opts, &flags, opts, options);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!ast_strlen_zero(dummy)) 
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										33
									
								
								apps/app_sms.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										33
									
								
								apps/app_sms.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							@@ -694,7 +694,7 @@ static void sms_readfile (sms_t * h, char *fn)
 | 
			
		||||
		}
 | 
			
		||||
		while (fgets (line, sizeof (line), s))
 | 
			
		||||
		{								 /* process line in file */
 | 
			
		||||
			char *p;
 | 
			
		||||
			unsigned char *p;
 | 
			
		||||
			for (p = line; *p && *p != '\n' && *p != '\r'; p++);
 | 
			
		||||
			*p = 0;					 /* strip eoln */
 | 
			
		||||
			p = line;
 | 
			
		||||
@@ -1050,7 +1050,7 @@ static void sms_nextoutgoing (sms_t * h)
 | 
			
		||||
		unsigned char p = 2;
 | 
			
		||||
		h->omsg[0] = 0x91;		  /* SMS_DATA */
 | 
			
		||||
		if (h->smsc) {			 /* deliver */
 | 
			
		||||
			h->omsg[p++] = (more ? 4 : 0);
 | 
			
		||||
			h->omsg[p++] = (more ? 4 : 0) + ((h->udhl > 0) ? 0x40 : 0);
 | 
			
		||||
			p += packaddress (h->omsg + p, h->oa);
 | 
			
		||||
			h->omsg[p++] = h->pid;
 | 
			
		||||
			h->omsg[p++] = h->dcs;
 | 
			
		||||
@@ -1178,25 +1178,24 @@ static void sms_messagetx(sms_t * h)
 | 
			
		||||
static int sms_generate (struct ast_channel *chan, void *data, int len, int samples)
 | 
			
		||||
{
 | 
			
		||||
	struct ast_frame f = { 0 };
 | 
			
		||||
	unsigned char waste[AST_FRIENDLY_OFFSET];
 | 
			
		||||
#define MAXSAMPLES 800
 | 
			
		||||
#ifdef OUTALAW
 | 
			
		||||
	unsigned char buf[800];
 | 
			
		||||
	unsigned char *buf;
 | 
			
		||||
#else
 | 
			
		||||
	signed short buf[800];
 | 
			
		||||
	short *buf;
 | 
			
		||||
#endif
 | 
			
		||||
#define SAMPLE2LEN sizeof(*buf)
 | 
			
		||||
	sms_t *h = data;
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	if (len > sizeof (buf)) {
 | 
			
		||||
		ast_log (LOG_WARNING, "Only doing %d bytes (%d bytes requested)\n", (int)(sizeof (buf) / sizeof (signed short)), len);
 | 
			
		||||
		len = sizeof (buf);
 | 
			
		||||
#ifdef OUTALAW
 | 
			
		||||
		samples = len;
 | 
			
		||||
#else
 | 
			
		||||
		samples = len / 2;
 | 
			
		||||
#endif
 | 
			
		||||
	if (samples > MAXSAMPLES) {
 | 
			
		||||
		ast_log (LOG_WARNING, "Only doing %d samples (%d requested)\n",
 | 
			
		||||
			 MAXSAMPLES, samples);
 | 
			
		||||
		samples = MAXSAMPLES;
 | 
			
		||||
	}
 | 
			
		||||
	waste[0] = 0;					 /* make compiler happy */
 | 
			
		||||
	len = samples * SAMPLE2LEN + AST_FRIENDLY_OFFSET;
 | 
			
		||||
	buf = alloca(len);
 | 
			
		||||
 | 
			
		||||
	f.frametype = AST_FRAME_VOICE;
 | 
			
		||||
#ifdef OUTALAW
 | 
			
		||||
	f.subclass = AST_FORMAT_ALAW;
 | 
			
		||||
@@ -1379,8 +1378,8 @@ static int sms_exec (struct ast_channel *chan, void *data)
 | 
			
		||||
		ast_copy_string (h.cli, chan->cid.cid_num, sizeof (h.cli));
 | 
			
		||||
 | 
			
		||||
	{
 | 
			
		||||
		char *d = data,
 | 
			
		||||
			*p,
 | 
			
		||||
		unsigned char *p;
 | 
			
		||||
		unsigned char *d = data,
 | 
			
		||||
			answer = 0;
 | 
			
		||||
		if (!*d || *d == '|') {
 | 
			
		||||
			ast_log (LOG_ERROR, "Requires queue name\n");
 | 
			
		||||
@@ -1449,7 +1448,7 @@ static int sms_exec (struct ast_channel *chan, void *data)
 | 
			
		||||
			d = p;
 | 
			
		||||
			h.udl = 0;
 | 
			
		||||
			while (*p && h.udl < SMSLEN)
 | 
			
		||||
				h.ud[h.udl++] = utf8decode((unsigned char **)&p);
 | 
			
		||||
				h.ud[h.udl++] = utf8decode(&p);
 | 
			
		||||
			if (is7bit (h.dcs) && packsms7 (0, h.udhl, h.udh, h.udl, h.ud) < 0)
 | 
			
		||||
				ast_log (LOG_WARNING, "Invalid 7 bit GSM data\n");
 | 
			
		||||
			if (is8bit (h.dcs) && packsms8 (0, h.udhl, h.udh, h.udl, h.ud) < 0)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								apps/app_softhangup.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								apps/app_softhangup.c
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user