mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 16:21:01 +00:00
Compare commits
622 Commits
1.2.0-beta
...
1.2.9-nets
Author | SHA1 | Date | |
---|---|---|---|
|
fa8122e0bc | ||
|
630c55641b | ||
|
185e66c206 | ||
|
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 | ||
|
59fe845c6c | ||
|
af4301802d | ||
|
3dc12025c8 | ||
|
c86be56b3b | ||
|
6d0b8522d0 | ||
|
892978fb4b | ||
|
891569befc | ||
|
7953c3f407 | ||
|
60ebbb5744 | ||
|
544a2ecbd3 | ||
|
639104bbb2 | ||
|
2b656be753 | ||
|
492087f45f | ||
|
b9e2fcfdea | ||
|
296ca06e35 | ||
|
a31a587bc0 | ||
|
1fb64fa4bd | ||
|
9cdcba170e | ||
|
4331958422 | ||
|
c7c3fa1d53 | ||
|
3d599e6501 | ||
|
e88e390bb8 | ||
|
a14758518d | ||
|
a45b2019df | ||
|
6bfdf6f45a | ||
|
2e6475fd03 | ||
|
685e88645f | ||
|
2a53a89aa6 | ||
|
15705f94a7 | ||
|
d8dfa4434d | ||
|
0702130ed1 | ||
|
3fbcf6e3d0 | ||
|
8f965a06cb | ||
|
b05ff7c343 | ||
|
d5348b71c9 | ||
|
c9ceb15e1e | ||
|
2b547e1f9e | ||
|
266674e123 | ||
|
766d1a73b1 | ||
|
52da8d9862 | ||
|
3b8c82543d | ||
|
50ab28bd94 | ||
|
38c665bd67 | ||
|
51b54236de | ||
|
64aaaa1f4a | ||
|
8605bf0104 | ||
|
6f45949ca1 | ||
|
500dd158fe | ||
|
a7d794a0ac | ||
|
00de2bc78b | ||
|
36315b865b | ||
|
45c7589284 | ||
|
78d740290a | ||
|
91b616c9ba | ||
|
ed465f4a85 | ||
|
4606d74a66 | ||
|
c6e7b2a333 | ||
|
7e939cb273 | ||
|
9e4c207dd3 | ||
|
5545974c6a | ||
|
c79c0f97f1 | ||
|
f603eb0135 | ||
|
ba349963a8 | ||
|
b3ffb91539 | ||
|
adb02d0107 | ||
|
734034d824 | ||
|
1740d40182 | ||
|
8c9a32bd4b | ||
|
8fddeef1ac | ||
|
829447c811 | ||
|
608d63ac54 | ||
|
54dd7ac9fa | ||
|
ff364c3068 | ||
|
b124b6d649 | ||
|
14d426098e | ||
|
c3b6ac6004 | ||
|
642be05f09 | ||
|
f3b4e0291c | ||
|
9b037b4872 | ||
|
73b90d3b74 | ||
|
6dabdbc7cd | ||
|
ea70f31f2f | ||
|
0aa9429c96 | ||
|
a87d3f5c19 | ||
|
580d6f3482 | ||
|
bdda6254f4 | ||
|
cdf4031963 | ||
|
9a06a7c14c | ||
|
33c15f19fe | ||
|
9b03ffc513 | ||
|
3e4feebbd6 | ||
|
9433b7157f | ||
|
15b01f246c | ||
|
7b2e24777f | ||
|
c5f0a6db6f | ||
|
5efc81c789 | ||
|
a612ed5f72 | ||
|
987b87662c | ||
|
511c096592 | ||
|
0941c32d38 | ||
|
ebf04fc570 | ||
|
2251dd3723 | ||
|
eb24670aff | ||
|
869ae80f16 | ||
|
a4be983a63 | ||
|
77390dfeaf | ||
|
d56ce5d1f3 | ||
|
8f7c94ab0f | ||
|
52f25ae960 | ||
|
9061716644 | ||
|
e463c42ba7 | ||
|
00d3c31496 | ||
|
a0a9769616 | ||
|
2ea48ce114 | ||
|
be7cdd4cd1 | ||
|
6e27e24452 | ||
|
81bda951d2 | ||
|
0ac4bbfdd9 | ||
|
3a003e8714 | ||
|
6f4fabf043 | ||
|
145daf44d8 | ||
|
3fb2544a41 | ||
|
c6f312fdef | ||
|
5e0149d7cf | ||
|
24cc108694 | ||
|
5eceb92944 | ||
|
8f536c775e | ||
|
1ca8bccc2f | ||
|
608f5f7f45 | ||
|
018e8c8395 | ||
|
87c87fe158 | ||
|
f09c6bc78e | ||
|
4eb2c0d832 | ||
|
e8f2ad304a | ||
|
bb3e125ed4 | ||
|
e4ce764744 | ||
|
7d4a5abb1d | ||
|
bb7eb69c09 | ||
|
88cc39af74 | ||
|
f3d02da7d8 | ||
|
3cf2991be1 | ||
|
dd21a2b170 | ||
|
29dbc6c204 | ||
|
f477f462d3 | ||
|
31a804b97c | ||
|
75c812f26d | ||
|
314bdba709 | ||
|
1781e73435 | ||
|
3bd298f2dd | ||
|
4600902059 | ||
|
8e680521ec | ||
|
7c3efb156c | ||
|
b721635619 | ||
|
535ed63c6f | ||
|
34152c3abc | ||
|
5e17bb19d9 | ||
|
a67c2702c5 | ||
|
ddf63421f6 | ||
|
3d473eebbc | ||
|
994b9db081 | ||
|
da0d0f975a | ||
|
c103bc7806 | ||
|
5039ee0965 | ||
|
8f8fc4e57e | ||
|
929d7e6e9b | ||
|
3e2507a07a | ||
|
980887f8eb | ||
|
2bebbca579 | ||
|
8925c3834b | ||
|
426360e389 | ||
|
fc9612edad | ||
|
5b252b65e6 | ||
|
fa46248f9d | ||
|
27041dbda8 | ||
|
e9f5bd158b | ||
|
8f0a6a7d4f | ||
|
ce50837d70 | ||
|
150ff6393b | ||
|
5f50e4cb93 | ||
|
9693d05882 | ||
|
b2c2b5cd49 | ||
|
610f5614e3 | ||
|
e1bcf1d043 | ||
|
661a2b97af | ||
|
986a8ca089 | ||
|
9b6f887db5 | ||
|
7ffb604a2f | ||
|
b05e64ed12 | ||
|
631ee6670c | ||
|
da097c4f5e | ||
|
156470f895 | ||
|
ddaed942ee | ||
|
d6b64431b0 | ||
|
8839ff95df | ||
|
c24c35e5b6 | ||
|
bb47f9fdc3 | ||
|
cfced0420e | ||
|
03ceef35ac | ||
|
236ce8f796 |
0
.cleancount
Executable file → Normal file
0
.cleancount
Executable file → Normal file
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 @@
|
||||
8
|
23
BUGS
Executable file → Normal file
23
BUGS
Executable file → Normal file
@@ -1,23 +1,22 @@
|
||||
Asterisk 1.0-RC-1 Known Major Bugs
|
||||
==================================
|
||||
* Some people still have issues with H.323
|
||||
* QuickNet driver still not entirely stable
|
||||
|
||||
Asterisk Bug Tracking Information
|
||||
=================================
|
||||
|
||||
To learn about and report Asterisk bugs or make feature
|
||||
requests, please visit the official Asterisk Bug Tracker
|
||||
at:
|
||||
To learn about and report Asterisk bugs, please visit
|
||||
the official Asterisk Bug Tracker at:
|
||||
|
||||
http://bugs.digium.com
|
||||
|
||||
For more information on using the bug tracker, or to
|
||||
learn how you can contribute by acting as a bug marshal
|
||||
learn how you can contribute by acting as a bug marshall
|
||||
please see:
|
||||
|
||||
http://www.digium.com/bugtracker.html
|
||||
http://www.digium.com/index.php?menu=bugguidelines
|
||||
|
||||
If you would like to submit a feature request, please
|
||||
resist the temptation to post it to the bug tracker.
|
||||
Feature requests should be posted to the asterisk-dev
|
||||
mailing list, located at:
|
||||
|
||||
http://lists.digium.com
|
||||
|
||||
Thank you!
|
||||
|
||||
Mark
|
||||
|
770
CHANGES
Executable file → Normal file
770
CHANGES
Executable file → Normal file
@@ -1,655 +1,127 @@
|
||||
NOTE: Corrections or additions to the ChangeLog may be submitted to
|
||||
http://bugs.digium.com. Documentation and formatting fixes are not
|
||||
not listed here. A complete listing of changes is available through
|
||||
the Asterisk-CVS mailing list hosted at http://lists.digium.com.
|
||||
Changes since Asterisk 1.2.0-beta2:
|
||||
|
||||
Asterisk 1.2.0
|
||||
* Cygwin build system portability
|
||||
* Optional generation of outbound silence during channel recording
|
||||
|
||||
-- Some of the major feature upgrades ...
|
||||
Changes since Asterisk 1.2.0-beta1:
|
||||
|
||||
-- DUNDi (Distributed Universal Number Discovery -- http://www.dundi.com)
|
||||
-- AEL (Asterisk Extension Logic)
|
||||
-- Realtime Database Configuration Engine
|
||||
-- Native Music on Hold
|
||||
-- Native IAX Encryption
|
||||
-- New Jitter Buffer
|
||||
-- Q.SIG Switchtype for PRI
|
||||
-- FastAGI (AGI over TCP)
|
||||
-- Dialplan Functions
|
||||
-- ODBC Storage of Voicemail
|
||||
* Many, many bug fixes
|
||||
* Documentation and sample configuration updates
|
||||
* Vastly improved presence/subscription support in the SIP channel driver
|
||||
* A new (experimental) mISDN channel driver
|
||||
* A new monitoring application (MixMonitor)
|
||||
* More portability fixes for non-Linux platforms
|
||||
* New dialplan functions replacing old applications
|
||||
* Significant deadlock and performance upgrades for the Manager interface
|
||||
* An upgrade to the 'new' dialplan expression parser for all users
|
||||
* New Zaptel echo cancellers with improved performance
|
||||
* Support for the latest OSP toolkit from TransNexus
|
||||
* Support user-controlled volume adjustment in MeetMe application
|
||||
* More dialplan applications now return status variables instead of priority jumping
|
||||
* Much more powerful ENUM support in the dialplan
|
||||
* SIP domain support for authentication and virtual hosting
|
||||
* Many PRI protocol updates and fixes, including more complete Q.SIG support
|
||||
* New applications: Pickup() and Page()
|
||||
|
||||
Asterisk 1.0.10
|
||||
Changes since Asterisk 1.0:
|
||||
|
||||
-- chan_local
|
||||
-- In releases 1.0.8 and 1.0.9, the Local channels that are created would
|
||||
not be masqueraded into the new channel type. This has now been fixed.
|
||||
-- chan_sip
|
||||
-- The 'insecure' options have been changed to support matching peersby IP
|
||||
only, not requiring authentication on incoming invites, or both. Before,
|
||||
to not require authentication on incoming invites also required matching
|
||||
peers based on IP only.
|
||||
-- chan_zap
|
||||
-- Before, call waiting could occur during the initial ringing on the line.
|
||||
This has now been fixed.
|
||||
-- app_disa
|
||||
-- We will now not set the accountcode if one is not supplied.
|
||||
-- app_meetme
|
||||
-- If the first caller into a conference hangs up while being prompted for
|
||||
the conference pin number, the conference will no longer be held open.
|
||||
-- app_userevent
|
||||
-- Events created with this application were indicated as a "call" event
|
||||
instead of a "user" event. This made the "user" event permissions
|
||||
not work correctly.
|
||||
-- app_voicemail
|
||||
-- When using the externpass option for voicemail, the password will be
|
||||
immediately updated in memory as well, instead of having to wait for
|
||||
the next time the configuration is reloaded.
|
||||
-- app_zapras
|
||||
-- We now ensure buffer policy is restored after RAS is done with a channel.
|
||||
This could cause audio problems on the channel after zapras is done
|
||||
with it.
|
||||
-- res_agi
|
||||
-- We now unmask the SIGHUP signal before executing an AGI script. This
|
||||
fixes problems where some AGI scripts would continue running long after
|
||||
the call is over.
|
||||
-- extensions
|
||||
-- A potential crash has been fixed when calling LEN() to get the length of
|
||||
a string that was 80 characters or larger.
|
||||
-- logger
|
||||
-- The Asterisk logger will automatically detect when a log file needs to
|
||||
be rotated. However, this feature could put Asterisk in a nasty loop
|
||||
that would result in a crash.
|
||||
-- general
|
||||
-- Added man pages for astgenkey, autosupport, and safe_asterisk
|
||||
This list currently only containts changes made from the end of November until
|
||||
March 26, 2005.
|
||||
|
||||
Asterisk 1.0.9
|
||||
|
||||
-- fix bug in callerid matching in the dialplan that was introduced in 1.0.8
|
||||
|
||||
Asterisk 1.0.8
|
||||
|
||||
-- chan_zap
|
||||
-- Asterisk will now also look in the regular context for the fax extension
|
||||
while executing a macro. Previously, for this to work, the fax extension
|
||||
would have to be included in the macro definition.
|
||||
-- On some systems, ALERTING will be sent after PROCEEDING, so code has been
|
||||
added to account for this case.
|
||||
-- If no extension is specified on an overlap call, the 's' extension will
|
||||
be used.
|
||||
-- chan_sip
|
||||
-- We no longer send a "to" tag on "100 Trying" messages, as it is
|
||||
inappropriate to do so.
|
||||
-- We now respond correctly to an invite for T.38 with a "488 Not acceptable
|
||||
here"
|
||||
-- We now discard saved tags on 401/407 responses in case the provider we're
|
||||
talking to tries to pull a dirty trick on us and change it.
|
||||
-- rtptimeout options will now be correctly set on a peer basis rather than
|
||||
only global
|
||||
-- chan_mgcp
|
||||
-- Fixed setting of accountcode
|
||||
-- Fixed where *67 to block callerid only worked for first call
|
||||
-- chan_agent
|
||||
-- We now will not pass audio until the agent has acked the call if the
|
||||
configuration
|
||||
is set up for the agent to do so.
|
||||
-- chan_alsa
|
||||
-- Fixed problems with the unloading of this module
|
||||
-- res_agi
|
||||
-- A fix has been added to prevent calls from being hung up when more than
|
||||
one call is executing an AGI script calling the GET DATA command.
|
||||
-- AGI scripts will now continue to run even if a file was not found with
|
||||
the GET DATA command.
|
||||
-- When calling SAY NUMBER with a number like 09, we will now say "nine"
|
||||
instead of "zero"
|
||||
-- app_dial
|
||||
-- There was a problem where text frames would not be forwarded before the
|
||||
channel has been answered.
|
||||
-- app_disa
|
||||
-- Fixed the timeout used when no password is set
|
||||
-- app_queue
|
||||
-- Distinctive ring has been fixed to work for queue members
|
||||
-- rtp
|
||||
-- Fixed a logic error when setting the "rtpchecksums" option
|
||||
-- say.c
|
||||
-- A problem has been fixed with saying the date in Spanish.
|
||||
-- Makefile
|
||||
-- A line was missing for the autosupport script that caused "make rpm" to
|
||||
fail
|
||||
-- format_wav_gsm
|
||||
-- Fixed a problem with wav formatting that prevented files from being
|
||||
played in some media players
|
||||
-- pbx_spool
|
||||
-- Fixed if the last line of text in a file for the call spool did not
|
||||
contain a new line, it would not be processed
|
||||
-- logger
|
||||
-- Fixed the logger so that color escape sequences wouldn't be sent to the
|
||||
logs
|
||||
-- format_sln
|
||||
-- A lot of changes were made to correctly handle signed linear format on
|
||||
big endian machines
|
||||
-- asterisk.conf
|
||||
-- fix 'highpriority' option for asterisk.conf
|
||||
|
||||
Asterisk 1.0.7
|
||||
|
||||
-- chan_sip
|
||||
-- The fix for some codec availibility issues in 1.0.6 caused music on hold
|
||||
problems, but has now been fixed.
|
||||
-- chan_skinny
|
||||
-- A check has been added to avoid a crash.
|
||||
-- chan_iax2
|
||||
-- A feature has been added to CVS head to have the option of sending
|
||||
timestamps with trunk frames. It is not supported in 1.0, but a change
|
||||
has been made so that it will at least not choke if sent trunk
|
||||
timestamps.
|
||||
-- app_voicemail
|
||||
-- Some checks have been added to avoid a crash.
|
||||
-- speex
|
||||
-- The path /usr/include/speex has been added for a place to look for the
|
||||
speex header.
|
||||
|
||||
Asterisk 1.0.6
|
||||
|
||||
-- chan_iax2:
|
||||
-- Fixed a bug dealing with a division by zero that could cause a crash
|
||||
-- chan_sip:
|
||||
-- Behavior was changed so that when a registration fails due to DNS
|
||||
resolution issues, a retry will be attempted in 20 seconds.
|
||||
-- Peer settings were not reset to null values when reloading the
|
||||
configuration file. Behavior has been changed so that these values are
|
||||
now cleared.
|
||||
-- 'restrictcid' now properly works on MySQL peers.
|
||||
-- Only use the default callerid if it has been specified.
|
||||
-- Asterisk was not sending the same From: line in SIP messages during
|
||||
certain times. Fixed to make sure it stays the same. This makes some
|
||||
providers happier, to a working state.
|
||||
-- Certain circumstances involving a blank callerid caused asterisk to
|
||||
segmentation fault.
|
||||
-- There was a problem incorrectly matching codec availablity when global
|
||||
preferences were different from that of the user. To fix this,
|
||||
processing of SDP data has been moved to after determining who the call
|
||||
is coming from.
|
||||
-- Asterisk would run out of RTP ports while waiting for SUBSCRIBE's to
|
||||
expire even though an RTP port isn't needed in this case. This has been
|
||||
fixed by releasing the ports early.
|
||||
-- chan_zap:
|
||||
-- During a certain scenario when using flash and '#' transfers you would
|
||||
hear the other person and the music they were hearing. This has been
|
||||
fixed.
|
||||
-- A fix for a compilation issue with gcc4 was added.
|
||||
-- chan_modem_bestdata:
|
||||
-- A fix for a compilation issue with gcc4 was added.
|
||||
-- format_g729:
|
||||
-- Treat a 10-byte read as an end of file indication instead of an error.
|
||||
Some G729 encoders like to put 10-bytes at the end to indicate this.
|
||||
-- res_features:
|
||||
-- During certain situations when parking a call, both endpoints would get
|
||||
musiconhold. This has been fixed so the individual who parked the call
|
||||
will hear the digits and not musiconhold.
|
||||
-- app_dial:
|
||||
-- DIALEDPEERNUMBER is now being set, so if you attempted to use it in the
|
||||
past and failed, it should work now.
|
||||
-- A callerid change caused many headaches, this has been reversed to the
|
||||
original 1.0 behavior.
|
||||
-- A crash caused with the combination of the 'g' option and # transfer was
|
||||
fixed.
|
||||
-- app_voicemail:
|
||||
-- If two people hit the voicemail system at the same time, and were leaving
|
||||
a message the second message was overwriting the first. This has been
|
||||
fixed so that each one is distinct and will not overwrite eachother.
|
||||
-- cdr_tds:
|
||||
-- If the server you were using was going down, it had the potential to
|
||||
bring your asterisk server down with it. Extra stuff has been added so
|
||||
as to bring in more error/connection checking.
|
||||
-- cdr_pgsql:
|
||||
-- This will now attempt to reconnect after a connection problem.
|
||||
-- IAXY firmware:
|
||||
-- This has been updated to version 23. It includes a fix for lost
|
||||
registrations.
|
||||
-- internals
|
||||
-- Behavior was changed for 'show codec <number>' to make it more intuitive.
|
||||
-- DNS failures and asterisk do not get along too well, this is not totally
|
||||
the case anymore.
|
||||
-- Asterisk will now handle DNS failures at startup more gracefully, and
|
||||
won't crash and burn
|
||||
-- Choosing to append to a wave file would render the outputted wave file
|
||||
corrupt. Appending now works again.
|
||||
-- If you failed to define certain keys, asterisk had the potential to crash
|
||||
when seeing if you had used them.
|
||||
-- Attempting to use such things as ${EXTEN:-1} gave a wrong return value.
|
||||
However, this was never a documented feature...
|
||||
|
||||
Asterisk 1.0.5
|
||||
|
||||
-- chan_zap
|
||||
-- fix a callerid bug introduced in 1.0.4
|
||||
-- app_queue
|
||||
-- fix some penalty behavior
|
||||
|
||||
Asterisk 1.0.4
|
||||
|
||||
-- general
|
||||
-- fix memory leak evident with extensive use of variables
|
||||
-- update IAXy firmware to version 22
|
||||
-- enable some special write protection
|
||||
-- enable outbound DTMF
|
||||
-- fix seg fault with incorrect usage of SetVar
|
||||
-- other minor fixes including typos and doc updates
|
||||
-- chan_sip
|
||||
-- fix codecs to not be case sensitive
|
||||
-- Re-use auth credentials
|
||||
-- fix MWI when using type=friend
|
||||
-- fix global NAT option
|
||||
-- chan_agent / chan_local
|
||||
-- fix incorrect use count
|
||||
-- chan_zap
|
||||
-- Allow CID rings to be configured in zapata.conf
|
||||
-- no more patching needed for UK CID
|
||||
-- app_macro
|
||||
-- allow Macros to exit with '*' or '#' like regular extension processing
|
||||
-- app_voicemail
|
||||
-- don't allow '#' as a password
|
||||
-- add option to save voicemail before going to the operator
|
||||
-- fix global operator=yes
|
||||
-- app_read
|
||||
-- return 0 instead of -1 if user enters nothing
|
||||
-- res_agi
|
||||
-- don't exit AGI when file not found to stream
|
||||
-- send script parameter when using FastAGI
|
||||
|
||||
Asterisk 1.0.3
|
||||
|
||||
-- chan_zap
|
||||
-- fix seg fault when doing *0 to flash a trunk
|
||||
-- rtp
|
||||
-- seg fault fix
|
||||
-- chan_sip
|
||||
-- fix to prevent seg fault when attempting a transfer
|
||||
-- fix bug with supervised transfers
|
||||
-- fix codec preferences
|
||||
-- chan_h323
|
||||
-- fix compilation problem
|
||||
-- chan_iax2
|
||||
-- avoid a deadlock related to a static config of a BUNCH of peers
|
||||
-- cdr_pgsql
|
||||
-- fix memory leak when reading config
|
||||
-- Numerous other minor bug fixes
|
||||
|
||||
Asterisk 1.0.2
|
||||
|
||||
-- Major bugfix release
|
||||
|
||||
Asterisk 1.0.1
|
||||
|
||||
-- Added AGI over TCP support
|
||||
-- Add ability to purge callers from queue if no agents are logged in
|
||||
-- Fix inband PRI indication detection
|
||||
-- Fix for MGCP - always request digits if no RTP stream
|
||||
-- Fixed seg fault for ast_control_streamfile
|
||||
-- Make pick-up extension configurable via features.conf
|
||||
-- Numerous other bug fixes
|
||||
|
||||
Asterisk 1.0.0
|
||||
-- Use Q.931 standard cause codes for asterisk cause codes
|
||||
-- Bug fixes from the bug tracker
|
||||
Asterisk 1.0-RC2
|
||||
-- Additional CDR backends
|
||||
-- Allow muted to reconnect
|
||||
-- Call parking improvements (including SIP parking support)
|
||||
-- Added licensed hold music from FreePlayMusic
|
||||
-- GR-303 and Zap improvements
|
||||
-- More bug fixes from the bug tracker
|
||||
-- Improved FreeBSD/OpenBSD/MacOS X support
|
||||
Asterisk 1.0-RC1
|
||||
-- Innumerable bug fixes and features from the bug tracker
|
||||
-- Added Open Settlement Protocol (OSP) support
|
||||
-- Added Non-facility Associated Signalling (NFAS) Support
|
||||
-- Added alarm Monitoring support
|
||||
-- Added new MeetMe options
|
||||
-- Added GR-303 Support
|
||||
-- Added trunk groups
|
||||
-- ADPCM Standardization
|
||||
-- Numerous bug fixes
|
||||
-- Add IAX2 Firmware Support
|
||||
-- Add G.726 support
|
||||
-- Add ices/icecast support
|
||||
-- Numerous bug fixes
|
||||
Asterisk 0.7.2
|
||||
-- Countless small bug fixes from bug tracker
|
||||
-- DSP Fixes
|
||||
-- Fix unloading of Zaptel
|
||||
-- Pass Caller*ID/ANI properly on call forwarding
|
||||
-- Add indication for Italy
|
||||
Asterisk 0.7.1
|
||||
-- Fixed timed include context's and GotoIfTime
|
||||
-- Fixed chan_h323 it now gets remote ip properly instead of 127.0.0.1
|
||||
Asterisk 0.7.0
|
||||
-- Removed MP3 format and codec
|
||||
-- Can now load and unload SIP,IAX,IAX2,H323 channels without core
|
||||
-- Fixed various compiler warnings and clean up source tree
|
||||
-- Preliminary AES Support
|
||||
-- Fix SIP REINVITE
|
||||
-- Outbound SIP registration behind NAT using externip
|
||||
-- More CLI documentation and clean up
|
||||
-- Pin numbers on MeeMe
|
||||
-- Dynamic MeetMe conferences are more consistent with static conferences
|
||||
-- Added channel variables ${HANGUPCAUSE}, ${SIPDOMAIN}, ${TIMESTAMP}, ${ACCONTCODE}
|
||||
-- ODBC support for logging CDRs
|
||||
-- Indications for Norway and New Zeland
|
||||
-- Major redesign of app_voicemail
|
||||
-- Syslog support
|
||||
-- Reload logfiles with CLI command 'logger reload' and rotate logs with "logger rotate'
|
||||
-- Configurable DEBUG, NOTICE, WARNING, ERROR and ast_verbose messages now appear on remote console
|
||||
-- Properly reaping any zombie processes
|
||||
-- Added applications SayUnixTime, SetCDRUserField, HasNewVoicemail, ZapScan, Random, ResetCDR, NoCDR
|
||||
-- Make PRI Hangup Cause available to the dialplan
|
||||
-- Verify included contexts in extensions.conf
|
||||
-- Add DESTDIR support for building RPMs and packages
|
||||
-- Do route lookups on OpenBSD
|
||||
-- Add support for building on FreeBSD and OS X
|
||||
-- Add support for PostgreSQL in Voicemail
|
||||
-- Translate SIP hangup cause to PRI hangup cause where needed
|
||||
-- Better support for MOH in IAX2
|
||||
-- Fix SIP problem where channels were not removed on BYE
|
||||
-- Display codecs by name
|
||||
-- Remove MySQL and put PGSql instead for licensing reasons
|
||||
-- Better capability matching in SIP
|
||||
-- Full IBR4 compliance for chan_zap
|
||||
-- More flexible CDR handling
|
||||
-- Distinguish between BUSY and FAILURE on outbound calls
|
||||
-- Add initial support for SCCP via chan_skinny
|
||||
-- Better support for Future Group B signaling
|
||||
Asterisk 0.5.0
|
||||
-- Retain IAX2 and SIP registrations past shutdown/crash and restart
|
||||
-- True data mode bridging when possible
|
||||
-- H.323 build improvements
|
||||
-- Agent Callback-login support
|
||||
-- RFC2833 Improvements
|
||||
-- Add thread debugging
|
||||
-- Add optional pedantic SIP checking for Pingtel
|
||||
-- Allow extension names, include context, switch to use global vars.
|
||||
-- Allow variables in extensions.conf to reference previously defined ones
|
||||
-- Merge voicemail enhancements (app_voicemail2)
|
||||
-- Add multiple queueing strategies
|
||||
-- Merge support for 'T'
|
||||
-- Allow pending agent calling (Agent/:1)
|
||||
-- Add groupings to agents.conf
|
||||
-- Add video support to IAX2
|
||||
-- Zaptel optimize playback
|
||||
-- Add video support to SIP
|
||||
-- Make RTP ports configurable
|
||||
-- Add RDNIS support to SIP and IAX2
|
||||
-- Add transfer app (implement in SIP and IAX2)
|
||||
-- Make voicemail segmentable by context (app_voicemail2)
|
||||
-- Major restructuring of voicemail (app_voicemail2)
|
||||
-- Add initial ENUM support
|
||||
-- Add malloc debugging support
|
||||
-- Add preliminary Voicetronix support
|
||||
-- Add iLBC codec
|
||||
Asterisk 0.4.0
|
||||
-- Merge and edit Nick's FXO dial support
|
||||
-- Reengineer SIP registration (outbound)
|
||||
-- Support call pickup on SIP and compatibly with ZAP
|
||||
-- Support 302 Redirect on SIP
|
||||
-- Management interface improvements
|
||||
-- Add "hint" support
|
||||
-- Improve call forwarding using new "Local" channel driver.
|
||||
-- Add "Local" channel
|
||||
-- Substantial SIP enhancements including retransmissions
|
||||
-- Enforce case sensitivity on extension/context names
|
||||
-- Add monitor support (Thanks, Mahmut)
|
||||
-- Add experimental "trunk" option to IAX2 for high density VoIP
|
||||
-- Add experimental "debug channel" command
|
||||
-- Add 'C' flag to dial command to reset call detail record (handy for calling cards)
|
||||
-- Add NAT and dynamic support to MGCP
|
||||
-- Allow selection of in-band, out-of-band, or INFO based DTMF
|
||||
-- Add contributed "*80" support to blacklist numbers (Thanks James!)
|
||||
-- Add "NAT" option to sip user, peer, friend
|
||||
-- Add experimental "IAX2" protocol
|
||||
-- Change special variable "EXTEN-n" to "EXTEN:n" to follow Bash syntax
|
||||
-- Add "Enhanced" AGI with audio pass-through (voice recognition anyone?)
|
||||
-- Choose best priority from codec from allow/disallow
|
||||
-- Reject SIP calls to self
|
||||
-- Allow SIP registration to provide an alternative contact
|
||||
-- Make HOLD on SIP make use of asterisk MOH
|
||||
-- Add supervised transfer (tested with Pingtel only)
|
||||
-- Allow maxexpirey and defaultexpirey to be runtime configurable for SIP
|
||||
-- Preliminary codec 13 support (RFC3389)
|
||||
-- Add app_authenticate for general purpose authentication
|
||||
-- Optimize RTP and smoother
|
||||
-- Create special variable "EXTEN-n" where it is extension stripped by n MSD
|
||||
-- Fix uninitialized frame pointer in channel.c
|
||||
-- Add global variables support under [globals] of extensions.conf
|
||||
-- Add macro support (show application Macro)
|
||||
-- Allow [123-5] etc in extensions
|
||||
-- Allow format of App(arg1,arg2,...) instead of just App,arg1|arg2 in dialplan
|
||||
-- Add message waiting indicator to SIP
|
||||
-- Fix double free bug in channel.c
|
||||
Asterisk 0.3.0
|
||||
-- Add fastfoward, rewind, seek, and truncate functions to streams
|
||||
-- Support registration
|
||||
-- Add G729 format
|
||||
-- Permit applications to return a digit indicating new extension
|
||||
-- Change "SHUTDOWN" to "STOP" in commands
|
||||
-- SIP "Hold" fixes and VXML URI support
|
||||
-- New chan_zap with 160 sample chunk size
|
||||
-- Add DTMF, MF, and Fax tone detector to dsp routines
|
||||
-- Allow overlap dialing (inbound) on PRI
|
||||
-- Enable tone detection with PRI
|
||||
-- Add special information tone detection
|
||||
-- Add Asterisk DB support
|
||||
-- Add pulse dialing
|
||||
-- Re-record all system prompts
|
||||
-- Change "timelen" to samples for better accuracy
|
||||
-- Move to editline, eliminating readline dependency
|
||||
-- Add peer "poke" support to SIP and IAX
|
||||
-- Add experimental call progress detection
|
||||
-- Add SIP authentication (digest)
|
||||
-- Add RDNIS
|
||||
-- Reroute faxes to "fax" extension
|
||||
-- Create ISDN/modem group concept
|
||||
-- Centralize indication
|
||||
-- Add initial MGCP support
|
||||
-- SIP debugging cleanup
|
||||
-- SIP reload
|
||||
-- SIP commands (show channels, etc)
|
||||
-- Add optional busy detection
|
||||
-- Add Visual Message Waiting Indicator (MDMF and SDMF)
|
||||
-- Add ambiguous extension matching
|
||||
-- Add *69
|
||||
-- Major SIP enhancements from SIPit
|
||||
-- Rewrite of ZAP CLASS features using subchannels
|
||||
-- Enhanced call parking
|
||||
-- Add extended outgoing spool support (pbx_spool)
|
||||
Asterisk 0.2.0
|
||||
-- Outbound origination API
|
||||
-- Call management improvements
|
||||
-- Add Do Not Disturb (*78, *79)
|
||||
-- Add agents
|
||||
-- Document variables
|
||||
-- Add transfer capability on the console
|
||||
-- Add SpeeX codec translator
|
||||
-- Add call queues
|
||||
-- Add setcallerid functionality (AGI, application)
|
||||
-- Add special variables ${CALLERID}, ${EXTEN}, ${CONTEXT}, ${PRIORITY}
|
||||
-- Don't echo cancel on pure TDM connections by default
|
||||
-- Implement Async GOTO
|
||||
-- Differentiate softhangups
|
||||
-- Add date/time
|
||||
Asterisk 0.1.12
|
||||
-- Fix for Big Endian machines
|
||||
-- MySQL CDR Engine
|
||||
-- Various SIP fixes and enhancements
|
||||
-- Add "zapateller application and arbitrary tone pairs
|
||||
-- Don't always start at "s"
|
||||
-- Separate linear mode for pseudo and real
|
||||
-- Add initial RTP and SIP support (no jitter buffer yet, unknown stability)
|
||||
-- Add 'h' extension, executed on hangup
|
||||
-- Add duration timer to message info
|
||||
-- Add web based voicemail checking ("make webvmail")
|
||||
-- Add ast_queue_frame function and eliminate frame pipes in most drivers
|
||||
-- Centralize host access (and possibly future ACL's)
|
||||
-- Add Caller*ID on PhoneJack (Thanks Nathan)
|
||||
-- Add "safe_asterisk" wrapper script to auto-restart Asterisk
|
||||
-- Indicate ringback on chan_phone
|
||||
-- Add answer confirmation (press '#' to confirm answer)
|
||||
-- Add distinctive ring support (e.g. Dial,Zap/4r2)
|
||||
-- Add ANSI/vt100 color support
|
||||
-- Make parking configurable through parking.conf
|
||||
-- Fix the empty voicemail problem
|
||||
-- Add Music On Hold
|
||||
-- Add ADSI Compiler (app_adsiprog)
|
||||
-- Extensive DISA re-work to improve tone generation
|
||||
-- Reset all idle channels every 10 minutes on a PRI
|
||||
-- Reset channels which are hungup with "channel in use"
|
||||
-- Implement VNAK support in chan_iax
|
||||
-- Fix chan_oss to support proper hangups and autoanswer
|
||||
-- Make shutdown properly hangup channels
|
||||
-- Add idling capability to chan_zap for idle-net
|
||||
-- Add "MeetMe" conferencing app (app_meetme)
|
||||
-- Add timing information to include
|
||||
Asterisk 0.1.11
|
||||
-- Add ISDN RAS capability
|
||||
-- Add stutter dialtone to Chan Zap
|
||||
-- Add "#include" capability to config files.
|
||||
-- Add call-forward variable to Chan Zap (*72, *73)
|
||||
-- Optimize IAX flow when transfer isn't possible
|
||||
-- Allow transmission of ANI over IAX
|
||||
Asterisk 0.1.10
|
||||
-- Make ast_readstring parameter be the max # of digits, not the max size with \0
|
||||
-- Make up any missing messages on the fly
|
||||
-- Add support for specific DTMF interruption to saying numbers
|
||||
-- Add new "u" and "b" options to condense busy/unavail handling
|
||||
-- Add support for RSA authentication on IAX calls
|
||||
-- Add support for ADSI compatible CPE
|
||||
-- Outgoing call queue
|
||||
-- Remote dialplan fixes for Quicknet
|
||||
-- Added AGI commands supporting TDD functions (RECEIVE CHAR & TDD MODE)
|
||||
-- Added TDD support (send/receive text in chan_zap)
|
||||
-- Fix all strncpy references
|
||||
-- Implement CSV CDR backend
|
||||
-- Implement Call Detail Records
|
||||
Asterisk 0.1.9
|
||||
-- Implement IAX quelching
|
||||
-- Allow Caller*ID to be overridden and suggested
|
||||
-- Configure defaults to use IAXTEL
|
||||
-- Allow remote dialplan polling via IAX
|
||||
-- Eliminate ast_longest_extension
|
||||
-- Implement dialplan request/reply
|
||||
-- Let peers have allow/disallow for codecs
|
||||
-- Change allow/deny to permit/deny in IAX
|
||||
-- Allow dialplan entries to match Caller*ID as well
|
||||
-- Added AGI (Asterisk Gateway Interface) scripting interface (app_agi)
|
||||
-- Added chan_zap for zapata telephony kernel interface, removed chan_tor
|
||||
-- Add convenience functions
|
||||
-- Fix race condition in channel hangup
|
||||
-- Fix memory leaks in both asterisk and iax frame allocations
|
||||
-- Add "iax show stats" command and -DTRACE_FRAMES (for frame tracing)
|
||||
-- Add DISA application (Thanks to Jim Dixon)
|
||||
-- Add IAX transfer support
|
||||
-- Add URL and HTML transmission
|
||||
-- Add application for sending images
|
||||
-- Add RedHat RPM spec file and build capability
|
||||
-- Fix GSM WAV file format bug
|
||||
-- Move ignorepat to main dialplan
|
||||
-- Add ability to specificy TOS bits in IAX
|
||||
-- Allow username:password in IAX strings
|
||||
-- Updates to PhoneJack interface
|
||||
-- Allow "servermail" in voicemail.conf to override e-mail in "from" line
|
||||
-- Add 'skip' option to app_playback
|
||||
-- Reject IAX calls on unknown extensions
|
||||
-- Fix version stuff
|
||||
Asterisk 0.1.8
|
||||
-- Keep track of version information
|
||||
-- Add -f to cause Asterisk not to fork
|
||||
-- Keep important information in voicemail .txt file
|
||||
-- Adtran Voice over Frame Relay updates
|
||||
-- Implement option setting/querying of channel drivers
|
||||
-- IAX performance improvements and protocol fixes
|
||||
-- Substantial enhancement of console channel driver
|
||||
-- Add IAX registration. Now IAX can dynamically register
|
||||
-- Add flash-hook transfer on tormenta channels
|
||||
-- Added Three Way Calling on tormenta channels
|
||||
-- Start on concept of zombie channel
|
||||
-- Add Call Waiting CallerID
|
||||
-- Keep track of who registeres contexts, includes, and extensions
|
||||
-- Added Call Waiting(tm), *67, *70, and *82 codes
|
||||
-- Move parked calls into "parkedcalls" context by default
|
||||
-- Allow dialplan to be displayed
|
||||
-- Allow "=>" instead of just "=" to make instantiation clearer
|
||||
-- Asterisk forks if called with no arguments
|
||||
-- Add remote control by running asterisk -vvvc
|
||||
-- Adjust verboseness with "set verbose" now
|
||||
-- No longer requires libaudiofile
|
||||
-- Install beep
|
||||
-- Make PBX Config module reload extensions on SIGHUP
|
||||
-- Allow modules to be reloaded when SIGHUP is received
|
||||
-- Variables now contain line numbers
|
||||
-- Make dialer send in band signalling
|
||||
-- Add record application
|
||||
-- Added PRI signalling to Tormenta driver
|
||||
-- Allow use of BYEXTENSION in "Goto"
|
||||
-- Allow adjustment of gains on tormenta channels
|
||||
-- Added raw PCM file format support
|
||||
-- Add U-law translator
|
||||
-- Fix DTMF handling in bridge code
|
||||
-- Fix access control with IAX
|
||||
* Asterisk 0.1.7
|
||||
-- Update configuration files and add some missing sounds
|
||||
-- Added ability to include one context in another
|
||||
-- Rewrite of PBX switching
|
||||
-- Major mods to dialler application
|
||||
-- Added Caller*ID spill reception
|
||||
-- Added Dialogic VOX file format support
|
||||
-- Added ADPCM Codec
|
||||
-- Add Tormenta driver (RBS signalling)
|
||||
-- Add Caller*ID spill creation
|
||||
-- Rewrite of translation layer entirely
|
||||
-- Add ability to run PBX without additional thread
|
||||
* Asterisk 0.1.6
|
||||
-- Make app_dial handle a lack of translators smoothly
|
||||
-- Add ISDN4Linux support -- dtmf is weird...
|
||||
-- Minor bug fixes
|
||||
* Asterisk 0.1.5
|
||||
-- Fix a small mistake in IAX
|
||||
-- Fix the QuickNet driver to work with newer cards
|
||||
* Asterisk 0.1.4
|
||||
-- Update VoFR some more
|
||||
-- Fix the QuickNet driver to work with LineJack
|
||||
-- Add ability to pass images for IAX.
|
||||
* Asterisk 0.1.3
|
||||
-- Update VoFR for latest sangoma code
|
||||
-- Update QuickNet Driver
|
||||
-- Add text message handling
|
||||
-- Fix transfers to use "default" if not in current context
|
||||
-- Add call parking
|
||||
-- Improve format/content negotiation
|
||||
-- Added support for multiple languages
|
||||
-- Bug fixes, as always...
|
||||
* Asterisk 0.1.2
|
||||
-- Updated README file with a "Getting Started" section
|
||||
-- Added sample sounds and configuration files.
|
||||
-- Added LPC10 very low bandwidth (low quality) compression
|
||||
-- Enhanced translation selection mechanism.
|
||||
-- Enhanced IAX jitter buffer, improved reliability
|
||||
-- Support echo cancelation on PhoneJack
|
||||
-- Updated PhoneJack driver to std. Telephony interface
|
||||
-- Added app_echo for evaluating VoIP latency
|
||||
-- Added app_system to execute arbitrary programs
|
||||
-- Updated sample configuration files
|
||||
-- Added OSS channel driver (full duplex only)
|
||||
-- Added IAX implementation
|
||||
-- Fixed some deadlocks.
|
||||
-- A whole bunch of bug fixes
|
||||
* Asterisk 0.1.1
|
||||
-- Revised translator, fixed some general race conditions throughout *
|
||||
-- Made dialer somewhat more aware of incompatible voice channels
|
||||
-- Added Voice Modem driver and A/Open Modem Driver stub
|
||||
-- Added MP3 decoder channel
|
||||
-- Added Microsoft WAV49 support
|
||||
-- Revised License -- Pure GPL, nothing else
|
||||
-- Modified Copyright statement since code is still currently owned by author
|
||||
-- Added RAW GSM headerless data format
|
||||
-- Innumerable bug fixes
|
||||
* Asterisk 0.1.0
|
||||
-- Initial Release
|
||||
* Add new applications:
|
||||
-- AgentMonitorOutgoing
|
||||
-- Curl
|
||||
-- ExecIf
|
||||
-- ExecIfTime
|
||||
-- IAX2Provision
|
||||
-- MacroExit
|
||||
-- MacroIf
|
||||
-- PauseQueueMember
|
||||
-- ReadFile
|
||||
-- SetRDNIS
|
||||
-- SIPAddHeader
|
||||
-- SIPGetHeader
|
||||
-- StartMusicOnHold
|
||||
-- StopMusicOnHold
|
||||
-- UnpauseQueueMember
|
||||
-- WaitForSilence
|
||||
-- While / EndWhile
|
||||
* app Answer
|
||||
-- added delay option
|
||||
* app ChanIsAvail
|
||||
-- added 's' option
|
||||
* app Dial
|
||||
-- add option to specify the class for musiconhold with m option
|
||||
* app EnumLookup
|
||||
-- added "reload enum" for configuration
|
||||
* app Goto
|
||||
-- added relative priorities
|
||||
* app GotoIf
|
||||
-- added relative priorities
|
||||
* app MeetMe
|
||||
-- added 'i' option
|
||||
-- added 'r' option
|
||||
-- added 'T' option
|
||||
-- added 'P' option
|
||||
-- added 'c' option
|
||||
-- added adminpin to meetme.conf
|
||||
-- added reload command
|
||||
* app PrivacyManager
|
||||
-- add config file privacy.conf
|
||||
* app queue
|
||||
-- queues.conf
|
||||
-- added persistentmembers option to queues.conf
|
||||
-- changed music option to musiconhold
|
||||
-- added weight option
|
||||
-- added note about why agent groups probably shouldn't be used
|
||||
-- added timeoutrestart option
|
||||
* app Read
|
||||
-- added attempts parameter
|
||||
-- added timeout parameter
|
||||
* app Record
|
||||
-- added 'q' option
|
||||
* app SendDTMF
|
||||
-- add timeout option
|
||||
* app SMS
|
||||
-- document alternative syntax for queueing messages
|
||||
* app Voicemail
|
||||
-- add info about VM_CATEGORY
|
||||
-- voicemail.conf
|
||||
-- added usedirectory option
|
||||
-- added VM_CIDNUM and VM_CIDNAME in message config
|
||||
* chan IAX2
|
||||
-- new jitterbuffer
|
||||
-- added setvar option
|
||||
-- added regex to iax2 show peers/users
|
||||
-- allow multiple bindaddr lines in iax.conf
|
||||
-- added reload command
|
||||
-- added forcejitterbuffer option
|
||||
-- added note about specifying bindport before bindaddr
|
||||
-- added trunktimestamps option
|
||||
* chan Agent
|
||||
-- added agent logoff CLI command
|
||||
* chan OSS
|
||||
-- added Flash CLI command
|
||||
* chan SIP
|
||||
-- added setvar option
|
||||
-- added compactheaders option
|
||||
-- added usereqphone option
|
||||
-- added registertimeout option
|
||||
-- added externhost option
|
||||
-- added sip notify CLI command
|
||||
-- added sip_notify.conf
|
||||
-- added allowguest option
|
||||
* chan Zap
|
||||
-- added hanguponplarityswitch option
|
||||
-- added sendcalleridafter option
|
||||
-- added priresetinterval option
|
||||
-- added TON/NPI config options (the ones right above the resetinterval option)
|
||||
-- added answeronpolarityswitch option
|
||||
-- added "never" for resetinterval
|
||||
* extensions
|
||||
-- allow '*' when including files (#include "sip-*.conf")
|
||||
-- added eswitch
|
||||
* General
|
||||
-- added #exec syntax for including output from a command
|
||||
-- added show features CLI command
|
||||
-- added configuration templates for category inheritance
|
||||
|
4
CREDITS
Executable file → Normal file
4
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 ===
|
||||
@@ -85,7 +87,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 ===
|
||||
|
||||
|
344
Makefile
Executable file → Normal file
344
Makefile
Executable file → Normal file
@@ -36,20 +36,24 @@ 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
|
||||
######### which support MMX instructions. This should be newer pentiums,
|
||||
######### ppro's, etc, as well as the AMD K6 and K7.
|
||||
#K6OPT = -DK6OPT
|
||||
|
||||
#Tell gcc to optimize the code
|
||||
OPTIMIZE+=-O6
|
||||
endif
|
||||
|
||||
#Overwite config files on "make samples"
|
||||
OVERWRITE=y
|
||||
|
||||
#Tell gcc to optimize the code
|
||||
OPTIMIZE+=-O6
|
||||
|
||||
#Include debug symbols in the executables (-g) and profiling info (-pg)
|
||||
DEBUG=-g #-pg
|
||||
#Include debug and macro symbols in the executables (-g) and profiling info (-pg)
|
||||
DEBUG=-g3 #-pg
|
||||
|
||||
#Set NOCRYPTO to yes if you do not want to have crypto support or
|
||||
#dependencies
|
||||
@@ -87,7 +91,9 @@ INSTALL_PREFIX?=
|
||||
# Files are copied here temporarily during the install process
|
||||
# For example, make DESTDIR=/tmp/asterisk woud put things in
|
||||
# /tmp/asterisk/etc/asterisk
|
||||
DESTDIR=
|
||||
# XXX watch out, put no spaces or comments after the value
|
||||
DESTDIR?=
|
||||
#DESTDIR?=/tmp/asterisk
|
||||
|
||||
# Original busydetect routine
|
||||
BUSYDETECT = #-DBUSYDETECT
|
||||
@@ -101,7 +107,10 @@ BUSYDETECT+= #-DBUSYDETECT_TONEONLY
|
||||
# Don't use together with -DBUSYDETECT_TONEONLY
|
||||
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
|
||||
|
||||
ifneq (${OSARCH},SunOS)
|
||||
# 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
|
||||
ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
|
||||
@@ -164,7 +173,7 @@ ifneq ($(wildcard ~/.asterisk.makeopts),)
|
||||
include ~/.asterisk.makeopts
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},Linux)
|
||||
ifeq ($(OSARCH),Linux)
|
||||
ifeq ($(CROSS_COMPILE),)
|
||||
PROC?=$(shell uname -m)
|
||||
else
|
||||
@@ -175,7 +184,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)
|
||||
@@ -196,28 +204,30 @@ 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
|
||||
ID=id
|
||||
|
||||
ifeq (${OSARCH},SunOS)
|
||||
ifeq ($(OSARCH),SunOS)
|
||||
GREP=/usr/xpg4/bin/grep
|
||||
M4=/usr/local/bin/m4
|
||||
ID=/usr/xpg4/bin/id
|
||||
endif
|
||||
|
||||
INCLUDE+=-Iinclude -I../include
|
||||
ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
|
||||
ASTCFLAGS+=$(OPTIMIZE)
|
||||
ASTOBJ=-o asterisk
|
||||
|
||||
ifeq ($(findstring BSD,${OSARCH}),BSD)
|
||||
ifeq ($(findstring BSD,$(OSARCH)),BSD)
|
||||
PROC=$(shell uname -m)
|
||||
ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
|
||||
endif
|
||||
@@ -238,62 +248,97 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},FreeBSD)
|
||||
ifeq ($(OSARCH),FreeBSD)
|
||||
BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
|
||||
ASTCFLAGS+=$(shell if test ${BSDVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
|
||||
LIBS+=$(shell if test ${BSDVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
|
||||
ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
|
||||
LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
|
||||
ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
|
||||
ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
|
||||
endif
|
||||
MPG123TARG=freebsd
|
||||
|
||||
# XXX FreeBSD paths
|
||||
PREFIX?=/usr/local
|
||||
ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
|
||||
ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
|
||||
ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
|
||||
ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
|
||||
ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
|
||||
ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
|
||||
ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
|
||||
ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
|
||||
ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
|
||||
ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
|
||||
ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
|
||||
# XXX end FreeBSD paths
|
||||
|
||||
endif # FreeBSD
|
||||
|
||||
ifeq (${OSARCH},NetBSD)
|
||||
ifeq ($(OSARCH),NetBSD)
|
||||
ASTCFLAGS+=-pthread
|
||||
INCLUDE+=-I$(CROSS_COMPILE_TARGET)/usr/pkg/include
|
||||
MPG123TARG=netbsd
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},OpenBSD)
|
||||
ifeq ($(OSARCH),OpenBSD)
|
||||
ASTCFLAGS+=-pthread
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},SunOS)
|
||||
ifeq ($(OSARCH),SunOS)
|
||||
ASTCFLAGS+=-Wcast-align -DSOLARIS
|
||||
INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
|
||||
endif
|
||||
|
||||
ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
|
||||
CYGLOADER=cygwin_a
|
||||
OSARCH=CYGWIN
|
||||
ASTOBJ=-shared -o asterisk.dll -Wl,--out-implib=libasterisk.dll.a -Wl,--export-all-symbols
|
||||
ASTLINK=
|
||||
LIBS+=-lpthread -lncurses -lm -lresolv
|
||||
ASTSBINDIR=$(MODULES_DIR)
|
||||
PROC=$(shell uname -m)
|
||||
endif
|
||||
|
||||
ifndef WITHOUT_ZAPTEL
|
||||
|
||||
ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
|
||||
ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
|
||||
endif
|
||||
|
||||
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 "%02d%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 \
|
||||
@@ -316,37 +361,39 @@ ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/dlfcn.h),)
|
||||
ASTCFLAGS+=-DDLFCNCOMPAT
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},Linux)
|
||||
ifeq ($(OSARCH),Linux)
|
||||
LIBS+=-ldl -lpthread -lncurses -lm -lresolv #-lnjamd
|
||||
else
|
||||
LIBS+=-lncurses -lm
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},Darwin)
|
||||
ifeq ($(OSARCH),Darwin)
|
||||
LIBS+=-lresolv
|
||||
ASTCFLAGS+=-D__Darwin__
|
||||
AUDIO_LIBS=-framework CoreAudio
|
||||
ASTLINK=-Wl,-dynamic
|
||||
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
|
||||
OBJS+= poll.o
|
||||
ASTCFLAGS+=-DPOLLCOMPAT
|
||||
else
|
||||
#These are used for all but Darwin
|
||||
ASTLINK=-Wl,-E
|
||||
SOLINK=-shared -Xlinker -x
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},FreeBSD)
|
||||
ifeq ($(OSARCH),FreeBSD)
|
||||
LIBS+=-lcrypto
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},NetBSD)
|
||||
ifeq ($(OSARCH),NetBSD)
|
||||
LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib -lncurses
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},OpenBSD)
|
||||
ifeq ($(OSARCH),OpenBSD)
|
||||
LIBS+=-lcrypto -lpthread -lm -lncurses
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},SunOS)
|
||||
ifeq ($(OSARCH),SunOS)
|
||||
LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
|
||||
OBJS+=strcompat.o
|
||||
ASTLINK=
|
||||
@@ -357,6 +404,13 @@ ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
|
||||
CFLAGS+=$(ASTCFLAGS)
|
||||
endif
|
||||
|
||||
# This is used when generating the doxygen documentation
|
||||
ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
|
||||
HAVEDOT=yes
|
||||
else
|
||||
HAVEDOT=no
|
||||
endif
|
||||
|
||||
LIBS+=-lssl
|
||||
|
||||
INSTALL=install
|
||||
@@ -383,10 +437,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
|
||||
@@ -444,18 +498,6 @@ defaults.h: FORCE
|
||||
fi
|
||||
rm -f $@.tmp
|
||||
|
||||
include/asterisk/build.h:
|
||||
build_tools/make_build_h > $@.tmp
|
||||
if cmp -s $@.tmp $@ ; then echo ; else \
|
||||
mv $@.tmp $@ ; \
|
||||
fi
|
||||
rm -f $@.tmp
|
||||
|
||||
# only force 'build.h' to be made for a non-'install' run
|
||||
ifeq ($(findstring install,$(MAKECMDGOALS)),)
|
||||
include/asterisk/build.h: FORCE
|
||||
endif
|
||||
|
||||
include/asterisk/version.h: FORCE
|
||||
build_tools/make_version_h > $@.tmp
|
||||
if cmp -s $@.tmp $@ ; then echo; else \
|
||||
@@ -471,8 +513,17 @@ stdtime/libtime.a: FORCE
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
|
||||
$(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
|
||||
cygwin_a:
|
||||
$(MAKE) -C cygwin all
|
||||
|
||||
asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
|
||||
build_tools/make_build_h > include/asterisk/build.h.tmp
|
||||
if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
|
||||
mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
|
||||
fi
|
||||
rm -f include/asterisk/build.h.tmp
|
||||
$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
|
||||
$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
|
||||
|
||||
muted: muted.o
|
||||
$(CC) $(AUDIO_LIBS) -o muted muted.o
|
||||
@@ -493,7 +544,7 @@ 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/priv-callerintros
|
||||
for x in sounds/digits/*.gsm; do \
|
||||
@@ -547,17 +598,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; \
|
||||
@@ -566,19 +616,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))
|
||||
@@ -595,7 +634,10 @@ bininstall: all
|
||||
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
|
||||
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
|
||||
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
|
||||
$(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
|
||||
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
|
||||
$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
|
||||
$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
|
||||
@@ -603,13 +645,11 @@ bininstall: all
|
||||
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
|
||||
@@ -628,30 +668,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)))
|
||||
@@ -674,10 +694,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
|
||||
|
||||
@@ -706,22 +748,24 @@ samples: adsi
|
||||
fi ; \
|
||||
$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
|
||||
done
|
||||
if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
|
||||
echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo "" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo "; Changing the following lines may compromise your security." >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo ";[files]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo ";astctlpermissions = 0660" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo ";astctlowner = root" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo ";astctlgroup = apache" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
echo ";astctl = asterisk.ctl" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
||||
if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
|
||||
( \
|
||||
echo "[directories]" ; \
|
||||
echo "astetcdir => $(ASTETCDIR)" ; \
|
||||
echo "astmoddir => $(MODULES_DIR)" ; \
|
||||
echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
|
||||
echo "astagidir => $(AGI_DIR)" ; \
|
||||
echo "astspooldir => $(ASTSPOOLDIR)" ; \
|
||||
echo "astrundir => $(ASTVARRUNDIR)" ; \
|
||||
echo "astlogdir => $(ASTLOGDIR)" ; \
|
||||
echo "" ; \
|
||||
echo "; Changing the following lines may compromise your security." ; \
|
||||
echo ";[files]" ; \
|
||||
echo ";astctlpermissions = 0660" ; \
|
||||
echo ";astctlowner = root" ; \
|
||||
echo ";astctlgroup = apache" ; \
|
||||
echo ";astctl = asterisk.ctl" ; \
|
||||
) > $(DESTDIR)$(ASTCONFPATH) ; \
|
||||
else \
|
||||
echo "Skipping asterisk.conf creation"; \
|
||||
fi
|
||||
@@ -786,11 +830,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:
|
||||
doxygen contrib/asterisk-ng-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 )
|
||||
@@ -806,23 +851,22 @@ config:
|
||||
$(INSTALL) -m 755 init.asterisk /etc/init.d/asterisk; \
|
||||
fi
|
||||
|
||||
dont-optimize:
|
||||
$(MAKE) OPTIMIZE= K6OPT= install
|
||||
dont-optimize: install
|
||||
|
||||
valgrind: dont-optimize
|
||||
|
||||
depend: include/asterisk/build.h include/asterisk/version.h .depend defaults.h
|
||||
depend: include/asterisk/version.h .depend defaults.h
|
||||
for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
|
||||
|
||||
.depend: include/asterisk/version.h
|
||||
build_tools/mkdep ${CFLAGS} $(wildcard *.c)
|
||||
build_tools/mkdep $(CFLAGS) $(wildcard *.c)
|
||||
|
||||
.tags-depend:
|
||||
@echo -n ".tags-depend: " > $@
|
||||
@find . -maxdepth 1 -name \*.c -printf "\t%p \\\\\n" >> $@
|
||||
@find . -maxdepth 1 -name \*.h -printf "\t%p \\\\\n" >> $@
|
||||
@find ${SUBDIRS} -name \*.c -printf "\t%p \\\\\n" >> $@
|
||||
@find ${SUBDIRS} -name \*.h -printf "\t%p \\\\\n" >> $@
|
||||
@find $(SUBDIRS) -name \*.c -printf "\t%p \\\\\n" >> $@
|
||||
@find $(SUBDIRS) -name \*.h -printf "\t%p \\\\\n" >> $@
|
||||
@find include -name \*.h -printf "\t%p \\\\\n" >> $@
|
||||
@echo >> $@
|
||||
|
||||
@@ -830,8 +874,8 @@ depend: include/asterisk/build.h include/asterisk/version.h .depend defaults.h
|
||||
@rm -f $@
|
||||
@find . -maxdepth 1 -name \*.c -print >> $@
|
||||
@find . -maxdepth 1 -name \*.h -print >> $@
|
||||
@find ${SUBDIRS} -name \*.c -print >> $@
|
||||
@find ${SUBDIRS} -name \*.h -print >> $@
|
||||
@find $(SUBDIRS) -name \*.c -print >> $@
|
||||
@find $(SUBDIRS) -name \*.h -print >> $@
|
||||
@find include -name \*.h -print >> $@
|
||||
|
||||
tags: .tags-depend .tags-sources
|
||||
@@ -861,47 +905,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
|
25
UPGRADE.txt
Executable file → Normal file
25
UPGRADE.txt
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
Information for Upgrading From Asterisk 1.0
|
||||
===========================================
|
||||
Information for Upgrading From Previous Asterisk Releases
|
||||
=========================================================
|
||||
|
||||
Compiling:
|
||||
|
||||
@@ -34,6 +34,13 @@ Agents:
|
||||
string from the extension, so that they do not conflict. See
|
||||
'show application AgentCallbackLogin' for more details.
|
||||
|
||||
Parking:
|
||||
|
||||
* Parking behavior has changed slightly; when a parked call times out,
|
||||
Asterisk will attempt to deliver the call back to the extension that
|
||||
parked it, rather than the 's' extension. If that extension is busy
|
||||
or unavailable, the parked call will be lost.
|
||||
|
||||
Dialing:
|
||||
|
||||
* The Caller*ID of the outbound leg is now the extension that was
|
||||
@@ -45,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:
|
||||
|
||||
@@ -122,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
|
||||
@@ -153,6 +167,9 @@ AGI:
|
||||
at the end of AGI being called (e.g. on a hangup) then set SIGHUP to
|
||||
be ignored within your application.
|
||||
|
||||
* CallerID is reported with agi_callerid and agi_calleridname instead
|
||||
of a single parameter holding both.
|
||||
|
||||
Music On Hold:
|
||||
|
||||
* The preferred format for musiconhold.conf has changed; please see the
|
||||
|
1
acl.c
Executable file → Normal file
1
acl.c
Executable file → Normal file
@@ -68,6 +68,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/lock.h"
|
||||
#include "asterisk/srv.h"
|
||||
#include "asterisk/compat.h"
|
||||
|
||||
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
|
||||
AST_MUTEX_DEFINE_STATIC(routeseq_lock);
|
||||
|
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
136
app.c
Executable file → Normal file
136
app.c
Executable file → Normal file
@@ -52,11 +52,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#define MAX_OTHER_FORMATS 10
|
||||
|
||||
|
||||
/*
|
||||
/* !
|
||||
This function presents a dialtone and reads an extension into 'collect'
|
||||
which must be a pointer to a **pre-initilized** array of char having a
|
||||
size of 'size' suitable for writing to. It will collect no more than the smaller
|
||||
of 'maxlen' or 'size' minus the original strlen() of collect digits.
|
||||
\return 0 if extension does not exist, 1 if extension exists
|
||||
*/
|
||||
int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout)
|
||||
{
|
||||
@@ -103,7 +104,7 @@ int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect,
|
||||
|
||||
|
||||
|
||||
/* set timeout to 0 for "standard" timeouts. Set timeout to -1 for
|
||||
/*! \param timeout set timeout to 0 for "standard" timeouts. Set timeout to -1 for
|
||||
"ludicrous time" (essentially never times out) */
|
||||
int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout)
|
||||
{
|
||||
@@ -315,8 +316,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;
|
||||
}
|
||||
@@ -429,11 +434,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);
|
||||
@@ -455,9 +460,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")) {
|
||||
@@ -468,25 +470,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)
|
||||
@@ -495,17 +490,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;
|
||||
@@ -515,17 +509,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;
|
||||
}
|
||||
@@ -544,7 +537,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;
|
||||
@@ -558,8 +551,8 @@ 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;
|
||||
|
||||
if (silencethreshold < 0)
|
||||
silencethreshold = global_silence_threshold;
|
||||
@@ -595,7 +588,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);
|
||||
@@ -615,8 +608,6 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
|
||||
if (path)
|
||||
ast_unlock_path(path);
|
||||
|
||||
|
||||
|
||||
if (maxsilence > 0) {
|
||||
sildet = ast_dsp_new(); /* Create the silence detector */
|
||||
if (!sildet) {
|
||||
@@ -632,9 +623,13 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Request a video update */
|
||||
ast_indicate(chan, AST_CONTROL_VIDUPDATE);
|
||||
|
||||
if (option_transmit_silence_during_record)
|
||||
silgen = ast_channel_start_silence_generator(chan);
|
||||
|
||||
if (x == fmtcnt) {
|
||||
/* Loop forever, writing the packets we read to the writer(s), until
|
||||
we read a # or get a hangup */
|
||||
@@ -678,7 +673,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;
|
||||
}
|
||||
@@ -693,19 +688,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;
|
||||
@@ -735,6 +729,9 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
|
||||
ast_log(LOG_WARNING, "Error creating writestream '%s', format '%s'\n", recordfile, sfmt[x]);
|
||||
}
|
||||
|
||||
if (silgen)
|
||||
ast_channel_stop_silence_generator(chan, silgen);
|
||||
|
||||
*duration = end - start;
|
||||
|
||||
for (x=0;x<fmtcnt;x++) {
|
||||
@@ -764,6 +761,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;
|
||||
@@ -779,7 +784,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];
|
||||
|
||||
@@ -820,7 +824,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);
|
||||
@@ -848,6 +852,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;
|
||||
}
|
||||
}
|
||||
@@ -897,7 +902,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;
|
||||
}
|
||||
@@ -952,6 +957,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) {
|
||||
@@ -1099,7 +1105,7 @@ int ast_app_group_match_get_count(char *groupmatch, char *category)
|
||||
return count;
|
||||
}
|
||||
|
||||
int ast_separate_app_args(char *buf, char delim, char **array, int arraylen)
|
||||
unsigned int ast_app_separate_args(char *buf, char delim, char **array, int arraylen)
|
||||
{
|
||||
int argc;
|
||||
char *scan;
|
||||
@@ -1517,41 +1523,41 @@ char *ast_read_textfile(const char *filename)
|
||||
return output;
|
||||
}
|
||||
|
||||
int ast_parseoptions(const struct ast_option *options, struct ast_flags *flags, char **args, char *optstr)
|
||||
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
|
||||
{
|
||||
char *s;
|
||||
int curarg;
|
||||
int argloc;
|
||||
unsigned int argloc;
|
||||
char *arg;
|
||||
int res = 0;
|
||||
|
||||
flags->flags = 0;
|
||||
ast_clear_flag(flags, AST_FLAGS_ALL);
|
||||
|
||||
if (!optstr)
|
||||
return 0;
|
||||
|
||||
s = optstr;
|
||||
while (*s) {
|
||||
curarg = *s & 0x7f;
|
||||
flags->flags |= options[curarg].flag;
|
||||
curarg = *s++ & 0x7f;
|
||||
ast_set_flag(flags, options[curarg].flag);
|
||||
argloc = options[curarg].arg_index;
|
||||
s++;
|
||||
if (*s == '(') {
|
||||
/* Has argument */
|
||||
s++;
|
||||
arg = s;
|
||||
while (*s && (*s != ')')) s++;
|
||||
arg = ++s;
|
||||
while (*s && (*s != ')'))
|
||||
s++;
|
||||
if (*s) {
|
||||
if (argloc)
|
||||
args[argloc - 1] = arg;
|
||||
*s = '\0';
|
||||
s++;
|
||||
*s++ = '\0';
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "Missing closing parenthesis for argument '%c' in string '%s'\n", curarg, arg);
|
||||
res = -1;
|
||||
}
|
||||
} else if (argloc)
|
||||
} else if (argloc) {
|
||||
args[argloc - 1] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@@ -1 +0,0 @@
|
||||
.depend
|
33
apps/Makefile
Executable file → Normal file
33
apps/Makefile
Executable file → Normal file
@@ -15,21 +15,21 @@ APPS=app_dial.so app_playback.so app_voicemail.so app_directory.so app_mp3.so\
|
||||
app_system.so app_echo.so app_record.so app_image.so app_url.so app_disa.so \
|
||||
app_adsiprog.so app_getcpeid.so app_milliwatt.so \
|
||||
app_zapateller.so app_setcallerid.so app_festival.so \
|
||||
app_queue.so app_senddtmf.so app_parkandannounce.so app_striplsd.so \
|
||||
app_setcidname.so app_lookupcidname.so app_substring.so app_macro.so \
|
||||
app_queue.so app_senddtmf.so app_parkandannounce.so \
|
||||
app_setcidname.so app_lookupcidname.so app_macro.so \
|
||||
app_authenticate.so app_softhangup.so app_lookupblacklist.so \
|
||||
app_waitforring.so app_privacy.so app_db.so app_chanisavail.so \
|
||||
app_enumlookup.so app_transfer.so app_setcidnum.so app_cdr.so \
|
||||
app_hasnewvoicemail.so app_sayunixtime.so app_cut.so app_read.so \
|
||||
app_setcdruserfield.so app_random.so app_ices.so app_eval.so \
|
||||
app_nbscat.so app_sendtext.so app_exec.so app_sms.so \
|
||||
app_nbscat.so app_sendtext.so app_exec.so \
|
||||
app_groupcount.so app_txtcidname.so app_controlplayback.so \
|
||||
app_talkdetect.so app_alarmreceiver.so app_userevent.so app_verbose.so \
|
||||
app_test.so app_forkcdr.so app_math.so app_realtime.so \
|
||||
app_dumpchan.so app_waitforsilence.so app_while.so app_setrdnis.so \
|
||||
app_md5.so app_readfile.so app_chanspy.so app_settransfercapability.so \
|
||||
app_dictate.so app_externalivr.so app_directed_pickup.so \
|
||||
app_mixmonitor.so
|
||||
app_mixmonitor.so app_stack.so
|
||||
|
||||
#
|
||||
# Obsolete things...
|
||||
@@ -44,9 +44,11 @@ APPS=app_dial.so app_playback.so app_voicemail.so app_directory.so app_mp3.so\
|
||||
#APPS+=app_skel.so
|
||||
#APPS+=app_rpt.so
|
||||
|
||||
ifndef WITHOUT_ZAPTEL
|
||||
ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
|
||||
APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
|
||||
endif
|
||||
endif # WITHOUT_ZAPTEL
|
||||
|
||||
ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
|
||||
APPS+=app_osplookup.so
|
||||
@@ -63,7 +65,13 @@ ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},CYGWIN)
|
||||
CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
|
||||
CYGSOLIB=-L.. -L. -L../res -lasterisk.dll -lres_features.so -lres_adsi.so -lres_monitor.so
|
||||
else
|
||||
CFLAGS+=-fPIC
|
||||
APPS+=app_sms.so
|
||||
endif
|
||||
|
||||
#
|
||||
# If you have UnixODBC you can use ODBC voicemail
|
||||
@@ -78,13 +86,13 @@ CFLAGS+=-fPIC
|
||||
all: $(APPS)
|
||||
|
||||
clean:
|
||||
rm -f *.so *.o look .depend
|
||||
rm -f *.so *.o .depend
|
||||
|
||||
%.so : %.o
|
||||
$(CC) $(SOLINK) -o $@ $<
|
||||
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
|
||||
|
||||
app_rpt.so : app_rpt.o
|
||||
$(CC) $(SOLINK) -o $@ $< -ltonezone
|
||||
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -ltonezone
|
||||
|
||||
install: all
|
||||
for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
|
||||
@@ -92,19 +100,16 @@ install: all
|
||||
rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
|
||||
|
||||
app_curl.so: app_curl.o
|
||||
$(CC) $(SOLINK) -o $@ $< $(CURLLIBS)
|
||||
$(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 $@ $< -L/usr/local/pgsql/lib -lpq
|
||||
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
|
||||
|
||||
app_sql_odbc.so: app_sql_odbc.o
|
||||
$(CC) $(SOLINK) -o $@ $< -lodbc
|
||||
|
||||
look: look.c
|
||||
$(CC) -pipe -O6 -g look.c -o look -lncurses
|
||||
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
|
||||
|
||||
ifeq (SunOS,$(shell uname))
|
||||
app_chanspy.so: app_chanspy.o
|
||||
|
6
apps/app_adsiprog.c
Executable file → Normal file
6
apps/app_adsiprog.c
Executable file → Normal file
@@ -19,6 +19,7 @@
|
||||
/*! \file
|
||||
* \brief Program Asterisk ADSI Scripts into phone
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -54,9 +55,8 @@ static char *synopsis = "Load Asterisk ADSI Scripts into phone";
|
||||
/* #define DUMP_MESSAGES */
|
||||
|
||||
static char *descrip =
|
||||
" ADSIProg(script): Programs an ADSI Phone with the given script.\n"
|
||||
"If none is specified, the default is used. Returns 0 unless CPE\n"
|
||||
"is hungup.\n";
|
||||
" ADSIProg(script): This application programs an ADSI Phone with the given\n"
|
||||
"script. If nothing is specified, the default script (asterisk.adsi) is used.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
21
apps/app_alarmreceiver.c
Executable file → Normal file
21
apps/app_alarmreceiver.c
Executable file → Normal file
@@ -18,6 +18,7 @@
|
||||
|
||||
/*! \file
|
||||
* \brief Central Station Alarm receiver for Ademco Contact ID
|
||||
* \author Steve Rodgers <hwstar@rodgers.sdcoxmail.com>
|
||||
*
|
||||
* *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***
|
||||
*
|
||||
@@ -25,6 +26,7 @@
|
||||
*
|
||||
* *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -71,13 +73,15 @@ static char *app = "AlarmReceiver";
|
||||
|
||||
static char *synopsis = "Provide support for receving alarm reports from a burglar or fire alarm panel";
|
||||
static char *descrip =
|
||||
"Alarm receiver application for Asterisk. Only 1 signalling format is supported at this time:\n"
|
||||
"Ademco Contact ID. This application should be called whenever there is an alarm panel calling in\n"
|
||||
"to dump its events. The application will handshake with the alarm panel, and receive events,\n"
|
||||
"validate them, handshake them, and store them until the panel hangs up. Once the panel hangs up,\n"
|
||||
"the application will run the command line specified by the eventcmd setting in alarmreceiver.conf\n"
|
||||
"and pipe the events to the standard input of the application. Alarmreceiver.conf also contains settings\n"
|
||||
"for DTMF timing, and for the loudness of the acknowledgement tones.\n";
|
||||
" AlarmReceiver(): Only 1 signalling format is supported at this time: Ademco\n"
|
||||
"Contact ID. This application should be called whenever there is an alarm\n"
|
||||
"panel calling in to dump its events. The application will handshake with the\n"
|
||||
"alarm panel, and receive events, validate them, handshake them, and store them\n"
|
||||
"until the panel hangs up. Once the panel hangs up, the application will run the\n"
|
||||
"system command specified by the eventcmd setting in alarmreceiver.conf and pipe\n"
|
||||
"the events to the standard input of the application. The configuration file also\n"
|
||||
"contains settings for DTMF timing, and for the loudness of the acknowledgement\n"
|
||||
"tones.\n";
|
||||
|
||||
/* Config Variables */
|
||||
|
||||
@@ -554,11 +558,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 */
|
||||
|
40
apps/app_authenticate.c
Executable file → Normal file
40
apps/app_authenticate.c
Executable file → Normal file
@@ -19,6 +19,7 @@
|
||||
/*! \file
|
||||
* \brief Execute arbitrary authenticate commands
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -48,27 +49,24 @@ static char *app = "Authenticate";
|
||||
static char *synopsis = "Authenticate a user";
|
||||
|
||||
static char *descrip =
|
||||
" Authenticate(password[|options]): Requires a user to enter a"
|
||||
"given password in order to continue execution. If the\n"
|
||||
"password begins with the '/' character, it is interpreted as\n"
|
||||
"a file which contains a list of valid passwords (1 per line).\n"
|
||||
"an optional set of opions may be provided by concatenating any\n"
|
||||
"of the following letters:\n"
|
||||
" a - Set account code to the password that is entered\n"
|
||||
" d - Interpret path as database key, not literal file\n"
|
||||
" m - Interpret path as a file which contains a list of\n"
|
||||
" account codes and password hashes delimited with ':'\n"
|
||||
" one per line. When password matched, corresponding\n"
|
||||
" account code will be set\n"
|
||||
" j - Support jumping to n+101\n"
|
||||
" r - Remove database key upon successful entry (valid with 'd' only)\n"
|
||||
"\n"
|
||||
"When using a database key, the value associated with the key can be\n"
|
||||
"anything.\n"
|
||||
"Returns 0 if the user enters a valid password within three\n"
|
||||
"tries, or -1 on hangup. If the priority n+101 exists and invalid\n"
|
||||
"authentication was entered, and the 'j' flag was specified, processing\n"
|
||||
"will jump to n+101 and 0 will be returned.\n";
|
||||
" Authenticate(password[|options]): This application asks the caller to enter a\n"
|
||||
"given password in order to continue dialplan execution. If the password begins\n"
|
||||
"with the '/' character, it is interpreted as a file which contains a list of\n"
|
||||
"valid passwords, listed 1 password per line in the file.\n"
|
||||
" When using a database key, the value associated with the key can be anything.\n"
|
||||
"Users have three attempts to authenticate before the channel is hung up. If the\n"
|
||||
"passsword is invalid, the 'j' option is specified, and priority n+101 exists,\n"
|
||||
"dialplan execution will continnue at this location.\n"
|
||||
" Options:\n"
|
||||
" a - Set the channels' account code to the password that is entered\n"
|
||||
" d - Interpret the given path as database key, not a literal file\n"
|
||||
" j - Support jumping to n+101 if authentication fails\n"
|
||||
" m - Interpret the given path as a file which contains a list of account\n"
|
||||
" codes and password hashes delimited with ':', listed one per line in\n"
|
||||
" the file. When one of the passwords is matched, the channel will have\n"
|
||||
" its account code set to the corresponding account code in the file.\n"
|
||||
" r - Remove the database key upon successful entry (valid with 'd' only)\n"
|
||||
;
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
10
apps/app_cdr.c
Executable file → Normal file
10
apps/app_cdr.c
Executable file → Normal file
@@ -19,6 +19,7 @@
|
||||
/*! \file
|
||||
* \brief Applications connected with CDR engine
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -33,11 +34,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/pbx.h"
|
||||
|
||||
|
||||
static char *tdesc = "Make sure asterisk doesn't save CDR for a certain call";
|
||||
static char *tdesc = "Tell Asterisk to not maintain a CDR for the current call";
|
||||
|
||||
static char *nocdr_descrip =
|
||||
" NoCDR(): This application will tell Asterisk not to maintain a CDR for the\n"
|
||||
"current call.\n";
|
||||
|
||||
static char *nocdr_descrip = "NoCDR(): makes sure there won't be any CDR written for a certain call";
|
||||
static char *nocdr_app = "NoCDR";
|
||||
static char *nocdr_synopsis = "Make sure asterisk doesn't save CDR for a certain call";
|
||||
static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
87
apps/app_chanisavail.c
Executable file → Normal file
87
apps/app_chanisavail.c
Executable file → Normal file
@@ -1,32 +1,33 @@
|
||||
/*
|
||||
* Asterisk -- An open source telephony toolkit.
|
||||
*
|
||||
* Copyright (C) 1999 - 2005, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
* James Golovich <james@gnuinter.net>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*/
|
||||
* Asterisk -- An open source telephony toolkit.
|
||||
*
|
||||
* Copyright (C) 1999 - 2005, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
* James Golovich <james@gnuinter.net>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*/
|
||||
|
||||
/*! \file
|
||||
* \brief Check if Channel is Available
|
||||
*
|
||||
* \brief Check if Channel is Available
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -41,26 +42,24 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/app.h"
|
||||
#include "asterisk/devicestate.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
static char *tdesc = "Check if channel is available";
|
||||
static char *tdesc = "Check channel availability";
|
||||
|
||||
static char *app = "ChanIsAvail";
|
||||
|
||||
static char *synopsis = "Check if channel is available";
|
||||
static char *synopsis = "Check channel availability";
|
||||
|
||||
static char *descrip =
|
||||
" ChanIsAvail(Technology/resource[&Technology2/resource2...][|option]): \n"
|
||||
"Checks is any of the requested channels are available. If none\n"
|
||||
"of the requested channels are available the new priority will be\n"
|
||||
"n+101 (unless such a priority does not exist or on error, in which\n"
|
||||
"case ChanIsAvail will return -1).\n"
|
||||
"If any of the requested channels are available, the next priority will be n+1,\n"
|
||||
"the channel variable ${AVAILCHAN} will be set to the name of the available channel\n"
|
||||
"and the ChanIsAvail app will return 0.\n"
|
||||
"${AVAILORIGCHAN} is the canonical channel name that was used to create the channel.\n"
|
||||
"${AVAILSTATUS} is the status code for the channel.\n"
|
||||
"If the option 's' is specified (state), will consider channel unavailable\n"
|
||||
"when the channel is in use at all, even if it can take another call.\n";
|
||||
" ChanIsAvail(Technology/resource[&Technology2/resource2...][|options]): \n"
|
||||
"This application will check to see if any of the specified channels are\n"
|
||||
"available. The following variables will be set by this application:\n"
|
||||
" ${AVAILCHAN} - the name of the available channel, if one exists\n"
|
||||
" ${AVAILORIGCHAN} - the canonical channel name that was used to create the channel\n"
|
||||
" ${AVAILSTATUS} - the status code for the available channel\n"
|
||||
" Options:\n"
|
||||
" s - Consider the channel unavailable if the channel is in use at all\n"
|
||||
" j - Support jumping to priority n+101 if no channel is available\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -68,7 +67,7 @@ LOCAL_USER_DECL;
|
||||
|
||||
static int chanavail_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
int res=-1, inuse=-1, option_state=0;
|
||||
int res=-1, inuse=-1, option_state=0, priority_jump=0;
|
||||
int status;
|
||||
struct localuser *u;
|
||||
char *info, tmp[512], trychan[512], *peers, *tech, *number, *rest, *cur, *options, *stringp;
|
||||
@@ -85,8 +84,12 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
|
||||
stringp = info;
|
||||
strsep(&stringp, "|");
|
||||
options = strsep(&stringp, "|");
|
||||
if (options && *options == 's')
|
||||
option_state = 1;
|
||||
if (options) {
|
||||
if (strchr(options, 's'))
|
||||
option_state = 1;
|
||||
if (strchr(options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
peers = info;
|
||||
if (peers) {
|
||||
cur = peers;
|
||||
@@ -136,9 +139,11 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
|
||||
if (res < 1) {
|
||||
pbx_builtin_setvar_helper(chan, "AVAILCHAN", "");
|
||||
pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", "");
|
||||
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
if (priority_jump || option_priority_jumping) {
|
||||
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
92
apps/app_chanspy.c
Executable file → Normal file
92
apps/app_chanspy.c
Executable file → Normal file
@@ -19,11 +19,13 @@
|
||||
/*! \file
|
||||
* \brief ChanSpy: Listen in on any channel.
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -33,6 +35,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/file.h"
|
||||
#include "asterisk/logger.h"
|
||||
#include "asterisk/channel.h"
|
||||
#include "asterisk/chanspy.h"
|
||||
#include "asterisk/features.h"
|
||||
#include "asterisk/options.h"
|
||||
#include "asterisk/app.h"
|
||||
@@ -49,38 +52,55 @@ 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 = "Tap into any type of asterisk channel and listen to audio";
|
||||
static const char *synopsis = "Listen to the audio of an active channel\n";
|
||||
static const char *app = "ChanSpy";
|
||||
static const char *desc = " Chanspy([<scanspec>][|<options>])\n\n"
|
||||
"Valid Options:\n"
|
||||
" - q: quiet, don't announce channels beep, etc.\n"
|
||||
" - b: bridged, only spy on channels involved in a bridged call.\n"
|
||||
" - v([-4..4]): adjust the initial volume. (negative is quieter)\n"
|
||||
" - g(grp): enforce group. Match only calls where their ${SPYGROUP} is 'grp'.\n"
|
||||
" - r[(basename)]: Record session to monitor spool dir (with optional basename, default is 'chanspy')\n\n"
|
||||
"If <scanspec> is specified, only channel names *beginning* with that string will be scanned.\n"
|
||||
"('all' or an empty string are also both valid <scanspec>)\n\n"
|
||||
"While Spying:\n\n"
|
||||
"Dialing # cycles the volume level.\n"
|
||||
"Dialing * will stop spying and look for another channel to spy on.\n"
|
||||
"Dialing a series of digits followed by # builds a channel name to append to <scanspec>\n"
|
||||
"(e.g. run Chanspy(Agent) and dial 1234# while spying to jump to channel Agent/1234)\n\n"
|
||||
"";
|
||||
static const char *desc =
|
||||
" ChanSpy([chanprefix][|options]): This application is used to listen to the\n"
|
||||
"audio from an active Asterisk channel. This includes the audio coming in and\n"
|
||||
"out of the channel being spied on. If the 'chanprefix' parameter is specified,\n"
|
||||
"only channels beginning with this string will be spied upon.\n"
|
||||
" While Spying, the following actions may be performed:\n"
|
||||
" - Dialing # cycles the volume level.\n"
|
||||
" - Dialing * will stop spying and look for another channel to spy on.\n"
|
||||
" - Dialing a series of digits followed by # builds a channel name to append\n"
|
||||
" to 'chanprefix'. For example, executing ChanSpy(Agent) and then dialing\n"
|
||||
" the digits '1234#' while spying will begin spying on the channel,\n"
|
||||
" 'Agent/1234'.\n"
|
||||
" Options:\n"
|
||||
" b - Only spy on channels involved in a bridged call.\n"
|
||||
" g(grp) - Match only channels where their ${SPYGROUP} variable is set to\n"
|
||||
" 'grp'.\n"
|
||||
" q - Don't play a beep when beginning to spy on a channel.\n"
|
||||
" r[(basename)] - Record the session to the monitor spool directory. An\n"
|
||||
" optional base for the filename may be specified. The\n"
|
||||
" default is 'chanspy'.\n"
|
||||
" v([value]) - Adjust the initial volume in the range from -4 to 4. A\n"
|
||||
" negative value refers to a quieter setting.\n"
|
||||
;
|
||||
|
||||
static const char *chanspy_spy_type = "ChanSpy";
|
||||
|
||||
#define OPTION_QUIET (1 << 0) /* Quiet, no announcement */
|
||||
#define OPTION_BRIDGED (1 << 1) /* Only look at bridged calls */
|
||||
#define OPTION_VOLUME (1 << 2) /* Specify initial volume */
|
||||
#define OPTION_GROUP (1 << 3) /* Only look at channels in group */
|
||||
#define OPTION_RECORD (1 << 4) /* Record */
|
||||
enum {
|
||||
OPTION_QUIET = (1 << 0), /* Quiet, no announcement */
|
||||
OPTION_BRIDGED = (1 << 1), /* Only look at bridged calls */
|
||||
OPTION_VOLUME = (1 << 2), /* Specify initial volume */
|
||||
OPTION_GROUP = (1 << 3), /* Only look at channels in group */
|
||||
OPTION_RECORD = (1 << 4), /* Record */
|
||||
} chanspy_opt_flags;
|
||||
|
||||
AST_DECLARE_OPTIONS(chanspy_opts,{
|
||||
['q'] = { OPTION_QUIET },
|
||||
['b'] = { OPTION_BRIDGED },
|
||||
['v'] = { OPTION_VOLUME, 1 },
|
||||
['g'] = { OPTION_GROUP, 2 },
|
||||
['r'] = { OPTION_RECORD, 3 },
|
||||
enum {
|
||||
OPT_ARG_VOLUME = 0,
|
||||
OPT_ARG_GROUP,
|
||||
OPT_ARG_RECORD,
|
||||
OPT_ARG_ARRAY_SIZE,
|
||||
} chanspy_opt_args;
|
||||
|
||||
AST_APP_OPTIONS(chanspy_opts, {
|
||||
AST_APP_OPTION('q', OPTION_QUIET),
|
||||
AST_APP_OPTION('b', OPTION_BRIDGED),
|
||||
AST_APP_OPTION_ARG('v', OPTION_VOLUME, OPT_ARG_VOLUME),
|
||||
AST_APP_OPTION_ARG('g', OPTION_GROUP, OPT_ARG_GROUP),
|
||||
AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
|
||||
});
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
@@ -188,9 +208,9 @@ static int start_spying(struct ast_channel *chan, struct ast_channel *spychan, s
|
||||
|
||||
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....
|
||||
/* If our status has changed to DONE, then the channel we're spying on is gone....
|
||||
DON'T TOUCH IT!!! RUN AWAY!!! */
|
||||
if (spy->status != CHANSPY_RUNNING)
|
||||
if (spy->status == CHANSPY_DONE)
|
||||
return;
|
||||
|
||||
if (!chan)
|
||||
@@ -384,7 +404,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
ast_set_flag(chan, AST_FLAG_SPYING); /* so nobody can spy on us while we are spying */
|
||||
|
||||
if ((argc = ast_separate_app_args(args, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
|
||||
if ((argc = ast_app_separate_args(args, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
|
||||
spec = argv[0];
|
||||
if ( argc > 1) {
|
||||
options = argv[1];
|
||||
@@ -395,8 +415,8 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
|
||||
}
|
||||
|
||||
if (options) {
|
||||
char *opts[3];
|
||||
ast_parseoptions(chanspy_opts, &flags, opts, options);
|
||||
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];
|
||||
}
|
||||
@@ -419,8 +439,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;
|
||||
}
|
||||
@@ -462,7 +482,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)) {
|
||||
|
57
apps/app_controlplayback.c
Executable file → Normal file
57
apps/app_controlplayback.c
Executable file → Normal file
@@ -19,10 +19,12 @@
|
||||
/*! \file
|
||||
* \brief Trivial application to control playback of a sound file
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -37,6 +39,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/translate.h"
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
static const char *tdesc = "Control Playback Application";
|
||||
|
||||
@@ -45,14 +48,22 @@ static const char *app = "ControlPlayback";
|
||||
static const char *synopsis = "Play a file with fast forward and rewind";
|
||||
|
||||
static const char *descrip =
|
||||
"ControlPlayback(filename[|skipms[|ffchar[|rewchar[|stopchar[|pausechar[|restartchar]]]]]]):\n"
|
||||
" Plays back a given filename (do not put extension). Options may also\n"
|
||||
" be included following a pipe symbol. You can use * and # to rewind and\n"
|
||||
" fast forward the playback specified. If 'stopchar' is added the file will\n"
|
||||
" terminate playback when 'stopchar' is pressed. If 'restartchar' is added, the file\n"
|
||||
" will restart when 'restartchar' is pressed. Returns -1 if the channel\n"
|
||||
" was hung up. if the file does not exist jumps to n+101 if it present.\n\n"
|
||||
" Example: exten => 1234,1,ControlPlayback(file|4000|*|#|1|0|5)\n\n";
|
||||
" ControlPlayback(file[|skipms[|ff[|rew[|stop[|pause[|restart|options]]]]]]]):\n"
|
||||
"This application will play back the given filename. By default, the '*' key\n"
|
||||
"can be used to rewind, and the '#' key can be used to fast-forward.\n"
|
||||
"Parameters:\n"
|
||||
" skipms - This is number of milliseconds to skip when rewinding or\n"
|
||||
" fast-forwarding.\n"
|
||||
" ff - Fast-forward when this DTMF digit is received.\n"
|
||||
" rew - Rewind when this DTMF digit is received.\n"
|
||||
" stop - Stop playback when this DTMF digit is received.\n"
|
||||
" pause - Pause playback when this DTMF digit is received.\n"
|
||||
" restart - Restart playback when this DTMF digit is received.\n"
|
||||
"Options:\n"
|
||||
" j - Jump to priority n+101 if the requested file is not found.\n"
|
||||
"This application sets the following channel variable upon completion:\n"
|
||||
" CPLAYBACKSTATUS - This variable contains the status of the attempt as a text\n"
|
||||
" string, one of: SUCCESS | USERSTOPPED | ERROR\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -65,12 +76,12 @@ static int is_on_phonepad(char key)
|
||||
|
||||
static int controlplayback_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
int res = 0;
|
||||
int res = 0, priority_jump = 0;
|
||||
int skipms = 0;
|
||||
struct localuser *u;
|
||||
char *tmp;
|
||||
int argc;
|
||||
char *argv[7];
|
||||
char *argv[8];
|
||||
enum arg_ids {
|
||||
arg_file = 0,
|
||||
arg_skip = 1,
|
||||
@@ -79,6 +90,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data)
|
||||
arg_stop = 4,
|
||||
arg_pause = 5,
|
||||
arg_restart = 6,
|
||||
options = 7,
|
||||
};
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
@@ -91,7 +103,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data)
|
||||
tmp = ast_strdupa(data);
|
||||
memset(argv, 0, sizeof(argv));
|
||||
|
||||
argc = ast_separate_app_args(tmp, '|', argv, sizeof(argv) / sizeof(argv[0]));
|
||||
argc = ast_app_separate_args(tmp, '|', argv, sizeof(argv) / sizeof(argv[0]));
|
||||
|
||||
if (argc < 1) {
|
||||
ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n");
|
||||
@@ -114,15 +126,28 @@ static int controlplayback_exec(struct ast_channel *chan, void *data)
|
||||
if (argv[arg_restart] && !is_on_phonepad(*argv[arg_restart]))
|
||||
argv[arg_restart] = NULL;
|
||||
|
||||
if (argv[options]) {
|
||||
if (strchr(argv[options], 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
res = ast_control_streamfile(chan, argv[arg_file], argv[arg_fwd], argv[arg_rev], argv[arg_stop], argv[arg_pause], argv[arg_restart], skipms);
|
||||
|
||||
/* If we stopped on one of our stop keys, return 0 */
|
||||
if (argv[arg_stop] && strchr(argv[arg_stop], res))
|
||||
if (argv[arg_stop] && strchr(argv[arg_stop], res)) {
|
||||
res = 0;
|
||||
|
||||
if (res < 0) {
|
||||
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
|
||||
pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "USERSTOPPED");
|
||||
} else {
|
||||
if (res < 0) {
|
||||
if (priority_jump || option_priority_jumping) {
|
||||
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");
|
||||
}
|
||||
}
|
||||
res = 0;
|
||||
pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "ERROR");
|
||||
} else
|
||||
pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "SUCCESS");
|
||||
}
|
||||
|
||||
LOCAL_USER_REMOVE(u);
|
||||
|
14
apps/app_curl.c
Executable file → Normal file
14
apps/app_curl.c
Executable file → Normal file
@@ -20,8 +20,10 @@
|
||||
/*! \file
|
||||
* \brief Curl - App to load a URL
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <curl/curl.h>
|
||||
@@ -46,10 +48,14 @@ static char *app = "Curl";
|
||||
static char *synopsis = "Load an external URL";
|
||||
|
||||
static char *descrip =
|
||||
" Curl(URL[|postdata]): Requests the URL. Mainly used for signalling\n"
|
||||
"external applications of an event. Returns 0 or -1 on fatal error.\n"
|
||||
"Argument specified treated as POST data. Also sets CURL variable with the\n"
|
||||
"resulting page.\n";
|
||||
" Curl(URL[|postdata]): This application will request the specified URL.\n"
|
||||
"It is mainly used for signalling external applications of an event.\n"
|
||||
"Parameters:\n"
|
||||
" URL - This is the external URL to request.\n"
|
||||
" postdata - This information will be treated as POST data.\n"
|
||||
"This application will set the following variable:\n"
|
||||
" CURL - This variable will contain the resulting page.\n"
|
||||
"This application has been deprecated in favor of the CURL function.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
51
apps/app_cut.c
Executable file → Normal file
51
apps/app_cut.c
Executable file → Normal file
@@ -18,6 +18,7 @@
|
||||
/*! \file
|
||||
* \brief Cut application
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -35,34 +36,37 @@ 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 */
|
||||
#define MAXRESULT 1024
|
||||
|
||||
static char *tdesc = "String manipulation";
|
||||
static char *tdesc = "Cut out information from a string";
|
||||
|
||||
static char *app_cut = "Cut";
|
||||
|
||||
static char *cut_synopsis = "Splits a variable's content using the specified delimiter";
|
||||
static char *cut_synopsis = "Splits a variable's contents using the specified delimiter";
|
||||
|
||||
static char *cut_descrip =
|
||||
"Usage: Cut(newvar=varname,delimiter,fieldspec)\n"
|
||||
" Cut(newvar=varname,delimiter,fieldspec): This applicaiton 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"
|
||||
" newvar - new variable created from result string\n"
|
||||
" varname - variable you want cut\n"
|
||||
" delimiter - defaults to '-'\n"
|
||||
" fieldspec - number of the field you want (1-based offset)\n"
|
||||
" may also be specified as a range (with -)\n"
|
||||
" or group of ranges and fields (with &)\n"
|
||||
" Returns 0 or -1 on hangup or error.\n";
|
||||
" may also be specified as a range (with -)\n"
|
||||
" or group of ranges and fields (with &)\n"
|
||||
"This application has been deprecated in favor of the CUT function.\n";
|
||||
|
||||
static char *app_sort = "Sort";
|
||||
static char *app_sort_synopsis = "Sorts a list of keywords and values";
|
||||
static char *app_sort_descrip =
|
||||
" Sort(<newvar>=<key1>:<val1>[,<key2>:<val2>[[...],<keyN>:<valN>]])\n"
|
||||
"Sorts the list provided by using the value as a float to order the list of\n"
|
||||
"keywords in ascending order. Sets the variable provided to the list of\n"
|
||||
"sorted keywords. Always returns 0.\n";
|
||||
" 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";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -141,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;
|
||||
@@ -150,7 +155,7 @@ static int sort_internal(struct ast_channel *chan, char *data, char *buffer, siz
|
||||
|
||||
static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size_t buflen)
|
||||
{
|
||||
char *s, *varname=NULL, *delimiter=NULL, *field=NULL;
|
||||
char *s, *args[3], *varname=NULL, *delimiter=NULL, *field=NULL;
|
||||
int args_okay = 0;
|
||||
|
||||
memset(buffer, 0, buflen);
|
||||
@@ -159,15 +164,13 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size
|
||||
if (data) {
|
||||
s = ast_strdupa((char *)data);
|
||||
if (s) {
|
||||
varname = strsep(&s, "|");
|
||||
if (varname && (varname[0] != '\0')) {
|
||||
delimiter = strsep(&s, "|");
|
||||
if (delimiter) {
|
||||
field = strsep(&s, "|");
|
||||
if (field) {
|
||||
args_okay = 1;
|
||||
}
|
||||
}
|
||||
ast_app_separate_args(s, '|', args, 3);
|
||||
varname = args[0];
|
||||
delimiter = args[1];
|
||||
field = args[2];
|
||||
|
||||
if (field) {
|
||||
args_okay = 1;
|
||||
}
|
||||
} else {
|
||||
return ERROR_NOMEM;
|
||||
@@ -250,6 +253,8 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return ERROR_NOARG;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -383,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");
|
||||
|
5
apps/app_datetime.c
Executable file → Normal file
5
apps/app_datetime.c
Executable file → Normal file
@@ -19,8 +19,10 @@
|
||||
/*! \file
|
||||
* \brief Time of day - Report the time of day
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@@ -44,8 +46,7 @@ static char *app = "DateTime";
|
||||
static char *synopsis = "Say the date and time";
|
||||
|
||||
static char *descrip =
|
||||
" DateTime(): Says the current date and time. Returns -1 on hangup or 0\n"
|
||||
"otherwise.\n";
|
||||
" DateTime(): This application will say the current date and time.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
55
apps/app_db.c
Executable file → Normal file
55
apps/app_db.c
Executable file → Normal file
@@ -22,11 +22,13 @@
|
||||
*
|
||||
* \brief Database access functions
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -41,25 +43,32 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/astdb.h"
|
||||
#include "asterisk/lock.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
static char *tdesc = "Database access functions for Asterisk extension logic";
|
||||
static char *tdesc = "Database Access Functions";
|
||||
|
||||
static char *g_descrip =
|
||||
" DBget(varname=family/key): Retrieves a value from the Asterisk\n"
|
||||
"database and stores it in the given variable. Always returns 0. If the\n"
|
||||
"requested key is not found, jumps to priority n+101 if available.\n";
|
||||
" DBget(varname=family/key[|options]): This application will retrieve a value\n"
|
||||
"from the Asterisk database and store it in the given variable.\n"
|
||||
" Options:\n"
|
||||
" j - Jump to priority n+101 if the requested family/key isn't found.\n"
|
||||
" This application sets the following channel variable upon completion:\n"
|
||||
" DBGETSTATUS - This variable will contain the status of the attempt\n"
|
||||
" FOUND | NOTFOUND \n"
|
||||
" This application has been deprecated in favor of the DB function.\n";
|
||||
|
||||
static char *p_descrip =
|
||||
" DBput(family/key=value): Stores the given value in the Asterisk\n"
|
||||
"database. Always returns 0.\n";
|
||||
" DBput(family/key=value): This application will store the given value in the\n"
|
||||
"specified location in the Asterisk database.\n"
|
||||
" This application has been deprecated in favor of the DB function.\n";
|
||||
|
||||
static char *d_descrip =
|
||||
" DBdel(family/key): Deletes a key from the Asterisk database. Always\n"
|
||||
"returns 0.\n";
|
||||
" DBdel(family/key): This applicaiton will delete a key from the Asterisk\n"
|
||||
"database.\n";
|
||||
|
||||
static char *dt_descrip =
|
||||
" DBdeltree(family[/keytree]): Deletes a family or keytree from the Asterisk\n"
|
||||
"database. Always returns 0.\n";
|
||||
" DBdeltree(family[/keytree]): This application will delete a family or keytree\n"
|
||||
"from the Asterisk database\n";
|
||||
|
||||
static char *g_app = "DBget";
|
||||
static char *p_app = "DBput";
|
||||
@@ -205,9 +214,10 @@ static int put_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
static int get_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
char *argv, *varname, *family, *key;
|
||||
char *argv, *varname, *family, *key, *options = NULL;
|
||||
char dbresult[256];
|
||||
static int dep_warning = 0;
|
||||
int priority_jump = 0;
|
||||
struct localuser *u;
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
@@ -227,23 +237,38 @@ static int get_exec(struct ast_channel *chan, void *data)
|
||||
if (strchr(argv, '=') && strchr(argv, '/')) {
|
||||
varname = strsep(&argv, "=");
|
||||
family = strsep(&argv, "/");
|
||||
key = strsep(&argv, "\0");
|
||||
if (strchr((void *)&argv, '|')) {
|
||||
key = strsep(&argv, "|");
|
||||
options = strsep(&argv, "\0");
|
||||
} else
|
||||
key = strsep(&argv, "\0");
|
||||
|
||||
if (!varname || !family || !key) {
|
||||
ast_log(LOG_DEBUG, "Ignoring; Syntax error in argument\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (options) {
|
||||
if (strchr(options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "DBget: varname=%s, family=%s, key=%s\n", varname, family, key);
|
||||
if (!ast_db_get(family, key, dbresult, sizeof (dbresult) - 1)) {
|
||||
pbx_builtin_setvar_helper(chan, varname, dbresult);
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "DBget: set variable %s to %s\n", varname, dbresult);
|
||||
pbx_builtin_setvar_helper(chan, "DBGETSTATUS", "FOUND");
|
||||
} else {
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "DBget: Value not found in database.\n");
|
||||
/* Send the call to n+101 priority, where n is the current priority */
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
if (priority_jump || option_priority_jumping) {
|
||||
/* Send the call to n+101 priority, where n is the current priority */
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
}
|
||||
pbx_builtin_setvar_helper(chan, "DBGETSTATUS", "NOTFOUND");
|
||||
}
|
||||
} else {
|
||||
ast_log(LOG_DEBUG, "Ignoring, no parameters\n");
|
||||
|
955
apps/app_dial.c
Executable file → Normal file
955
apps/app_dial.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
6
apps/app_dictate.c
Executable file → Normal file
6
apps/app_dictate.c
Executable file → Normal file
@@ -22,11 +22,13 @@
|
||||
*
|
||||
* \brief Virtual Dictation Machine Application For Asterisk
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h> /* for mkdir */
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -102,7 +104,7 @@ static int dictate_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR);
|
||||
if (!ast_strlen_zero(data) && (mydata = ast_strdupa(data))) {
|
||||
argc = ast_separate_app_args(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]));
|
||||
argc = ast_app_separate_args(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]));
|
||||
}
|
||||
|
||||
if (argc) {
|
||||
|
17
apps/app_directed_pickup.c
Executable file → Normal file
17
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
|
||||
@@ -20,11 +20,13 @@
|
||||
*
|
||||
* \brief Directed Call Pickup Support
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -40,10 +42,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
||||
static const char *tdesc = "Directed Call Pickup Application";
|
||||
static const char *app = "Pickup";
|
||||
static const char *synopsis = "Directed Call Pickup application.";
|
||||
static const char *synopsis = "Directed Call Pickup";
|
||||
static const char *descrip =
|
||||
" Pickup(extension@context):\n"
|
||||
"Steals any calls to a specified extension that are in a ringing state and bridges them to the current channel. Context is an optional argument.\n";
|
||||
" Pickup(extension[@context]): This application can pickup any ringing channel\n"
|
||||
"that is calling the specified extension. If no context is specified, the current\n"
|
||||
"context will be used.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -74,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) {
|
||||
@@ -86,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");
|
||||
}
|
||||
|
||||
|
30
apps/app_directory.c
Executable file → Normal file
30
apps/app_directory.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief Provide a directory of extensions
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -46,18 +47,23 @@ static char *app = "Directory";
|
||||
|
||||
static char *synopsis = "Provide directory of voicemail extensions";
|
||||
static char *descrip =
|
||||
" Directory(vm-context[|dial-context[|options]]): Presents the user with a directory\n"
|
||||
"of extensions from which they may select by name. The list of names \n"
|
||||
"and extensions is discovered from voicemail.conf. The vm-context argument\n"
|
||||
"is required, and specifies the context of voicemail.conf to use. The\n"
|
||||
"dial-context is the context to use for dialing the users, and defaults to\n"
|
||||
"the vm-context if unspecified. The 'f' option causes the directory to match\n"
|
||||
"based on the first name in voicemail.conf instead of the last name.\n"
|
||||
"Returns 0 unless the user hangs up. It also sets up the channel on exit\n"
|
||||
"to enter the extension the user selected. If the user enters '0' and there\n"
|
||||
"exists an extension 'o' in the current context, the directory will exit with 0\n"
|
||||
"and call control will resume at that extension. Entering '*' will exit similarly,\n"
|
||||
"but to the 'a' extension, much like app_voicemail's behavior.\n";
|
||||
" Directory(vm-context[|dial-context[|options]]): This application will present\n"
|
||||
"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"
|
||||
"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"
|
||||
" Parameters:\n"
|
||||
" vm-context - This is the context within voicemail.conf to use for the\n"
|
||||
" Directory.\n"
|
||||
" dial-context - This is the dialplan context to use when looking for an\n"
|
||||
" extension that the user has selected, or when jumping to the\n"
|
||||
" 'o' or 'a' extension.\n\n"
|
||||
" Options:\n"
|
||||
" f - Allow the caller to enter the first name of a user in the directory\n"
|
||||
" instead of using the last name.\n";
|
||||
|
||||
/* For simplicity, I'm keeping the format compatible with the voicemail config,
|
||||
but i'm open to suggestions for isolating it */
|
||||
|
119
apps/app_disa.c
Executable file → Normal file
119
apps/app_disa.c
Executable file → Normal file
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* Copyright (C) 1999 - 2005, Digium, Inc.
|
||||
*
|
||||
* Jim Dixon <jim@lambdatel.com>
|
||||
*
|
||||
* Made only slightly more sane by Mark Spencer <markster@digium.com>
|
||||
*
|
||||
@@ -21,7 +20,10 @@
|
||||
/*! \file
|
||||
*
|
||||
* \brief DISA -- Direct Inward System Access Application
|
||||
*
|
||||
* \author Jim Dixon <jim@lambdatel.com>
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -93,7 +95,6 @@ static char *descrip =
|
||||
"If the user enters an invalid extension and extension \"i\" (invalid) \n"
|
||||
"exists in the context, it will be used.\n";
|
||||
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
LOCAL_USER_DECL;
|
||||
@@ -117,14 +118,20 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
int firstdigittimeout = 20000;
|
||||
int digittimeout = 10000;
|
||||
struct localuser *u;
|
||||
char *tmp, arg2[256]="",exten[AST_MAX_EXTENSION],acctcode[20]="";
|
||||
char *ourcontext,*ourcallerid,ourcidname[256],ourcidnum[256],*mailbox;
|
||||
char *tmp, exten[AST_MAX_EXTENSION],acctcode[20]="";
|
||||
char pwline[256];
|
||||
char ourcidname[256],ourcidnum[256];
|
||||
struct ast_frame *f;
|
||||
struct timeval lastdigittime;
|
||||
int res;
|
||||
time_t rstart;
|
||||
FILE *fp;
|
||||
char *stringp=NULL;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(passcode);
|
||||
AST_APP_ARG(context);
|
||||
AST_APP_ARG(cid);
|
||||
AST_APP_ARG(mailbox);
|
||||
);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "disa requires an argument (passcode/passcode file)\n");
|
||||
@@ -159,24 +166,14 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
stringp=tmp;
|
||||
strsep(&stringp, "|");
|
||||
ourcontext = strsep(&stringp, "|");
|
||||
/* if context specified, save 2nd arg and parse third */
|
||||
if (ourcontext) {
|
||||
ast_copy_string(arg2, ourcontext, sizeof(arg2));
|
||||
ourcallerid = strsep(&stringp,"|");
|
||||
}
|
||||
/* if context not specified, use "disa" */
|
||||
else {
|
||||
arg2[0] = 0;
|
||||
ourcallerid = NULL;
|
||||
ourcontext = "disa";
|
||||
}
|
||||
mailbox = strsep(&stringp, "|");
|
||||
if (!mailbox)
|
||||
mailbox = "";
|
||||
ast_log(LOG_DEBUG, "Mailbox: %s\n",mailbox);
|
||||
AST_STANDARD_APP_ARGS(args, tmp);
|
||||
|
||||
if (ast_strlen_zero(args.context))
|
||||
args.context = "disa";
|
||||
if (ast_strlen_zero(args.mailbox))
|
||||
args.mailbox = "";
|
||||
|
||||
ast_log(LOG_DEBUG, "Mailbox: %s\n",args.mailbox);
|
||||
|
||||
if (chan->_state != AST_STATE_UP) {
|
||||
/* answer */
|
||||
@@ -188,15 +185,15 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
acctcode[0] = 0;
|
||||
/* can we access DISA without password? */
|
||||
|
||||
ast_log(LOG_DEBUG, "Context: %s\n",ourcontext);
|
||||
ast_log(LOG_DEBUG, "Context: %s\n",args.context);
|
||||
|
||||
if (!strcasecmp(tmp, "no-password")) {
|
||||
if (!strcasecmp(args.passcode, "no-password")) {
|
||||
k |= 1; /* We have the password */
|
||||
ast_log(LOG_DEBUG, "DISA no-password login success\n");
|
||||
}
|
||||
lastdigittime = ast_tvnow();
|
||||
|
||||
play_dialtone(chan, mailbox);
|
||||
play_dialtone(chan, args.mailbox);
|
||||
|
||||
for (;;) {
|
||||
/* if outa time, give em reorder */
|
||||
@@ -252,48 +249,45 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
if (j == '#') /* end of password */
|
||||
{
|
||||
/* see if this is an integer */
|
||||
if (sscanf(tmp,"%d",&j) < 1)
|
||||
if (sscanf(args.passcode,"%d",&j) < 1)
|
||||
{ /* nope, it must be a filename */
|
||||
fp = fopen(tmp,"r");
|
||||
fp = fopen(args.passcode,"r");
|
||||
if (!fp)
|
||||
{
|
||||
ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",tmp,chan->name);
|
||||
ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,chan->name);
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
tmp[0] = 0;
|
||||
while(fgets(tmp,sizeof(tmp) - 1,fp))
|
||||
pwline[0] = 0;
|
||||
while(fgets(pwline,sizeof(pwline) - 1,fp))
|
||||
{
|
||||
char *stringp=NULL,*stringp2;
|
||||
if (!tmp[0]) continue;
|
||||
if (tmp[strlen(tmp) - 1] == '\n')
|
||||
tmp[strlen(tmp) - 1] = 0;
|
||||
if (!tmp[0]) continue;
|
||||
if (!pwline[0]) continue;
|
||||
if (pwline[strlen(pwline) - 1] == '\n')
|
||||
pwline[strlen(pwline) - 1] = 0;
|
||||
if (!pwline[0]) continue;
|
||||
/* skip comments */
|
||||
if (tmp[0] == '#') continue;
|
||||
if (tmp[0] == ';') continue;
|
||||
stringp=tmp;
|
||||
strsep(&stringp, "|");
|
||||
stringp2=strsep(&stringp, "|");
|
||||
if (stringp2) {
|
||||
ourcontext=stringp2;
|
||||
stringp2=strsep(&stringp, "|");
|
||||
if (stringp2) ourcallerid=stringp2;
|
||||
}
|
||||
mailbox = strsep(&stringp, "|");
|
||||
if (!mailbox)
|
||||
mailbox = "";
|
||||
ast_log(LOG_DEBUG, "Mailbox: %s\n",mailbox);
|
||||
if (pwline[0] == '#') continue;
|
||||
if (pwline[0] == ';') continue;
|
||||
|
||||
AST_STANDARD_APP_ARGS(args, pwline);
|
||||
|
||||
ast_log(LOG_DEBUG, "Mailbox: %s\n",args.mailbox);
|
||||
|
||||
/* password must be in valid format (numeric) */
|
||||
if (sscanf(tmp,"%d",&j) < 1) continue;
|
||||
if (sscanf(args.passcode,"%d",&j) < 1) continue;
|
||||
/* if we got it */
|
||||
if (!strcmp(exten,tmp)) break;
|
||||
if (!strcmp(exten,args.passcode)) {
|
||||
if (ast_strlen_zero(args.context))
|
||||
args.context = "disa";
|
||||
if (ast_strlen_zero(args.mailbox))
|
||||
args.mailbox = "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
/* compare the two */
|
||||
if (strcmp(exten,tmp))
|
||||
if (strcmp(exten,args.passcode))
|
||||
{
|
||||
ast_log(LOG_WARNING,"DISA on chan %s got bad password %s\n",chan->name,exten);
|
||||
goto reorder;
|
||||
@@ -301,7 +295,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
}
|
||||
/* password good, set to dial state */
|
||||
ast_log(LOG_DEBUG,"DISA on chan %s password is good\n",chan->name);
|
||||
play_dialtone(chan, mailbox);
|
||||
play_dialtone(chan, args.mailbox);
|
||||
|
||||
k|=1; /* In number mode */
|
||||
i = 0; /* re-set buffer pointer */
|
||||
@@ -318,7 +312,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
if (!(k&1)) continue; /* if getting password, continue doing it */
|
||||
/* if this exists */
|
||||
|
||||
if (ast_ignore_pattern(ourcontext, exten)) {
|
||||
if (ast_ignore_pattern(args.context, exten)) {
|
||||
play_dialtone(chan, "");
|
||||
did_ignore = 1;
|
||||
} else
|
||||
@@ -328,7 +322,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
}
|
||||
|
||||
/* if can do some more, do it */
|
||||
if (!ast_matchmore_extension(chan,ourcontext,exten,1, chan->cid.cid_num)) {
|
||||
if (!ast_matchmore_extension(chan,args.context,exten,1, chan->cid.cid_num)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -336,27 +330,28 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
if (k == 3) {
|
||||
int recheck = 0;
|
||||
struct ast_flags flags = { AST_CDR_FLAG_POSTED };
|
||||
|
||||
if (!ast_exists_extension(chan, ourcontext, exten, 1, chan->cid.cid_num)) {
|
||||
if (!ast_exists_extension(chan, args.context, exten, 1, chan->cid.cid_num)) {
|
||||
pbx_builtin_setvar_helper(chan, "INVALID_EXTEN", exten);
|
||||
exten[0] = 'i';
|
||||
exten[1] = '\0';
|
||||
recheck = 1;
|
||||
}
|
||||
if (!recheck || ast_exists_extension(chan, ourcontext, exten, 1, chan->cid.cid_num)) {
|
||||
if (!recheck || ast_exists_extension(chan, args.context, exten, 1, chan->cid.cid_num)) {
|
||||
ast_playtones_stop(chan);
|
||||
/* We're authenticated and have a target extension */
|
||||
if (ourcallerid && *ourcallerid)
|
||||
if (!ast_strlen_zero(args.cid))
|
||||
{
|
||||
ast_callerid_split(ourcallerid, ourcidname, sizeof(ourcidname), ourcidnum, sizeof(ourcidnum));
|
||||
ast_callerid_split(args.cid, ourcidname, sizeof(ourcidname), ourcidnum, sizeof(ourcidnum));
|
||||
ast_set_callerid(chan, ourcidnum, ourcidname, ourcidnum);
|
||||
}
|
||||
|
||||
if (!ast_strlen_zero(acctcode))
|
||||
ast_copy_string(chan->accountcode, acctcode, sizeof(chan->accountcode));
|
||||
|
||||
ast_cdr_reset(chan->cdr, AST_CDR_FLAG_POSTED);
|
||||
ast_explicit_goto(chan, ourcontext, exten, 1);
|
||||
ast_cdr_reset(chan->cdr, &flags);
|
||||
ast_explicit_goto(chan, args.context, exten, 1);
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return 0;
|
||||
}
|
||||
|
6
apps/app_dumpchan.c
Executable file → Normal file
6
apps/app_dumpchan.c
Executable file → Normal file
@@ -22,11 +22,13 @@
|
||||
*
|
||||
* \brief Application to dump channel variables
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -50,7 +52,7 @@ static char *desc =
|
||||
"Displays information on channel and listing of all channel\n"
|
||||
"variables. If min_verbose_level is specified, output is only\n"
|
||||
"displayed when the verbose level is currently set to that number\n"
|
||||
"or greater. Always returns 0.\n\n";
|
||||
"or greater. \n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
7
apps/app_echo.c
Executable file → Normal file
7
apps/app_echo.c
Executable file → Normal file
@@ -20,9 +20,11 @@
|
||||
*
|
||||
* \brief Echo application -- play back what you hear to evaluate latency
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -44,8 +46,9 @@ static char *app = "Echo";
|
||||
static char *synopsis = "Echo audio read back to the user";
|
||||
|
||||
static char *descrip =
|
||||
" Echo(): Echo audio read from channel back to the channel. Returns 0\n"
|
||||
"if the user exits with the '#' key, or -1 if the user hangs up.\n";
|
||||
" Echo(): Echo audio read from channel back to the channel. \n"
|
||||
"User can exit the application by either pressing the '#' key, \n"
|
||||
"or hanging up.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
58
apps/app_enumlookup.c
Executable file → Normal file
58
apps/app_enumlookup.c
Executable file → Normal file
@@ -20,12 +20,13 @@
|
||||
*
|
||||
* \brief Enumlookup - lookup entry in ENUM
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -42,6 +43,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/enum.h"
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/app.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
static char *tdesc = "ENUM Lookup";
|
||||
|
||||
@@ -50,20 +53,17 @@ static char *app = "EnumLookup";
|
||||
static char *synopsis = "Lookup number in ENUM";
|
||||
|
||||
static char *descrip =
|
||||
" EnumLookup(exten): Looks up an extension via ENUM and sets\n"
|
||||
" EnumLookup(exten[|option]): Looks up an extension via ENUM and sets\n"
|
||||
"the variable 'ENUM'. For VoIP URIs this variable will \n"
|
||||
"look like 'TECHNOLOGY/URI' with the appropriate technology.\n"
|
||||
"Returns -1 on hangup, or 0 on completion\n"
|
||||
"Currently, the enumservices SIP, H323, IAX, IAX2 and TEL are recognized. \n"
|
||||
"\nReturns status in the ENUMSTATUS channel variable:\n"
|
||||
" ERROR Failed to do a lookup\n"
|
||||
" <tech> Technology of the successful lookup: SIP, H323, IAX, IAX2 or TEL\n"
|
||||
" BADURI Got URI Asterisk does not understand.\n"
|
||||
"\nOld, depreciated, behaviour:\n"
|
||||
"\nA SIP, H323, IAX or IAX2 entry will result in normal priority handling, \n"
|
||||
"whereas a TEL entry will increase the priority by 51 (if existing).\n"
|
||||
"If the lookup was *not* successful and there exists a priority n + 101,\n"
|
||||
"then that priority will be taken next.\n" ;
|
||||
" The option string may contain zero or the following character:\n"
|
||||
" 'j' -- jump to +101 priority if the lookup isn't successful.\n"
|
||||
" and jump to +51 priority on a TEL entry.\n";
|
||||
|
||||
#define ENUM_CONFIG "enum.conf"
|
||||
|
||||
@@ -77,13 +77,18 @@ LOCAL_USER_DECL;
|
||||
/*--- enumlookup_exec: Look up number in ENUM and return result */
|
||||
static int enumlookup_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
int res=0;
|
||||
int res=0,priority_jump=0;
|
||||
char tech[80];
|
||||
char dest[80];
|
||||
char tmp[256];
|
||||
char *c,*t;
|
||||
char *c,*t = NULL;
|
||||
static int dep_warning=0;
|
||||
struct localuser *u;
|
||||
char *parse;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(d);
|
||||
AST_APP_ARG(o);
|
||||
);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "EnumLookup requires an argument (extension)\n");
|
||||
@@ -97,13 +102,30 @@ static int enumlookup_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
tech[0] = '\0';
|
||||
parse = ast_strdupa(data);
|
||||
if (!parse) {
|
||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
res = ast_get_enum(chan, data, dest, sizeof(dest), tech, sizeof(tech), NULL, NULL);
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
tech[0] = '\0';
|
||||
dest[0] = '\0';
|
||||
|
||||
if (args.o) {
|
||||
if (strchr(args.o, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
res = ast_get_enum(chan, args.d, dest, sizeof(dest), tech, sizeof(tech), NULL, NULL);
|
||||
|
||||
if (!res) { /* Failed to do a lookup */
|
||||
/* Look for a "busy" place */
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
if (priority_jump || option_priority_jumping) {
|
||||
/* Look for a "busy" place */
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
}
|
||||
pbx_builtin_setvar_helper(chan, "ENUMSTATUS", "ERROR");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return 0;
|
||||
@@ -158,8 +180,10 @@ static int enumlookup_exec(struct ast_channel *chan, void *data)
|
||||
*t = 0;
|
||||
pbx_builtin_setvar_helper(chan, "ENUM", tmp);
|
||||
ast_log(LOG_NOTICE, "tel: ENUM set to \"%s\"\n", tmp);
|
||||
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 51))
|
||||
res = 0;
|
||||
if (priority_jump || option_priority_jumping) {
|
||||
if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 51))
|
||||
res = 0;
|
||||
}
|
||||
}
|
||||
} else if (!ast_strlen_zero(tech)) {
|
||||
ast_log(LOG_NOTICE, "Don't know how to handle technology '%s'\n", tech);
|
||||
|
2
apps/app_eval.c
Executable file → Normal file
2
apps/app_eval.c
Executable file → Normal file
@@ -19,6 +19,8 @@
|
||||
* \brief Eval application
|
||||
*
|
||||
* \author Tilghman Lesher <app_eval__v001@the-tilghman.com>
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
2
apps/app_exec.c
Executable file → Normal file
2
apps/app_exec.c
Executable file → Normal file
@@ -20,6 +20,8 @@
|
||||
* \brief Exec application
|
||||
*
|
||||
* \author Tilghman Lesher <app_exec__v001@the-tilghman.com>
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
42
apps/app_externalivr.c
Executable file → Normal file
42
apps/app_externalivr.c
Executable file → Normal file
@@ -23,12 +23,13 @@
|
||||
*
|
||||
* \brief External IVR application interface
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -42,6 +43,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";
|
||||
|
||||
@@ -59,7 +62,8 @@ static const char *descrip =
|
||||
"when the channel is hung up.\n"
|
||||
"See doc/README.externalivr for a protocol specification.\n";
|
||||
|
||||
#define ast_chan_log(level, channel, format, ...) ast_log(level, "%s: " format, channel->name, ## __VA_ARGS__)
|
||||
/* XXX the parser in gcc 2.95 gets confused if you don't put a space between 'name' and the comma */
|
||||
#define ast_chan_log(level, channel, format, ...) ast_log(level, "%s: " format, channel->name , ## __VA_ARGS__)
|
||||
|
||||
struct playlist_entry {
|
||||
AST_LIST_ENTRY(playlist_entry) list;
|
||||
@@ -91,9 +95,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);
|
||||
@@ -248,10 +252,9 @@ 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;
|
||||
@@ -268,11 +271,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));
|
||||
@@ -309,13 +314,16 @@ static int app_exec(struct ast_channel *chan, void *data)
|
||||
/* child process */
|
||||
int i;
|
||||
|
||||
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));
|
||||
execv(argv[0], argv);
|
||||
fprintf(stderr, "Failed to execute '%s': %s\n", argv[0], strerror(errno));
|
||||
exit(1);
|
||||
} else {
|
||||
/* parent process */
|
||||
@@ -341,8 +349,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;
|
||||
@@ -353,6 +359,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) {
|
||||
|
22
apps/app_festival.c
Executable file → Normal file
22
apps/app_festival.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief Connect to festival
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -52,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"
|
||||
|
||||
@@ -135,6 +137,9 @@ static int send_waveform_to_fd(char *waveform, int length, int fd) {
|
||||
if (x != fd)
|
||||
close(x);
|
||||
}
|
||||
if (option_highpriority)
|
||||
ast_set_priority(0);
|
||||
|
||||
/*IAS */
|
||||
#ifdef __PPC__
|
||||
for( x=0; x<length; x+=2)
|
||||
@@ -174,7 +179,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) {
|
||||
@@ -454,8 +460,20 @@ 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");
|
||||
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");
|
||||
|
7
apps/app_flash.c
Executable file → Normal file
7
apps/app_flash.c
Executable file → Normal file
@@ -20,11 +20,13 @@
|
||||
*
|
||||
* \brief App to flash a zap trunk
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/ioctl.h>
|
||||
#ifdef __linux__
|
||||
#include <linux/zaptel.h>
|
||||
@@ -55,8 +57,7 @@ static char *synopsis = "Flashes a Zap Trunk";
|
||||
static char *descrip =
|
||||
" Flash(): Sends a flash on a zap trunk. This is only a hack for\n"
|
||||
"people who want to perform transfers and such via AGI and is generally\n"
|
||||
"quite useless otherwise. Returns 0 on success or -1 if this is not\n"
|
||||
"a zap trunk\n";
|
||||
"quite useless oths application will only work on Zap trunks.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
28
apps/app_forkcdr.c
Executable file → Normal file
28
apps/app_forkcdr.c
Executable file → Normal file
@@ -19,12 +19,13 @@
|
||||
*
|
||||
* \brief Fork CDR application
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -56,26 +57,39 @@ static void ast_cdr_fork(struct ast_channel *chan)
|
||||
{
|
||||
struct ast_cdr *cdr;
|
||||
struct ast_cdr *newcdr;
|
||||
if (!chan || !(cdr = chan->cdr))
|
||||
return;
|
||||
struct ast_flags flags = { AST_CDR_FLAG_KEEP_VARS };
|
||||
|
||||
cdr = chan->cdr;
|
||||
|
||||
while (cdr->next)
|
||||
cdr = cdr->next;
|
||||
|
||||
if (!(newcdr = ast_cdr_dup(cdr)))
|
||||
return;
|
||||
|
||||
ast_cdr_append(cdr, newcdr);
|
||||
ast_cdr_reset(newcdr, AST_CDR_FLAG_KEEP_VARS);
|
||||
ast_cdr_reset(newcdr, &flags);
|
||||
|
||||
if (!ast_test_flag(cdr, AST_CDR_FLAG_KEEP_VARS))
|
||||
ast_cdr_free_vars(cdr, 0);
|
||||
|
||||
ast_set_flag(cdr, AST_CDR_FLAG_CHILD | AST_CDR_FLAG_LOCKED);
|
||||
}
|
||||
|
||||
static int forkcdr_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
int res=0;
|
||||
int res = 0;
|
||||
struct localuser *u;
|
||||
|
||||
if (!chan->cdr) {
|
||||
ast_log(LOG_WARNING, "Channel does not have a CDR\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
if (!ast_strlen_zero(data))
|
||||
ast_set2_flag(chan->cdr, strchr((char *)data, 'v'), AST_CDR_FLAG_KEEP_VARS);
|
||||
ast_set2_flag(chan->cdr, strchr(data, 'v'), AST_CDR_FLAG_KEEP_VARS);
|
||||
|
||||
ast_cdr_fork(chan);
|
||||
|
||||
|
7
apps/app_getcpeid.c
Executable file → Normal file
7
apps/app_getcpeid.c
Executable file → Normal file
@@ -18,11 +18,13 @@
|
||||
|
||||
/*! \file
|
||||
*
|
||||
* \brief Execute arbitrary system commands
|
||||
* \brief Get ADSI CPE ID
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -47,8 +49,7 @@ static char *synopsis = "Get ADSI CPE ID";
|
||||
|
||||
static char *descrip =
|
||||
" GetCPEID: Obtains and displays ADSI CPE ID and other information in order\n"
|
||||
"to properly setup zapata.conf for on-hook operations.\n"
|
||||
"Returns -1 on hangup only.\n";
|
||||
"to properly setup zapata.conf for on-hook operations.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
64
apps/app_groupcount.c
Executable file → Normal file
64
apps/app_groupcount.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief Group Manipulation Applications
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -139,27 +140,50 @@ static int group_check_exec(struct ast_channel *chan, void *data)
|
||||
char limit[80]="";
|
||||
char category[80]="";
|
||||
static int deprecation_warning = 0;
|
||||
char *parse;
|
||||
int priority_jump = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(max);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
if (!deprecation_warning) {
|
||||
ast_log(LOG_WARNING, "The CheckGroup application has been deprecated, please use a combination of the GotoIf application and the GROUP_COUNT() function.\n");
|
||||
deprecation_warning = 1;
|
||||
}
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "CheckGroup requires an argument(max[@category])\n");
|
||||
if (!(parse = ast_strdupa(data))) {
|
||||
ast_log(LOG_WARNING, "Memory Error!\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
if (args.options) {
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
if (ast_strlen_zero(args.max)) {
|
||||
ast_log(LOG_WARNING, "CheckGroup requires an argument(max[@category][|options])\n");
|
||||
return res;
|
||||
}
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
ast_app_group_split_group(data, limit, sizeof(limit), category, sizeof(category));
|
||||
ast_app_group_split_group(args.max, limit, sizeof(limit), category, sizeof(category));
|
||||
|
||||
if ((sscanf(limit, "%d", &max) == 1) && (max > -1)) {
|
||||
count = ast_app_group_get_count(pbx_builtin_getvar_helper(chan, category), category);
|
||||
if (count > max) {
|
||||
if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
|
||||
res = -1;
|
||||
}
|
||||
pbx_builtin_setvar_helper(chan, "CHECKGROUPSTATUS", "OVERMAX");
|
||||
if (priority_jump || option_priority_jumping) {
|
||||
if (!ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101))
|
||||
res = -1;
|
||||
}
|
||||
} else
|
||||
pbx_builtin_setvar_helper(chan, "CHECKGROUPSTATUS", "OK");
|
||||
} else
|
||||
ast_log(LOG_WARNING, "CheckGroup requires a positive integer argument (max)\n");
|
||||
|
||||
@@ -232,9 +256,9 @@ static char *group_count_descrip =
|
||||
"Usage: GetGroupCount([groupname][@category])\n"
|
||||
" 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. Always returns 0.\n"
|
||||
"This application has been deprecated, please use the function\n"
|
||||
"GroupCount.\n";
|
||||
"Stores result in 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"
|
||||
@@ -242,20 +266,26 @@ static char *group_set_descrip =
|
||||
"Set(GROUP=group). Always returns 0.\n";
|
||||
|
||||
static char *group_check_descrip =
|
||||
"Usage: CheckGroup(max[@category])\n"
|
||||
"Usage: CheckGroup(max[@category][|options])\n"
|
||||
" Checks that the current number of total channels in the\n"
|
||||
"current channel's group does not exceed 'max'. If the number\n"
|
||||
"does not exceed 'max', we continue to the next step. If the\n"
|
||||
"number does in fact exceed max, if priority n+101 exists, then\n"
|
||||
"execution continues at that step, otherwise -1 is returned.\n";
|
||||
"does not exceed 'max', we continue to the next step. \n"
|
||||
" The option string may contain zero of the following character:\n"
|
||||
" 'j' -- jump to n+101 priority if the number does in fact exceed max,\n"
|
||||
" and priority n+101 exists. Execuation then continues at that\n"
|
||||
" step, otherwise -1 is returned.\n"
|
||||
" This application sets the following channel variable upon successful completion:\n"
|
||||
" CHECKGROUPSTATUS The status of the check that the current channel's\n"
|
||||
" group does not exceed 'max'. It's value is one of\n"
|
||||
" OK | OVERMAX \n";
|
||||
|
||||
static char *group_match_count_descrip =
|
||||
"Usage: GetGroupMatchCount(groupmatch[@category])\n"
|
||||
" 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"
|
||||
|
204
apps/app_hasnewvoicemail.c
Executable file → Normal file
204
apps/app_hasnewvoicemail.c
Executable file → Normal file
@@ -24,13 +24,15 @@
|
||||
*
|
||||
* \brief HasVoicemail application
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -43,56 +45,146 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/lock.h"
|
||||
#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";
|
||||
static char *hasvoicemail_synopsis = "Conditionally branches to priority + 101";
|
||||
static char *hasvoicemail_synopsis = "Conditionally branches to priority + 101 with the right options set";
|
||||
static char *hasvoicemail_descrip =
|
||||
"HasVoicemail(vmbox[/folder][@context][|varname])\n"
|
||||
" Branches to priority + 101, if there is voicemail in folder indicated."
|
||||
"HasVoicemail(vmbox[/folder][@context][|varname[|options]])\n"
|
||||
" Optionally sets <varname> to the number of messages in that folder."
|
||||
" Assumes folder of INBOX if not specified.\n";
|
||||
" Assumes folder of INBOX if not specified.\n"
|
||||
" The option string may contain zero or the following character:\n"
|
||||
" 'j' -- jump to priority n+101, if there is voicemail in the folder indicated.\n"
|
||||
" This application sets the following channel variable upon completion:\n"
|
||||
" HASVMSTATUS The result of the voicemail check returned as a text string as follows\n"
|
||||
" <# of messages in the folder, 0 for NONE>\n";
|
||||
|
||||
static char *app_hasnewvoicemail = "HasNewVoicemail";
|
||||
static char *hasnewvoicemail_synopsis = "Conditionally branches to priority + 101";
|
||||
static char *hasnewvoicemail_synopsis = "Conditionally branches to priority + 101 with the right options set";
|
||||
static char *hasnewvoicemail_descrip =
|
||||
"HasNewVoicemail(vmbox[/folder][@context][|varname])\n"
|
||||
" Branches to priority + 101, if there is voicemail in folder 'folder' or INBOX.\n"
|
||||
"if folder is not specified. Optionally sets <varname> to the number of messages\n"
|
||||
"in that folder.\n";
|
||||
"HasNewVoicemail(vmbox[/folder][@context][|varname[|options]])\n"
|
||||
"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 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";
|
||||
|
||||
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)
|
||||
{
|
||||
struct localuser *u;
|
||||
char *temps, *input, *varname = NULL, *vmbox, *context = "default";
|
||||
char *input, *varname = NULL, *vmbox, *context = "default";
|
||||
char *vmfolder;
|
||||
int vmcount = 0;
|
||||
static int dep_warning = 0;
|
||||
int priority_jump = 0;
|
||||
char tmp[12];
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(vmbox);
|
||||
AST_APP_ARG(varname);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
if (!dep_warning) {
|
||||
ast_log(LOG_WARNING, "The applications HasVoicemail and HasNewVoicemail have been deprecated. Please use the VMCOUNT() function instead.\n");
|
||||
@@ -100,7 +192,7 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
ast_log(LOG_WARNING, "HasVoicemail requires an argument (vm-box[/folder][@context]|varname)\n");
|
||||
ast_log(LOG_WARNING, "HasVoicemail requires an argument (vm-box[/folder][@context][|varname[|options]])\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -113,18 +205,13 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
temps = input;
|
||||
if ((temps = strsep(&input, "|"))) {
|
||||
if (!ast_strlen_zero(input))
|
||||
varname = input;
|
||||
input = temps;
|
||||
}
|
||||
AST_STANDARD_APP_ARGS(args, input);
|
||||
|
||||
if ((vmbox = strsep(&input, "@")))
|
||||
if (!ast_strlen_zero(input))
|
||||
context = input;
|
||||
if ((vmbox = strsep(&args.vmbox, "@")))
|
||||
if (!ast_strlen_zero(args.vmbox))
|
||||
context = args.vmbox;
|
||||
if (!vmbox)
|
||||
vmbox = input;
|
||||
vmbox = args.vmbox;
|
||||
|
||||
vmfolder = strchr(vmbox, '/');
|
||||
if (vmfolder) {
|
||||
@@ -134,21 +221,31 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
|
||||
vmfolder = "INBOX";
|
||||
}
|
||||
|
||||
if (args.options) {
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
vmcount = hasvoicemail_internal(context, vmbox, vmfolder);
|
||||
/* Set the count in the channel variable */
|
||||
if (varname) {
|
||||
char tmp[12];
|
||||
snprintf(tmp, sizeof(tmp), "%d", vmcount);
|
||||
pbx_builtin_setvar_helper(chan, varname, tmp);
|
||||
}
|
||||
|
||||
if (vmcount > 0) {
|
||||
/* Branch to the next extension */
|
||||
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);
|
||||
if (priority_jump || option_priority_jumping) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%d", vmcount);
|
||||
pbx_builtin_setvar_helper(chan, "HASVMSTATUS", tmp);
|
||||
|
||||
LOCAL_USER_REMOVE(u);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -199,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;
|
||||
@@ -215,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);
|
||||
|
7
apps/app_ices.c
Executable file → Normal file
7
apps/app_ices.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief Stream to an icecast server via ICES (see contrib/asterisk-ices.xml)
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -43,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"
|
||||
@@ -56,8 +58,7 @@ static char *synopsis = "Encode and stream using 'ices'";
|
||||
static char *descrip =
|
||||
" ICES(config.xml) Streams to an icecast server using ices\n"
|
||||
"(available separately). A configuration file must be supplied\n"
|
||||
"for ices (see examples/asterisk-ices.conf). Returns -1 on\n"
|
||||
"hangup or 0 otherwise.\n";
|
||||
"for ices (see examples/asterisk-ices.conf). \n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -72,6 +73,8 @@ static int icesencode(char *filename, int fd)
|
||||
ast_log(LOG_WARNING, "Fork failed\n");
|
||||
if (res)
|
||||
return res;
|
||||
if (option_highpriority)
|
||||
ast_set_priority(0);
|
||||
dup2(fd, STDIN_FILENO);
|
||||
for (x=STDERR_FILENO + 1;x<256;x++) {
|
||||
if ((x != STDIN_FILENO) && (x != STDOUT_FILENO))
|
||||
|
55
apps/app_image.c
Executable file → Normal file
55
apps/app_image.c
Executable file → Normal file
@@ -20,10 +20,12 @@
|
||||
*
|
||||
* \brief App to transmit an image
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -37,6 +39,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/translate.h"
|
||||
#include "asterisk/image.h"
|
||||
#include "asterisk/app.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
static char *tdesc = "Image Transmission Application";
|
||||
|
||||
@@ -45,12 +49,15 @@ static char *app = "SendImage";
|
||||
static char *synopsis = "Send an image file";
|
||||
|
||||
static char *descrip =
|
||||
" SendImage(filename): Sends an image on a channel. If the channel\n"
|
||||
"does not support image transport, and there exists a step with\n"
|
||||
"priority n + 101, then execution will continue at that step.\n"
|
||||
"Otherwise, execution will continue at the next priority level.\n"
|
||||
"SendImage only returns 0 if the image was sent correctly or if\n"
|
||||
"the channel does not support image transport, and -1 otherwise.\n";
|
||||
" SendImage(filename): Sends an image on a channel. \n"
|
||||
"If the channel supports image transport but the image send\n"
|
||||
"fails, the channel will be hung up. Otherwise, the dialplan\n"
|
||||
"continues execution.\n"
|
||||
"The option string may contain the following character:\n"
|
||||
" 'j' -- jump to priority n+101 if the channel doesn't support image transport\n"
|
||||
"This application sets the following channel variable upon completion:\n"
|
||||
" SENDIMAGESTATUS The status is the result of the attempt as a text string, one of\n"
|
||||
" OK | NOSUPPORT \n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -60,22 +67,46 @@ static int sendimage_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
int res = 0;
|
||||
struct localuser *u;
|
||||
char *parse;
|
||||
int priority_jump = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(filename);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "SendImage requires an argument (filename)\n");
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
if (!(parse = ast_strdupa(data))) {
|
||||
ast_log(LOG_WARNING, "Memory Error!\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
if (ast_strlen_zero(args.filename)) {
|
||||
ast_log(LOG_WARNING, "SendImage requires an argument (filename[|options])\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (args.options) {
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
if (!ast_supports_images(chan)) {
|
||||
/* Does not support transport */
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
if (priority_jump || option_priority_jumping)
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "NOSUPPORT");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
res = ast_send_image(chan, data);
|
||||
res = ast_send_image(chan, args.filename);
|
||||
|
||||
if (!res)
|
||||
pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "OK");
|
||||
|
||||
LOCAL_USER_REMOVE(u);
|
||||
|
||||
|
5
apps/app_intercom.c
Executable file → Normal file
5
apps/app_intercom.c
Executable file → Normal file
@@ -20,8 +20,10 @@
|
||||
*
|
||||
* \brief Use /dev/dsp as an intercom.
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
@@ -67,8 +69,7 @@ static char *app = "Intercom";
|
||||
static char *synopsis = "(Obsolete) Send to Intercom";
|
||||
static char *descrip =
|
||||
" Intercom(): Sends the user to the intercom (i.e. /dev/dsp). This program\n"
|
||||
"is generally considered obselete by the chan_oss module. Returns 0 if the\n"
|
||||
"user exits with a DTMF tone, or -1 if they hangup.\n";
|
||||
"is generally considered obselete by the chan_oss module. User can terminate\n"with a DTMF tone, or by hangup.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
2
apps/app_ivrdemo.c
Executable file → Normal file
2
apps/app_ivrdemo.c
Executable file → Normal file
@@ -20,8 +20,10 @@
|
||||
*
|
||||
* \brief IVR Demo application
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
53
apps/app_lookupblacklist.c
Executable file → Normal file
53
apps/app_lookupblacklist.c
Executable file → Normal file
@@ -19,11 +19,14 @@
|
||||
/*! \file
|
||||
*
|
||||
* \brief App to lookup the callerid number, and see if it is blacklisted
|
||||
*
|
||||
* \ingroup applications
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -40,6 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/image.h"
|
||||
#include "asterisk/callerid.h"
|
||||
#include "asterisk/astdb.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
static char *tdesc = "Look up Caller*ID name/number from blacklist database";
|
||||
|
||||
@@ -48,14 +52,14 @@ static char *app = "LookupBlacklist";
|
||||
static char *synopsis = "Look up Caller*ID name/number from blacklist database";
|
||||
|
||||
static char *descrip =
|
||||
" LookupBlacklist: Looks up the Caller*ID number on the active\n"
|
||||
"channel in the Asterisk database (family 'blacklist'). If the\n"
|
||||
"number is found, and if there exists a priority n + 101,\n"
|
||||
"where 'n' is the priority of the current instance, then the\n"
|
||||
"channel will be setup to continue at that priority level.\n"
|
||||
"Otherwise, it returns 0. Does nothing if no Caller*ID was received on the\n"
|
||||
"channel.\n"
|
||||
"Example: database put blacklist <name/number> 1\n";
|
||||
" LookupBlacklist(options): Looks up the Caller*ID number on the active\n"
|
||||
"channel in the Asterisk database (family 'blacklist'). \n"
|
||||
"The option string may contain the following character:\n"
|
||||
" 'j' -- jump to n+101 priority if the number/name is found in the blacklist\n"
|
||||
"This application sets the following channel variable upon completion:\n"
|
||||
" LOOKUPBLSTATUS The status of the Blacklist lookup as a text string, one of\n"
|
||||
" FOUND | NOTFOUND\n"
|
||||
"Example: exten => 1234,1,LookupBlacklist()\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -67,30 +71,39 @@ lookupblacklist_exec (struct ast_channel *chan, void *data)
|
||||
char blacklist[1];
|
||||
struct localuser *u;
|
||||
int bl = 0;
|
||||
int priority_jump = 0;
|
||||
|
||||
LOCAL_USER_ADD (u);
|
||||
if (chan->cid.cid_num)
|
||||
{
|
||||
if (!ast_db_get ("blacklist", chan->cid.cid_num, blacklist, sizeof (blacklist)))
|
||||
{
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
if (!ast_strlen_zero(data)) {
|
||||
if (strchr(data, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
if (chan->cid.cid_num) {
|
||||
if (!ast_db_get("blacklist", chan->cid.cid_num, blacklist, sizeof (blacklist))) {
|
||||
if (option_verbose > 2)
|
||||
ast_log(LOG_NOTICE, "Blacklisted number %s found\n",chan->cid.cid_num);
|
||||
bl = 1;
|
||||
}
|
||||
}
|
||||
if (chan->cid.cid_name) {
|
||||
if (!ast_db_get ("blacklist", chan->cid.cid_name, blacklist, sizeof (blacklist)))
|
||||
{
|
||||
if (!ast_db_get("blacklist", chan->cid.cid_name, blacklist, sizeof (blacklist))) {
|
||||
if (option_verbose > 2)
|
||||
ast_log (LOG_NOTICE,"Blacklisted name \"%s\" found\n",chan->cid.cid_name);
|
||||
bl = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (bl)
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
|
||||
LOCAL_USER_REMOVE (u);
|
||||
if (bl) {
|
||||
if (priority_jump || option_priority_jumping)
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
pbx_builtin_setvar_helper(chan, "LOOKUPBLSTATUS", "FOUND");
|
||||
} else
|
||||
pbx_builtin_setvar_helper(chan, "LOOKUPBLSTATUS", "NOTFOUND");
|
||||
|
||||
LOCAL_USER_REMOVE(u);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
6
apps/app_lookupcidname.c
Executable file → Normal file
6
apps/app_lookupcidname.c
Executable file → Normal file
@@ -20,10 +20,12 @@
|
||||
*
|
||||
* \brief App to set callerid name from database, based on directory number
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -53,7 +55,7 @@ static char *descrip =
|
||||
"Caller*ID name. Does nothing if no Caller*ID was received on the\n"
|
||||
"channel. This is useful if you do not subscribe to Caller*ID\n"
|
||||
"name delivery, or if you want to change the names on some incoming\n"
|
||||
"calls. Always returns 0.\n";
|
||||
"calls.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
46
apps/app_macro.c
Executable file → Normal file
46
apps/app_macro.c
Executable file → Normal file
@@ -20,12 +20,14 @@
|
||||
*
|
||||
* \brief Dial plan macro Implementation
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -57,7 +59,6 @@ static char *descrip =
|
||||
"${ARG1}, ${ARG2}, etc in the macro context.\n"
|
||||
"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"
|
||||
"Macro returns -1 if any step in the macro returns -1, and 0 otherwise.\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";
|
||||
|
||||
@@ -103,7 +104,7 @@ static int macro_exec(struct ast_channel *chan, void *data)
|
||||
char *offsets;
|
||||
int offset, depth;
|
||||
int setmacrocontext=0;
|
||||
int autoloopflag;
|
||||
int autoloopflag, dead = 0;
|
||||
|
||||
char *save_macro_exten;
|
||||
char *save_macro_context;
|
||||
@@ -215,8 +216,8 @@ 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)
|
||||
@@ -230,6 +231,7 @@ static int macro_exec(struct ast_channel *chan, void *data)
|
||||
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)
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -249,37 +251,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));
|
||||
@@ -298,7 +307,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);
|
||||
@@ -327,7 +337,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
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief A simple math application
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -68,7 +69,7 @@ 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. Always returns 0.\n";
|
||||
"and behave as their C equivalents.\n";
|
||||
|
||||
#define ADDFUNCTION 0
|
||||
#define DIVIDEFUNCTION 1
|
||||
|
69
apps/app_md5.c
Executable file → Normal file
69
apps/app_md5.c
Executable file → Normal file
@@ -20,11 +20,13 @@
|
||||
* \brief MD5 checksum application
|
||||
*
|
||||
* \todo Remove this deprecated application in 1.3dev
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -38,20 +40,25 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/pbx.h"
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/lock.h"
|
||||
#include "asterisk/app.h"
|
||||
|
||||
static char *tdesc_md5 = "MD5 checksum applications";
|
||||
static char *app_md5 = "MD5";
|
||||
static char *desc_md5 = "Calculate MD5 checksum";
|
||||
static char *synopsis_md5 =
|
||||
" MD5(<var>=<string>): Calculates a MD5 checksum on <string>.\n"
|
||||
"Returns hash value in a channel variable. Always return 0\n";
|
||||
"Returns hash value in a channel variable. \n";
|
||||
|
||||
static char *app_md5check = "MD5Check";
|
||||
static char *desc_md5check = "Check MD5 checksum";
|
||||
static char *synopsis_md5check =
|
||||
" MD5Check(<md5hash>,<string>): Calculates a MD5 checksum on <string>\n"
|
||||
" MD5Check(<md5hash>|<string>[|options]): Calculates a MD5 checksum on <string>\n"
|
||||
"and compares it with the hash. Returns 0 if <md5hash> is correct for <string>.\n"
|
||||
"Jumps to priority+101 if incorrect.\n";
|
||||
"The option string may contain zero or more of the following characters:\n"
|
||||
" 'j' -- jump to priority n+101 if the hash and string do not match \n"
|
||||
"This application sets the following channel variable upon completion:\n"
|
||||
" CHECKMD5STATUS The status of the MD5 check, one of the following\n"
|
||||
" MATCH | NOMATCH\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -100,44 +107,60 @@ static int md5check_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
int res=0;
|
||||
struct localuser *u;
|
||||
char *hash= NULL; /* Hash to compare with */
|
||||
char *string = NULL; /* String to calculate on */
|
||||
char newhash[50]; /* Return value */
|
||||
static int dep_warning = 0;
|
||||
int priority_jump = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(md5hash);
|
||||
AST_APP_ARG(string);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
if (!dep_warning) {
|
||||
ast_log(LOG_WARNING, "This application has been deprecated, please use the CHECK_MD5 function instead.\n");
|
||||
dep_warning = 1;
|
||||
}
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "Syntax: MD5Check(<md5hash>,<string>) - missing argument!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
memset(newhash,0, sizeof(newhash));
|
||||
|
||||
string = ast_strdupa(data);
|
||||
hash = strsep(&string,"|");
|
||||
if (ast_strlen_zero(hash)) {
|
||||
ast_log(LOG_WARNING, "Syntax: MD5Check(<md5hash>,<string>) - missing argument!\n");
|
||||
if (!(string = ast_strdupa(data))) {
|
||||
ast_log(LOG_WARNING, "Memory Error!\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
ast_md5_hash(newhash, string);
|
||||
if (!strcmp(newhash, hash)) { /* Verification ok */
|
||||
|
||||
AST_STANDARD_APP_ARGS(args, string);
|
||||
|
||||
if (args.options) {
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
if (ast_strlen_zero(args.md5hash) || ast_strlen_zero(args.string)) {
|
||||
ast_log(LOG_WARNING, "Syntax: MD5Check(<md5hash>|<string>[|options]) - missing argument!\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(newhash,0, sizeof(newhash));
|
||||
|
||||
ast_md5_hash(newhash, args.string);
|
||||
if (!strcmp(newhash, args.md5hash)) { /* Verification ok */
|
||||
if (option_debug > 2)
|
||||
ast_log(LOG_DEBUG, "MD5 verified ok: %s -- %s\n", hash, string);
|
||||
ast_log(LOG_DEBUG, "MD5 verified ok: %s -- %s\n", args.md5hash, args.string);
|
||||
pbx_builtin_setvar_helper(chan, "CHECKMD5STATUS", "MATCH");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return 0;
|
||||
}
|
||||
if (option_debug > 2)
|
||||
ast_log(LOG_DEBUG, "ERROR: MD5 not verified: %s -- %s\n", hash, string);
|
||||
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, "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 (option_debug > 2)
|
||||
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;
|
||||
}
|
||||
|
811
apps/app_meetme.c
Executable file → Normal file
811
apps/app_meetme.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
20
apps/app_milliwatt.c
Executable file → Normal file
20
apps/app_milliwatt.c
Executable file → Normal file
@@ -20,12 +20,13 @@
|
||||
*
|
||||
* \brief Digital Milliwatt Test
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
@@ -72,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)
|
||||
|
92
apps/app_mixmonitor.c
Executable file → Normal file
92
apps/app_mixmonitor.c
Executable file → Normal file
@@ -23,11 +23,13 @@
|
||||
|
||||
/*! \file
|
||||
* \brief MixMonitor() - Record a call and mix the audio during the recording
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -36,6 +38,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/file.h"
|
||||
#include "asterisk/logger.h"
|
||||
#include "asterisk/channel.h"
|
||||
#include "asterisk/chanspy.h"
|
||||
#include "asterisk/pbx.h"
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/lock.h"
|
||||
@@ -85,26 +88,33 @@ struct mixmonitor {
|
||||
};
|
||||
|
||||
enum {
|
||||
MUXFLAG_APPEND = (1 << 1),
|
||||
MUXFLAG_BRIDGED = (1 << 2),
|
||||
MUXFLAG_VOLUME = (1 << 3),
|
||||
MUXFLAG_READVOLUME = (1 << 4),
|
||||
MUXFLAG_WRITEVOLUME = (1 << 5),
|
||||
MUXFLAG_APPEND = (1 << 1),
|
||||
MUXFLAG_BRIDGED = (1 << 2),
|
||||
MUXFLAG_VOLUME = (1 << 3),
|
||||
MUXFLAG_READVOLUME = (1 << 4),
|
||||
MUXFLAG_WRITEVOLUME = (1 << 5),
|
||||
} mixmonitor_flags;
|
||||
|
||||
AST_DECLARE_OPTIONS(mixmonitor_opts,{
|
||||
['a'] = { MUXFLAG_APPEND },
|
||||
['b'] = { MUXFLAG_BRIDGED },
|
||||
['v'] = { MUXFLAG_READVOLUME, 1 },
|
||||
['V'] = { MUXFLAG_WRITEVOLUME, 2 },
|
||||
['W'] = { MUXFLAG_VOLUME, 3 },
|
||||
enum {
|
||||
OPT_ARG_READVOLUME = 0,
|
||||
OPT_ARG_WRITEVOLUME,
|
||||
OPT_ARG_VOLUME,
|
||||
OPT_ARG_ARRAY_SIZE,
|
||||
} mixmonitor_args;
|
||||
|
||||
AST_APP_OPTIONS(mixmonitor_opts, {
|
||||
AST_APP_OPTION('a', MUXFLAG_APPEND),
|
||||
AST_APP_OPTION('b', MUXFLAG_BRIDGED),
|
||||
AST_APP_OPTION_ARG('v', MUXFLAG_READVOLUME, OPT_ARG_READVOLUME),
|
||||
AST_APP_OPTION_ARG('V', MUXFLAG_WRITEVOLUME, OPT_ARG_WRITEVOLUME),
|
||||
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....
|
||||
/* If our status has changed to DONE, then the channel we're spying on is gone....
|
||||
DON'T TOUCH IT!!! RUN AWAY!!! */
|
||||
if (spy->status != CHANSPY_RUNNING)
|
||||
if (spy->status == CHANSPY_DONE)
|
||||
return;
|
||||
|
||||
if (!chan)
|
||||
@@ -152,7 +162,7 @@ static void *mixmonitor_thread(void *obj)
|
||||
oflags = O_CREAT|O_WRONLY;
|
||||
oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
|
||||
|
||||
if ((ext = strchr(mixmonitor->filename, '.'))) {
|
||||
if ((ext = strrchr(mixmonitor->filename, '.'))) {
|
||||
*(ext++) = '\0';
|
||||
} else {
|
||||
ext = "raw";
|
||||
@@ -193,6 +203,17 @@ static void *mixmonitor_thread(void *obj)
|
||||
if (option_verbose > 1)
|
||||
ast_verbose(VERBOSE_PREFIX_2 "Begin MixMonitor Recording %s\n", name);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
struct ast_frame *next;
|
||||
int write;
|
||||
@@ -227,17 +248,6 @@ static void *mixmonitor_thread(void *obj)
|
||||
ast_mutex_unlock(&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);
|
||||
|
||||
if (option_verbose > 1)
|
||||
@@ -272,7 +282,7 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename
|
||||
int len;
|
||||
|
||||
len = sizeof(*mixmonitor) + strlen(filename) + 1;
|
||||
if (post_process && !ast_strlen_zero(post_process))
|
||||
if (!ast_strlen_zero(post_process))
|
||||
len += strlen(post_process) + 1;
|
||||
|
||||
if (!(mixmonitor = calloc(1, len))) {
|
||||
@@ -283,7 +293,7 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename
|
||||
mixmonitor->chan = chan;
|
||||
mixmonitor->filename = (char *) mixmonitor + sizeof(*mixmonitor);
|
||||
strcpy(mixmonitor->filename, filename);
|
||||
if (post_process && !ast_strlen_zero(post_process)) {
|
||||
if (!ast_strlen_zero(post_process)) {
|
||||
mixmonitor->post_process = mixmonitor->filename + strlen(filename) + 1;
|
||||
strcpy(mixmonitor->post_process, post_process);
|
||||
}
|
||||
@@ -325,41 +335,41 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
if (ast_strlen_zero(args.filename)) {
|
||||
ast_log(LOG_WARNING, "Muxmon requires an argument (filename)\n");
|
||||
ast_log(LOG_WARNING, "MixMonitor requires an argument (filename)\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (args.options) {
|
||||
char *opts[3] = { NULL, };
|
||||
char *opts[OPT_ARG_ARRAY_SIZE] = { NULL, };
|
||||
|
||||
ast_parseoptions(mixmonitor_opts, &flags, opts, args.options);
|
||||
ast_app_parse_options(mixmonitor_opts, &flags, opts, args.options);
|
||||
|
||||
if (ast_test_flag(&flags, MUXFLAG_READVOLUME)) {
|
||||
if (!opts[0] || ast_strlen_zero(opts[0])) {
|
||||
if (ast_strlen_zero(opts[OPT_ARG_READVOLUME])) {
|
||||
ast_log(LOG_WARNING, "No volume level was provided for the heard volume ('v') option.\n");
|
||||
} else if ((sscanf(opts[0], "%d", &x) != 1) || (x < -4) || (x > 4)) {
|
||||
ast_log(LOG_NOTICE, "Heard volume must be a number between -4 and 4, not '%s'\n", opts[0]);
|
||||
} else if ((sscanf(opts[OPT_ARG_READVOLUME], "%d", &x) != 1) || (x < -4) || (x > 4)) {
|
||||
ast_log(LOG_NOTICE, "Heard volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_READVOLUME]);
|
||||
} else {
|
||||
readvol = get_volfactor(x);
|
||||
}
|
||||
}
|
||||
|
||||
if (ast_test_flag(&flags, MUXFLAG_WRITEVOLUME)) {
|
||||
if (!opts[1] || ast_strlen_zero(opts[1])) {
|
||||
if (ast_strlen_zero(opts[OPT_ARG_WRITEVOLUME])) {
|
||||
ast_log(LOG_WARNING, "No volume level was provided for the spoken volume ('V') option.\n");
|
||||
} else if ((sscanf(opts[1], "%d", &x) != 1) || (x < -4) || (x > 4)) {
|
||||
ast_log(LOG_NOTICE, "Spoken volume must be a number between -4 and 4, not '%s'\n", opts[1]);
|
||||
} else if ((sscanf(opts[OPT_ARG_WRITEVOLUME], "%d", &x) != 1) || (x < -4) || (x > 4)) {
|
||||
ast_log(LOG_NOTICE, "Spoken volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_WRITEVOLUME]);
|
||||
} else {
|
||||
writevol = get_volfactor(x);
|
||||
}
|
||||
}
|
||||
|
||||
if (ast_test_flag(&flags, MUXFLAG_VOLUME)) {
|
||||
if (!opts[2] || ast_strlen_zero(opts[2])) {
|
||||
if (ast_strlen_zero(opts[OPT_ARG_VOLUME])) {
|
||||
ast_log(LOG_WARNING, "No volume level was provided for the combined volume ('W') option.\n");
|
||||
} else if ((sscanf(opts[2], "%d", &x) != 1) || (x < -4) || (x > 4)) {
|
||||
ast_log(LOG_NOTICE, "Combined volume must be a number between -4 and 4, not '%s'\n", opts[2]);
|
||||
} else if ((sscanf(opts[OPT_ARG_VOLUME], "%d", &x) != 1) || (x < -4) || (x > 4)) {
|
||||
ast_log(LOG_NOTICE, "Combined volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_VOLUME]);
|
||||
} else {
|
||||
readvol = writevol = get_volfactor(x);
|
||||
}
|
||||
@@ -410,7 +420,7 @@ static struct ast_cli_entry cli_mixmonitor = {
|
||||
{ "mixmonitor", NULL, NULL },
|
||||
mixmonitor_cli,
|
||||
"Execute a MixMonitor command",
|
||||
"mixmonitor <start|stop> <chan_name> [<args>]"
|
||||
"mixmonitor <start|stop> <chan_name> [<args>]\n"
|
||||
};
|
||||
|
||||
|
||||
|
10
apps/app_mp3.c
Executable file → Normal file
10
apps/app_mp3.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief Silly application to play an MP3 file -- uses mpg123
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -42,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"
|
||||
@@ -53,9 +55,9 @@ static char *app = "MP3Player";
|
||||
static char *synopsis = "Play an MP3 file or stream";
|
||||
|
||||
static char *descrip =
|
||||
" MP3Player(location) Executes mpg123 to play the given location\n"
|
||||
"which typically would be a filename o a URL. User can exit by pressing any key\n."
|
||||
"Returns -1 on hangup or 0 otherwise.";
|
||||
" MP3Player(location) Executes mpg123 to play the given location,\n"
|
||||
"which typically would be a filename or a URL. User can exit by pressing\n"
|
||||
"any key on the dialpad, or by hanging up.";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -70,6 +72,8 @@ static int mp3play(char *filename, int fd)
|
||||
ast_log(LOG_WARNING, "Fork failed\n");
|
||||
if (res)
|
||||
return res;
|
||||
if (option_highpriority)
|
||||
ast_set_priority(0);
|
||||
dup2(fd, STDOUT_FILENO);
|
||||
for (x=0;x<256;x++) {
|
||||
if (x != STDOUT_FILENO)
|
||||
|
8
apps/app_nbscat.c
Executable file → Normal file
8
apps/app_nbscat.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief Silly application to play an NBScat file -- uses nbscat8k
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -43,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"
|
||||
@@ -59,8 +61,7 @@ static char *synopsis = "Play an NBS local stream";
|
||||
|
||||
static char *descrip =
|
||||
" NBScat: Executes nbscat to listen to the local NBS stream.\n"
|
||||
"Returns -1 on\n hangup or 0 otherwise. User can exit by \n"
|
||||
"pressing any key\n.";
|
||||
"User can exit by pressing any key\n.";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -75,6 +76,9 @@ static int NBScatplay(int fd)
|
||||
ast_log(LOG_WARNING, "Fork failed\n");
|
||||
if (res)
|
||||
return res;
|
||||
if (option_highpriority)
|
||||
ast_set_priority(0);
|
||||
|
||||
dup2(fd, STDOUT_FILENO);
|
||||
for (x=0;x<256;x++) {
|
||||
if (x != STDOUT_FILENO)
|
||||
|
168
apps/app_osplookup.c
Executable file → Normal file
168
apps/app_osplookup.c
Executable file → Normal file
@@ -20,8 +20,10 @@
|
||||
*
|
||||
* \brief Open Settlement Protocol Lookup
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@@ -42,6 +44,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/causes.h"
|
||||
#include "asterisk/astosp.h"
|
||||
#include "asterisk/app.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
static char *tdesc = "OSP Lookup";
|
||||
|
||||
@@ -62,23 +66,33 @@ static char *descrip =
|
||||
" ${OSPHANDLE}: The OSP Handle for anything remaining\n"
|
||||
" ${OSPRESULTS}: The number of OSP results total remaining\n"
|
||||
"\n"
|
||||
"If the lookup was *not* successful and there exists a priority n + 101,\n"
|
||||
"then that priority will be taken next.\n" ;
|
||||
"The option string may contain the following character:\n"
|
||||
" 'j' -- jump to n+101 priority if the lookup was NOT successful\n"
|
||||
"This application sets the following channel variable upon completion:\n"
|
||||
" OSPLOOKUPSTATUS The status of the OSP Lookup attempt as a text string, one of\n"
|
||||
" SUCCESS | FAILED \n";
|
||||
|
||||
|
||||
static char *descrip2 =
|
||||
" OSPNext: Looks up the next OSP Destination for ${OSPHANDLE}\n"
|
||||
" OSPNext(cause[|options]): Looks up the next OSP Destination for ${OSPHANDLE}\n"
|
||||
"See OSPLookup for more information\n"
|
||||
"\n"
|
||||
"If the lookup was *not* successful and there exists a priority n + 101,\n"
|
||||
"then that priority will be taken next.\n" ;
|
||||
"The option string may contain the following character:\n"
|
||||
" 'j' -- jump to n+101 priority if the lookup was NOT successful\n"
|
||||
"This application sets the following channel variable upon completion:\n"
|
||||
" OSPNEXTSTATUS The status of the OSP Next attempt as a text string, one of\n"
|
||||
" SUCCESS | FAILED \n";
|
||||
|
||||
static char *descrip3 =
|
||||
" OSPFinish(status): Records call state for ${OSPHANDLE}, according to\n"
|
||||
"status, which should be one of BUSY, CONGESTION, ANSWER, NOANSWER, or NOCHANAVAIL\n"
|
||||
"or coincidentally, just what the Dial application stores in its ${DIALSTATUS}\n"
|
||||
" OSPFinish(status[|options]): Records call state for ${OSPHANDLE}, according to\n"
|
||||
"status, which should be one of BUSY, CONGESTION, ANSWER, NOANSWER, or CHANUNAVAIL\n"
|
||||
"or coincidentally, just what the Dial application stores in its ${DIALSTATUS}.\n"
|
||||
"\n"
|
||||
"If the finishing was *not* successful and there exists a priority n + 101,\n"
|
||||
"then that priority will be taken next.\n" ;
|
||||
"The option string may contain the following character:\n"
|
||||
" 'j' -- jump to n+101 priority if the finish attempt was NOT successful\n"
|
||||
"This application sets the following channel variable upon completion:\n"
|
||||
" OSPFINISHSTATUS The status of the OSP Finish attempt as a text string, one of\n"
|
||||
" SUCCESS | FAILED \n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -107,11 +121,16 @@ static int osplookup_exec(struct ast_channel *chan, void *data)
|
||||
int res=0;
|
||||
struct localuser *u;
|
||||
char *temp;
|
||||
char *provider, *opts=NULL;
|
||||
struct ast_osp_result result;
|
||||
int priority_jump = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(extension);
|
||||
AST_APP_ARG(provider);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "OSPLookup requires an argument (extension)\n");
|
||||
ast_log(LOG_WARNING, "OSPLookup requires an argument OSPLookup(exten[|provider[|options]])\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -124,19 +143,15 @@ static int osplookup_exec(struct ast_channel *chan, void *data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
provider = strchr(temp, '|');
|
||||
if (provider) {
|
||||
*provider = '\0';
|
||||
provider++;
|
||||
opts = strchr(provider, '|');
|
||||
if (opts) {
|
||||
*opts = '\0';
|
||||
opts++;
|
||||
}
|
||||
AST_STANDARD_APP_ARGS(args, temp);
|
||||
|
||||
if (args.options) {
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
ast_log(LOG_DEBUG, "Whoo hoo, looking up OSP on '%s' via '%s'\n", temp, provider ? provider : "<default>");
|
||||
if ((res = ast_osp_lookup(chan, provider, temp, chan->cid.cid_num, &result)) > 0) {
|
||||
|
||||
ast_log(LOG_DEBUG, "Whoo hoo, looking up OSP on '%s' via '%s'\n", args.extension, args.provider ? args.provider : "<default>");
|
||||
if ((res = ast_osp_lookup(chan, args.provider, args.extension, chan->cid.cid_num, &result)) > 0) {
|
||||
char tmp[80];
|
||||
snprintf(tmp, sizeof(tmp), "%d", result.handle);
|
||||
pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
|
||||
@@ -145,16 +160,19 @@ static int osplookup_exec(struct ast_channel *chan, void *data)
|
||||
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, "OSPLOOKUPSTATUS", "SUCCESS");
|
||||
|
||||
} else {
|
||||
if (!res)
|
||||
ast_log(LOG_NOTICE, "OSP Lookup failed for '%s' (provider '%s')\n", temp, provider ? provider : "<default>");
|
||||
else
|
||||
ast_log(LOG_DEBUG, "Got hangup on '%s' while doing OSP Lookup for '%s' (provider '%s')!\n", chan->name, temp, provider ? provider : "<default>" );
|
||||
if (!res) {
|
||||
ast_log(LOG_NOTICE, "OSP Lookup failed for '%s' (provider '%s')\n", args.extension, args.provider ? args.provider : "<default>");
|
||||
pbx_builtin_setvar_helper(chan, "OSPLOOKUPSTATUS", "FAILED");
|
||||
} else
|
||||
ast_log(LOG_DEBUG, "Got hangup on '%s' while doing OSP Lookup for '%s' (provider '%s')!\n", chan->name, args.extension, args.provider ? args.provider : "<default>" );
|
||||
}
|
||||
if (!res) {
|
||||
/* Look for a "busy" place */
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
if (priority_jump || option_priority_jumping)
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
} else if (res > 0)
|
||||
res = 0;
|
||||
LOCAL_USER_REMOVE(u);
|
||||
@@ -168,28 +186,53 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
|
||||
char *temp;
|
||||
int cause;
|
||||
struct ast_osp_result result;
|
||||
|
||||
int priority_jump = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(cause);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "OSPNext should have an argument (cause)\n");
|
||||
ast_log(LOG_WARNING, "OSPNext should have an argument (cause[|options])\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
cause = str2cause((char *)data);
|
||||
temp = ast_strdupa(data);
|
||||
if (!temp) {
|
||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
AST_STANDARD_APP_ARGS(args, temp);
|
||||
|
||||
if (args.options) {
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
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)
|
||||
@@ -198,10 +241,13 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
|
||||
ast_log(LOG_DEBUG, "No OSP handle specified\n");
|
||||
} 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 */
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
if (priority_jump || option_priority_jumping)
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
} else if (res > 0)
|
||||
res = 0;
|
||||
LOCAL_USER_REMOVE(u);
|
||||
@@ -216,13 +262,32 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
|
||||
int cause;
|
||||
time_t start=0, duration=0;
|
||||
struct ast_osp_result result;
|
||||
|
||||
int priority_jump = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(status);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "OSPFinish should have an argument (cause)\n");
|
||||
ast_log(LOG_WARNING, "OSPFinish should have an argument (status[|options])\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
temp = ast_strdupa(data);
|
||||
if (!temp) {
|
||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
AST_STANDARD_APP_ARGS(args, temp);
|
||||
|
||||
if (args.options) {
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
if (chan->cdr) {
|
||||
start = chan->cdr->answer.tv_sec;
|
||||
@@ -233,12 +298,13 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
|
||||
} else
|
||||
ast_log(LOG_WARNING, "OSPFinish called on channel '%s' with no CDR!\n", chan->name);
|
||||
|
||||
cause = str2cause((char *)data);
|
||||
cause = str2cause(args.status);
|
||||
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 (!ast_osp_terminate(result.handle, cause, start, duration)) {
|
||||
pbx_builtin_setvar_helper(chan, "_OSPHANDLE", "");
|
||||
pbx_builtin_setvar_helper(chan, "OSPFINISHSTATUS", "SUCCESS");
|
||||
res = 1;
|
||||
}
|
||||
} else {
|
||||
@@ -247,12 +313,14 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
|
||||
ast_log(LOG_NOTICE, "OSP Finish failed for handle '%d'\n", result.handle);
|
||||
else
|
||||
ast_log(LOG_DEBUG, "No OSP handle specified\n");
|
||||
pbx_builtin_setvar_helper(chan, "OSPFINISHSTATUS", "FAILED");
|
||||
} else
|
||||
ast_log(LOG_DEBUG, "Got hangup on '%s' while doing OSP Terminate!\n", chan->name);
|
||||
}
|
||||
if (!res) {
|
||||
/* Look for a "busy" place */
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
if (priority_jump || option_priority_jumping)
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
} else if (res > 0)
|
||||
res = 0;
|
||||
LOCAL_USER_REMOVE(u);
|
||||
|
63
apps/app_page.c
Executable file → Normal file
63
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>
|
||||
*
|
||||
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief page() - Paging application
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -39,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";
|
||||
@@ -53,20 +55,21 @@ static const char *page_descrip =
|
||||
"them into a conference bridge as muted participants. The original\n"
|
||||
"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"
|
||||
"Always returns -1.\n";
|
||||
" d - full duplex audio\n"
|
||||
" q - quiet, do not play beep to caller\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
LOCAL_USER_DECL;
|
||||
|
||||
#define PAGE_DUPLEX (1 << 0)
|
||||
#define PAGE_QUIET (1 << 1)
|
||||
enum {
|
||||
PAGE_DUPLEX = (1 << 0),
|
||||
PAGE_QUIET = (1 << 1),
|
||||
} page_opt_flags;
|
||||
|
||||
AST_DECLARE_OPTIONS(page_opts,{
|
||||
['d'] = { PAGE_DUPLEX },
|
||||
['q'] = { PAGE_QUIET },
|
||||
AST_APP_OPTIONS(page_opts, {
|
||||
AST_APP_OPTION('d', PAGE_DUPLEX),
|
||||
AST_APP_OPTION('q', PAGE_QUIET),
|
||||
});
|
||||
|
||||
struct calloutdata {
|
||||
@@ -75,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;
|
||||
}
|
||||
@@ -89,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));
|
||||
@@ -99,6 +106,29 @@ 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)) {
|
||||
@@ -119,6 +149,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");
|
||||
@@ -140,12 +171,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_parseoptions(page_opts, &flags, NULL, options);
|
||||
ast_app_parse_options(page_opts, &flags, NULL, options);
|
||||
|
||||
snprintf(meetmeopts, sizeof(meetmeopts), "%ud|%sqxdw", 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);
|
||||
@@ -153,6 +193,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)
|
||||
|
11
apps/app_parkandannounce.c
Executable file → Normal file
11
apps/app_parkandannounce.c
Executable file → Normal file
@@ -23,12 +23,14 @@
|
||||
*
|
||||
* \brief ParkAndAnnounce application for Asterisk
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -77,6 +79,7 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
|
||||
char *s,*orig_s;
|
||||
|
||||
struct ast_channel *dchan;
|
||||
struct outgoing_helper oh;
|
||||
int outstate;
|
||||
|
||||
struct localuser *u;
|
||||
@@ -178,7 +181,9 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
/* Now place the call to the extention */
|
||||
|
||||
dchan = ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, dialstr,30000, &outstate, chan->cid.cid_num, chan->cid.cid_name);
|
||||
memset(&oh, 0, sizeof(oh));
|
||||
oh.parent_channel = chan;
|
||||
dchan = __ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, dialstr,30000, &outstate, chan->cid.cid_num, chan->cid.cid_name, &oh);
|
||||
|
||||
if(dchan) {
|
||||
if(dchan->_state == AST_STATE_UP) {
|
||||
|
55
apps/app_playback.c
Executable file → Normal file
55
apps/app_playback.c
Executable file → Normal file
@@ -20,10 +20,12 @@
|
||||
*
|
||||
* \brief Trivial application to playback a sound file
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -37,6 +39,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/translate.h"
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/options.h"
|
||||
#include "asterisk/app.h"
|
||||
|
||||
static char *tdesc = "Sound File Playback Application";
|
||||
|
||||
@@ -46,14 +50,19 @@ static char *synopsis = "Play a file";
|
||||
|
||||
static char *descrip =
|
||||
" Playback(filename[&filename2...][|option]): Plays back given filenames (do not put\n"
|
||||
"extension). Options may also be included following a pipe symbol. The 'skip'\n"
|
||||
"option causes the playback of the message to be skipped if the channel\n"
|
||||
"is not in the 'up' state (i.e. it hasn't been answered yet. If 'skip' is \n"
|
||||
"extension). Options may also be included following a pipe symbol. The 'skip'\n"
|
||||
"option causes the playback of the message to be skipped if the channel\n"
|
||||
"is not in the 'up' state (i.e. it hasn't been answered yet). If 'skip' is \n"
|
||||
"specified, the application will return immediately should the channel not be\n"
|
||||
"off hook. Otherwise, unless 'noanswer' is specified, the channel channel will\n"
|
||||
"off hook. Otherwise, unless 'noanswer' is specified, the channel will\n"
|
||||
"be answered before the sound is played. Not all channels support playing\n"
|
||||
"messages while still hook. Returns -1 if the channel was hung up. If the\n"
|
||||
"file does not exist, will jump to priority n+101 if present.\n";
|
||||
"messages while still on hook. If 'j' is specified, the application\n"
|
||||
"will jump to priority n+101 if present when a file specified to be played\n"
|
||||
"does not exist.\n"
|
||||
"This application sets the following channel variable upon completion:\n"
|
||||
" PLAYBACKSTATUS The status of the playback attempt as a text string, one of\n"
|
||||
" SUCCESS | FAILED\n"
|
||||
;
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -61,14 +70,17 @@ LOCAL_USER_DECL;
|
||||
|
||||
static int playback_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
int res = 0;
|
||||
int res = 0, mres = 0;
|
||||
struct localuser *u;
|
||||
char *tmp = NULL;
|
||||
char *options = NULL;
|
||||
int option_skip=0;
|
||||
int option_noanswer = 0;
|
||||
char *stringp = NULL;
|
||||
char *front = NULL, *back = NULL;
|
||||
int priority_jump = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(filenames);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "Playback requires an argument (filename)\n");
|
||||
@@ -84,13 +96,16 @@ static int playback_exec(struct ast_channel *chan, void *data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
stringp = tmp;
|
||||
strsep(&stringp, "|");
|
||||
options = strsep(&stringp, "|");
|
||||
if (options && !strcasecmp(options, "skip"))
|
||||
option_skip = 1;
|
||||
if (options && !strcasecmp(options, "noanswer"))
|
||||
option_noanswer = 1;
|
||||
AST_STANDARD_APP_ARGS(args, tmp);
|
||||
|
||||
if (args.options) {
|
||||
if (strcasestr(args.options, "skip"))
|
||||
option_skip = 1;
|
||||
if (strcasestr(args.options, "noanswer"))
|
||||
option_noanswer = 1;
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
if (chan->_state != AST_STATE_UP) {
|
||||
if (option_skip) {
|
||||
@@ -115,11 +130,17 @@ static int playback_exec(struct ast_channel *chan, void *data)
|
||||
ast_stopstream(chan);
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char *)data);
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
if (priority_jump || option_priority_jumping)
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
res = 0;
|
||||
mres = 1;
|
||||
}
|
||||
front = back;
|
||||
}
|
||||
if (mres)
|
||||
pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "FAILED");
|
||||
else
|
||||
pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "SUCCESS");
|
||||
}
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return res;
|
||||
|
130
apps/app_privacy.c
Executable file → Normal file
130
apps/app_privacy.c
Executable file → Normal file
@@ -20,10 +20,12 @@
|
||||
*
|
||||
* \brief Block all calls without Caller*ID, require phone # to be entered
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -52,17 +54,24 @@ static char *app = "PrivacyManager";
|
||||
static char *synopsis = "Require phone number to be entered, if no CallerID sent";
|
||||
|
||||
static char *descrip =
|
||||
" PrivacyManager: If no Caller*ID is sent, PrivacyManager answers the\n"
|
||||
"channel and asks the caller to enter their phone number.\n"
|
||||
"The caller is given 3 attempts. If after 3 attempts, they do not enter\n"
|
||||
"at least a 10 digit phone number, and if there exists a priority n + 101,\n"
|
||||
"where 'n' is the priority of the current instance, then the\n"
|
||||
"channel will be setup to continue at that priority level.\n"
|
||||
"Otherwise, it returns 0. Does nothing if Caller*ID was received on the\n"
|
||||
"channel.\n"
|
||||
" PrivacyManager([maxretries[|minlength[|options]]]): If no Caller*ID \n"
|
||||
"is sent, PrivacyManager answers the channel and asks the caller to\n"
|
||||
"enter their phone number. The caller is given 3 attempts to do so.\n"
|
||||
"The application does nothing if Caller*ID was received on the channel.\n"
|
||||
" Configuration file privacy.conf contains two variables:\n"
|
||||
" maxretries default 3 -maximum number of attempts the caller is allowed to input a callerid.\n"
|
||||
" maxretries default 3 -maximum number of attempts the caller is allowed \n"
|
||||
" to input a callerid.\n"
|
||||
" minlength default 10 -minimum allowable digits in the input callerid number.\n"
|
||||
"If you don't want to use the config file and have an i/o operation with\n"
|
||||
"every call, you can also specify maxretries and minlength as application\n"
|
||||
"parameters. Doing so supercedes any values set in privacy.conf.\n"
|
||||
"The option string may contain the following character: \n"
|
||||
" 'j' -- jump to n+101 priority after <maxretries> failed attempts to collect\n"
|
||||
" the minlength number of digits.\n"
|
||||
"The application sets the following channel variable upon completion: \n"
|
||||
"PRIVACYMGRSTATUS The status of the privacy manager's attempt to collect \n"
|
||||
" a phone number from the user. A text string that is either:\n"
|
||||
" SUCCESS | FAILED \n"
|
||||
;
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
@@ -71,18 +80,24 @@ LOCAL_USER_DECL;
|
||||
|
||||
|
||||
|
||||
static int
|
||||
privacy_exec (struct ast_channel *chan, void *data)
|
||||
static int privacy_exec (struct ast_channel *chan, void *data)
|
||||
{
|
||||
int res=0;
|
||||
int retries;
|
||||
int maxretries = 3;
|
||||
int minlength = 10;
|
||||
int x;
|
||||
int x = 0;
|
||||
char *s;
|
||||
char phone[30];
|
||||
struct localuser *u;
|
||||
struct ast_config *cfg;
|
||||
struct ast_config *cfg = NULL;
|
||||
char *parse = NULL;
|
||||
int priority_jump = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(maxretries);
|
||||
AST_APP_ARG(minlength);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
LOCAL_USER_ADD (u);
|
||||
if (!ast_strlen_zero(chan->cid.cid_num)) {
|
||||
@@ -97,9 +112,55 @@ privacy_exec (struct ast_channel *chan, void *data)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*Read in the config file*/
|
||||
cfg = ast_config_load(PRIV_CONFIG);
|
||||
|
||||
if (!ast_strlen_zero((char *)data))
|
||||
{
|
||||
parse = ast_strdupa(data);
|
||||
if (!parse) {
|
||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
if (args.maxretries) {
|
||||
if (sscanf(args.maxretries, "%d", &x) == 1)
|
||||
maxretries = x;
|
||||
else
|
||||
ast_log(LOG_WARNING, "Invalid max retries argument\n");
|
||||
}
|
||||
if (args.minlength) {
|
||||
if (sscanf(args.minlength, "%d", &x) == 1)
|
||||
minlength = x;
|
||||
else
|
||||
ast_log(LOG_WARNING, "Invalid min length argument\n");
|
||||
}
|
||||
if (args.options)
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
|
||||
}
|
||||
|
||||
if (!x)
|
||||
{
|
||||
/*Read in the config file*/
|
||||
cfg = ast_config_load(PRIV_CONFIG);
|
||||
|
||||
if (cfg && (s = ast_variable_retrieve(cfg, "general", "maxretries"))) {
|
||||
if (sscanf(s, "%d", &x) == 1)
|
||||
maxretries = x;
|
||||
else
|
||||
ast_log(LOG_WARNING, "Invalid max retries argument\n");
|
||||
}
|
||||
|
||||
if (cfg && (s = ast_variable_retrieve(cfg, "general", "minlength"))) {
|
||||
if (sscanf(s, "%d", &x) == 1)
|
||||
minlength = x;
|
||||
else
|
||||
ast_log(LOG_WARNING, "Invalid min length argument\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*Play unidentified call*/
|
||||
res = ast_safe_sleep(chan, 1000);
|
||||
@@ -108,21 +169,6 @@ privacy_exec (struct ast_channel *chan, void *data)
|
||||
if (!res)
|
||||
res = ast_waitstream(chan, "");
|
||||
|
||||
if (cfg && (s = ast_variable_retrieve(cfg, "general", "maxretries"))) {
|
||||
if (sscanf(s, "%d", &x) == 1) {
|
||||
maxretries = x;
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "Invalid max retries argument\n");
|
||||
}
|
||||
}
|
||||
if (cfg && (s = ast_variable_retrieve(cfg, "general", "minlength"))) {
|
||||
if (sscanf(s, "%d", &x) == 1) {
|
||||
minlength = x;
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "Invalid min length argument\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*Ask for 10 digit number, give 3 attempts*/
|
||||
for (retries = 0; retries < maxretries; retries++) {
|
||||
if (!res)
|
||||
@@ -147,16 +193,26 @@ 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 {
|
||||
/* Send the call to n+101 priority, where n is the current priority */
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
if (priority_jump || option_priority_jumping)
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
pbx_builtin_setvar_helper(chan, "PRIVACYMGRSTATUS", "FAILED");
|
||||
}
|
||||
if (cfg)
|
||||
ast_config_destroy(cfg);
|
||||
|
1029
apps/app_queue.c
Executable file → Normal file
1029
apps/app_queue.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
3
apps/app_random.c
Executable file → Normal file
3
apps/app_random.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
* \brief Random application
|
||||
*
|
||||
* \author Tilghman Lesher <asterisk__app_random__200508@the-tilghman.com>
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -81,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",
|
||||
|
8
apps/app_read.c
Executable file → Normal file
8
apps/app_read.c
Executable file → Normal file
@@ -20,10 +20,12 @@
|
||||
*
|
||||
* \brief Trivial application to read a variable
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -61,7 +63,7 @@ static char *descrip =
|
||||
" attempts -- if greater than 1, that many attempts will be made in the \n"
|
||||
" event no data is entered.\n"
|
||||
" timeout -- if greater than 0, that value will override the default timeout.\n\n"
|
||||
"Returns -1 on hangup or error and 0 otherwise.\n";
|
||||
"Read should disconnect if the function fails or errors out.\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -103,7 +105,7 @@ static int read_exec(struct ast_channel *chan, void *data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ast_separate_app_args(argcopy, '|', args, sizeof(args) / sizeof(args[0])) < 1) {
|
||||
if (ast_app_separate_args(argcopy, '|', args, sizeof(args) / sizeof(args[0])) < 1) {
|
||||
ast_log(LOG_WARNING, "Cannot Parse Arguments.\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
|
18
apps/app_readfile.c
Executable file → Normal file
18
apps/app_readfile.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief ReadFile application -- Reads in a File for you.
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -94,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;
|
||||
}
|
||||
|
4
apps/app_realtime.c
Executable file → Normal file
4
apps/app_realtime.c
Executable file → Normal file
@@ -21,11 +21,13 @@
|
||||
*
|
||||
* \brief RealTime App
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
|
238
apps/app_record.c
Executable file → Normal file
238
apps/app_record.c
Executable file → Normal file
@@ -20,10 +20,12 @@
|
||||
*
|
||||
* \brief Trivial application to record a sound file
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -38,6 +40,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/translate.h"
|
||||
#include "asterisk/dsp.h"
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
static char *tdesc = "Trivial Record Application";
|
||||
|
||||
@@ -54,17 +57,18 @@ static char *descrip =
|
||||
"- 'maxduration' is the maximum recording duration in seconds. If missing\n"
|
||||
"or 0 there is no maximum.\n"
|
||||
"- 'options' may contain any of the following letters:\n"
|
||||
" 's' : skip recording if the line is not yet answered\n"
|
||||
" 'n' : do not answer, but record anyway if line not yet answered\n"
|
||||
" 'a' : append to existing recording rather than replacing\n"
|
||||
" 't' : use alternate '*' terminator key instead of default '#'\n"
|
||||
" 'n' : do not answer, but record anyway if line not yet answered\n"
|
||||
" 'q' : quiet (do not play a beep tone)\n"
|
||||
" 's' : skip recording if the line is not yet answered\n"
|
||||
" '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"
|
||||
"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"
|
||||
"Returns -1 when the user hangs up.\n";
|
||||
"If the user should hangup during a recording, all data will be lost and the\n"
|
||||
"application will teminate. \n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -98,6 +102,8 @@ static int record_exec(struct ast_channel *chan, void *data)
|
||||
int option_quiet = 0;
|
||||
int rfmt = 0;
|
||||
int flags;
|
||||
int waitres;
|
||||
struct ast_silence_generator *silgen = NULL;
|
||||
|
||||
/* The next few lines of code parse out the filename and header from the input string */
|
||||
if (ast_strlen_zero(data)) { /* no data implies no filename or anything is present */
|
||||
@@ -199,123 +205,131 @@ static int record_exec(struct ast_channel *chan, void *data)
|
||||
}
|
||||
}
|
||||
|
||||
if (!res) {
|
||||
if (res) {
|
||||
ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!option_quiet) {
|
||||
/* Some code to play a nice little beep to signify the start of the record operation */
|
||||
res = ast_streamfile(chan, "beep", chan->language);
|
||||
if (!res) {
|
||||
res = ast_waitstream(chan, "");
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", chan->name);
|
||||
if (!option_quiet) {
|
||||
/* Some code to play a nice little beep to signify the start of the record operation */
|
||||
res = ast_streamfile(chan, "beep", chan->language);
|
||||
if (!res) {
|
||||
res = ast_waitstream(chan, "");
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", chan->name);
|
||||
}
|
||||
ast_stopstream(chan);
|
||||
}
|
||||
|
||||
/* The end of beep code. Now the recording starts */
|
||||
|
||||
if (silence > 0) {
|
||||
rfmt = chan->readformat;
|
||||
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");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
sildet = ast_dsp_new();
|
||||
if (!sildet) {
|
||||
ast_log(LOG_WARNING, "Unable to create silence detector :(\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
ast_dsp_set_threshold(sildet, 256);
|
||||
}
|
||||
|
||||
|
||||
flags = option_append ? O_CREAT|O_APPEND|O_WRONLY : O_CREAT|O_TRUNC|O_WRONLY;
|
||||
s = ast_writefile( tmp, ext, NULL, flags , 0, 0644);
|
||||
|
||||
if (!s) {
|
||||
ast_log(LOG_WARNING, "Could not create file %s\n", filename);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (option_transmit_silence_during_record)
|
||||
silgen = ast_channel_start_silence_generator(chan);
|
||||
|
||||
/* Request a video update */
|
||||
ast_indicate(chan, AST_CONTROL_VIDUPDATE);
|
||||
|
||||
if (maxduration <= 0)
|
||||
maxduration = -1;
|
||||
|
||||
while ((waitres = ast_waitfor(chan, maxduration)) > -1) {
|
||||
if (maxduration > 0) {
|
||||
if (waitres == 0) {
|
||||
gottimeout = 1;
|
||||
break;
|
||||
}
|
||||
ast_stopstream(chan);
|
||||
maxduration = waitres;
|
||||
}
|
||||
|
||||
/* The end of beep code. Now the recording starts */
|
||||
|
||||
if (silence > 0) {
|
||||
rfmt = chan->readformat;
|
||||
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");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
sildet = ast_dsp_new();
|
||||
if (!sildet) {
|
||||
ast_log(LOG_WARNING, "Unable to create silence detector :(\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
ast_dsp_set_threshold(sildet, 256);
|
||||
}
|
||||
|
||||
|
||||
flags = option_append ? O_CREAT|O_APPEND|O_WRONLY : O_CREAT|O_TRUNC|O_WRONLY;
|
||||
s = ast_writefile( tmp, ext, NULL, flags , 0, 0644);
|
||||
|
||||
if (s) {
|
||||
int waitres;
|
||||
|
||||
/* Request a video update */
|
||||
ast_indicate(chan, AST_CONTROL_VIDUPDATE);
|
||||
|
||||
if (maxduration <= 0)
|
||||
maxduration = -1;
|
||||
f = ast_read(chan);
|
||||
if (!f) {
|
||||
res = -1;
|
||||
break;
|
||||
}
|
||||
if (f->frametype == AST_FRAME_VOICE) {
|
||||
res = ast_writestream(s, f);
|
||||
|
||||
while ((waitres = ast_waitfor(chan, maxduration)) > -1) {
|
||||
if (maxduration > 0) {
|
||||
if (waitres == 0) {
|
||||
gottimeout = 1;
|
||||
break;
|
||||
}
|
||||
maxduration = waitres;
|
||||
}
|
||||
|
||||
f = ast_read(chan);
|
||||
if (!f) {
|
||||
res = -1;
|
||||
break;
|
||||
}
|
||||
if (f->frametype == AST_FRAME_VOICE) {
|
||||
res = ast_writestream(s, f);
|
||||
|
||||
if (res) {
|
||||
ast_log(LOG_WARNING, "Problem writing frame\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (silence > 0) {
|
||||
dspsilence = 0;
|
||||
ast_dsp_silence(sildet, f, &dspsilence);
|
||||
if (dspsilence) {
|
||||
totalsilence = dspsilence;
|
||||
} else {
|
||||
totalsilence = 0;
|
||||
}
|
||||
if (totalsilence > silence) {
|
||||
/* Ended happily with silence */
|
||||
ast_frfree(f);
|
||||
gotsilence = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (f->frametype == AST_FRAME_VIDEO) {
|
||||
res = ast_writestream(s, f);
|
||||
|
||||
if (res) {
|
||||
ast_log(LOG_WARNING, "Problem writing frame\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((f->frametype == AST_FRAME_DTMF) &&
|
||||
(f->subclass == terminator)) {
|
||||
ast_frfree(f);
|
||||
break;
|
||||
}
|
||||
if (res) {
|
||||
ast_log(LOG_WARNING, "Problem writing frame\n");
|
||||
ast_frfree(f);
|
||||
}
|
||||
if (!f) {
|
||||
ast_log(LOG_DEBUG, "Got hangup\n");
|
||||
res = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gotsilence) {
|
||||
ast_stream_rewind(s, silence-1000);
|
||||
ast_truncstream(s);
|
||||
} else if (!gottimeout) {
|
||||
/* Strip off the last 1/4 second of it */
|
||||
ast_stream_rewind(s, 250);
|
||||
ast_truncstream(s);
|
||||
if (silence > 0) {
|
||||
dspsilence = 0;
|
||||
ast_dsp_silence(sildet, f, &dspsilence);
|
||||
if (dspsilence) {
|
||||
totalsilence = dspsilence;
|
||||
} else {
|
||||
totalsilence = 0;
|
||||
}
|
||||
if (totalsilence > silence) {
|
||||
/* Ended happily with silence */
|
||||
ast_frfree(f);
|
||||
gotsilence = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ast_closestream(s);
|
||||
} else
|
||||
ast_log(LOG_WARNING, "Could not create file %s\n", filename);
|
||||
} else
|
||||
ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name);
|
||||
} 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;
|
||||
}
|
||||
} else if ((f->frametype == AST_FRAME_DTMF) &&
|
||||
(f->subclass == terminator)) {
|
||||
ast_frfree(f);
|
||||
break;
|
||||
}
|
||||
ast_frfree(f);
|
||||
}
|
||||
if (!f) {
|
||||
ast_log(LOG_DEBUG, "Got hangup\n");
|
||||
res = -1;
|
||||
}
|
||||
|
||||
if (gotsilence) {
|
||||
ast_stream_rewind(s, silence-1000);
|
||||
ast_truncstream(s);
|
||||
} else if (!gottimeout) {
|
||||
/* Strip off the last 1/4 second of it */
|
||||
ast_stream_rewind(s, 250);
|
||||
ast_truncstream(s);
|
||||
}
|
||||
ast_closestream(s);
|
||||
|
||||
if (silgen)
|
||||
ast_channel_stop_silence_generator(chan, silgen);
|
||||
|
||||
out:
|
||||
if ((silence > 0) && rfmt) {
|
||||
res = ast_set_read_format(chan, rfmt);
|
||||
if (res)
|
||||
|
11
apps/app_rpt.c
Executable file → Normal file
11
apps/app_rpt.c
Executable file → Normal file
@@ -20,7 +20,7 @@
|
||||
/*
|
||||
*
|
||||
* Radio Repeater / Remote Base program
|
||||
* version 0.36 10/26/05
|
||||
* version 0.37 11/3/05
|
||||
*
|
||||
* See http://www.zapatatelephony.org/app_rpt.html
|
||||
*
|
||||
@@ -197,7 +197,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/say.h"
|
||||
#include "asterisk/localtime.h"
|
||||
|
||||
static char *tdesc = "Radio Repeater / Remote Base version 0.36 10/26/2005";
|
||||
static char *tdesc = "Radio Repeater / Remote Base version 0.37 11/03/2005";
|
||||
|
||||
static char *app = "Rpt";
|
||||
|
||||
@@ -4614,7 +4614,7 @@ char cmd[MAXDTMF+1] = "";
|
||||
ast_set_write_format(myrpt->txchannel,AST_FORMAT_SLINEAR);
|
||||
myrpt->txchannel->whentohangup = 0;
|
||||
myrpt->txchannel->appl = "Apprpt";
|
||||
myrpt->txchannel->data = "(Repeater Rx)";
|
||||
myrpt->txchannel->data = "(Repeater Tx)";
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
|
||||
tmpstr,tele,myrpt->txchannel->name);
|
||||
@@ -5758,6 +5758,7 @@ pthread_attr_t attr;
|
||||
if (!rpt_vars[i].rxchanname)
|
||||
{
|
||||
ast_log(LOG_WARNING,"Did not specify rxchanname for node %s\n",rpt_vars[i].name);
|
||||
ast_config_destroy(cfg);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
/* if is a remote, dont start one for it */
|
||||
@@ -5775,6 +5776,7 @@ pthread_attr_t attr;
|
||||
if (!rpt_vars[i].ident)
|
||||
{
|
||||
ast_log(LOG_WARNING,"Did not specify ident for node %s\n",rpt_vars[i].name);
|
||||
ast_config_destroy(cfg);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
pthread_attr_init(&attr);
|
||||
@@ -5821,6 +5823,7 @@ pthread_attr_t attr;
|
||||
}
|
||||
usleep(2000000);
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
@@ -6022,7 +6025,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (*b1 <= '1')
|
||||
if (*b1 < '1')
|
||||
{
|
||||
ast_log(LOG_WARNING, "Node %s Invalid for connection here!!\n",b1);
|
||||
return -1;
|
||||
|
7
apps/app_sayunixtime.c
Executable file → Normal file
7
apps/app_sayunixtime.c
Executable file → Normal file
@@ -19,6 +19,7 @@
|
||||
*
|
||||
* \brief SayUnixTime application
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -53,8 +54,7 @@ static char *sayunixtime_descrip =
|
||||
" timezone: timezone, see /usr/share/zoneinfo for a list.\n"
|
||||
" defaults to machine default.\n"
|
||||
" format: a format the time is to be said in. See voicemail.conf.\n"
|
||||
" defaults to \"ABdY 'digits/at' IMp\"\n"
|
||||
" Returns 0 or -1 on hangup.\n";
|
||||
" defaults to \"ABdY 'digits/at' IMp\"\n";
|
||||
static char *datetime_descrip =
|
||||
"DateTime([unixtime][|[timezone][|format]])\n"
|
||||
" unixtime: time, in seconds since Jan 1, 1970. May be negative.\n"
|
||||
@@ -62,8 +62,7 @@ static char *datetime_descrip =
|
||||
" timezone: timezone, see /usr/share/zoneinfo for a list.\n"
|
||||
" defaults to machine default.\n"
|
||||
" format: a format the time is to be said in. See voicemail.conf.\n"
|
||||
" defaults to \"ABdY 'digits/at' IMp\"\n"
|
||||
" Returns 0 or -1 on hangup.\n";
|
||||
" defaults to \"ABdY 'digits/at' IMp\"\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
11
apps/app_senddtmf.c
Executable file → Normal file
11
apps/app_senddtmf.c
Executable file → Normal file
@@ -20,10 +20,12 @@
|
||||
*
|
||||
* \brief App to send DTMF digits
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -47,9 +49,10 @@ static char *app = "SendDTMF";
|
||||
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"
|
||||
" Returns 0 on success or -1 on a hangup.\n";
|
||||
" SendDTMF(digits[|timeout_ms]): Sends DTMF digits on a channel. \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";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
47
apps/app_sendtext.c
Executable file → Normal file
47
apps/app_sendtext.c
Executable file → Normal file
@@ -20,10 +20,14 @@
|
||||
*
|
||||
* \brief App to transmit a text message
|
||||
*
|
||||
* Requires support of sending text messages from channel driver
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -38,6 +42,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/translate.h"
|
||||
#include "asterisk/image.h"
|
||||
#include "asterisk/options.h"
|
||||
#include "asterisk/app.h"
|
||||
|
||||
static const char *tdesc = "Send Text Applications";
|
||||
|
||||
@@ -46,8 +51,7 @@ static const char *app = "SendText";
|
||||
static const char *synopsis = "Send a Text Message";
|
||||
|
||||
static const char *descrip =
|
||||
" SendText(text): Sends text to current channel (callee).\n"
|
||||
"Otherwise, execution will continue at the next priority level.\n"
|
||||
" SendText(text[|options]): Sends text to current channel (callee).\n"
|
||||
"Result of transmission will be stored in the SENDTEXTSTATUS\n"
|
||||
"channel variable:\n"
|
||||
" SUCCESS Transmission succeeded\n"
|
||||
@@ -55,11 +59,9 @@ static const char *descrip =
|
||||
" UNSUPPORTED Text transmission not supported by channel\n"
|
||||
"\n"
|
||||
"At this moment, text is supposed to be 7 bit ASCII in most channels.\n"
|
||||
"Old deprecated behavior: \n"
|
||||
" SendText only returns 0 if the text was sent correctly or if\n"
|
||||
" the channel does not support text transport.\n"
|
||||
" If the client does not support text transport, and there exists a\n"
|
||||
" step with priority n + 101, then execution will continue at that step.\n";
|
||||
"The option string many contain the following character:\n"
|
||||
"'j' -- jump to n+101 priority if the channel doesn't support\n"
|
||||
" text transport\n";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
@@ -70,26 +72,47 @@ static int sendtext_exec(struct ast_channel *chan, void *data)
|
||||
int res = 0;
|
||||
struct localuser *u;
|
||||
char *status = "UNSUPPORTED";
|
||||
char *parse = NULL;
|
||||
int priority_jump = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(text);
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "SendText requires an argument (text)\n");
|
||||
ast_log(LOG_WARNING, "SendText requires an argument (text[|options])\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
} else {
|
||||
parse = ast_strdupa(data);
|
||||
if (!parse) {
|
||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL_USER_ADD(u);
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
if (args.options) {
|
||||
if (strchr(args.options, 'j'))
|
||||
priority_jump = 1;
|
||||
}
|
||||
|
||||
ast_mutex_lock(&chan->lock);
|
||||
if (!chan->tech->send_text) {
|
||||
ast_mutex_unlock(&chan->lock);
|
||||
/* Does not support transport */
|
||||
if (option_priority_jumping)
|
||||
if (priority_jump || option_priority_jumping)
|
||||
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return 0;
|
||||
}
|
||||
status = "FAILURE";
|
||||
ast_mutex_unlock(&chan->lock);
|
||||
res = ast_sendtext(chan, (char *)data);
|
||||
res = ast_sendtext(chan, args.text);
|
||||
if (!res)
|
||||
status = "SUCCESS";
|
||||
pbx_builtin_setvar_helper(chan, "SENDTEXTSTATUS", status);
|
||||
|
8
apps/app_setcallerid.c
Executable file → Normal file
8
apps/app_setcallerid.c
Executable file → Normal file
@@ -20,10 +20,12 @@
|
||||
*
|
||||
* \brief App to set callerid
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -49,7 +51,7 @@ LOCAL_USER_DECL;
|
||||
|
||||
static char *descrip2 =
|
||||
" SetCallerPres(presentation): Set Caller*ID presentation on a call.\n"
|
||||
" Always returns 0. Valid presentations are:\n"
|
||||
" Valid presentations are:\n"
|
||||
"\n"
|
||||
" allowed_not_screened : Presentation Allowed, Not Screened\n"
|
||||
" allowed_passed_screen : Presentation Allowed, Passed Screen\n"
|
||||
@@ -94,7 +96,7 @@ static char *synopsis = "Set CallerID";
|
||||
|
||||
static char *descrip =
|
||||
" SetCallerID(clid[|a]): Set Caller*ID on a call to a new\n"
|
||||
"value. Sets ANI as well if a flag is used. Always returns 0\n";
|
||||
"value. Sets ANI as well if a flag is used. \n";
|
||||
|
||||
static int setcallerid_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
|
7
apps/app_setcdruserfield.c
Executable file → Normal file
7
apps/app_setcdruserfield.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief Applictions connected with CDR engine
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -51,8 +52,7 @@ static char *setcdruserfield_descrip =
|
||||
" can use for data not stored anywhere else in the record.\n"
|
||||
" CDR records can be used for billing or storing other arbitrary data\n"
|
||||
" (I.E. telephone survey responses)\n"
|
||||
" Also see AppendCDRUserField().\n"
|
||||
" Always returns 0\n";
|
||||
" Also see AppendCDRUserField().\n";
|
||||
|
||||
|
||||
static char *setcdruserfield_app = "SetCDRUserField";
|
||||
@@ -67,8 +67,7 @@ static char *appendcdruserfield_descrip =
|
||||
" can use for data not stored anywhere else in the record.\n"
|
||||
" CDR records can be used for billing or storing other arbitrary data\n"
|
||||
" (I.E. telephone survey responses)\n"
|
||||
" Also see SetCDRUserField().\n"
|
||||
" Always returns 0\n";
|
||||
" Also see SetCDRUserField().\n";
|
||||
|
||||
static char *appendcdruserfield_app = "AppendCDRUserField";
|
||||
static char *appendcdruserfield_synopsis = "Append to the CDR user field";
|
||||
|
6
apps/app_setcidname.c
Executable file → Normal file
6
apps/app_setcidname.c
Executable file → Normal file
@@ -20,10 +20,12 @@
|
||||
*
|
||||
* \brief App to set callerid
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -50,7 +52,7 @@ static char *descrip =
|
||||
" SetCIDName(cname[|a]): Set Caller*ID Name on a call to a new\n"
|
||||
"value, while preserving the original Caller*ID number. This is\n"
|
||||
"useful for providing additional information to the called\n"
|
||||
"party. Always returns 0\n"
|
||||
"party. \n"
|
||||
"SetCIDName has been deprecated in favor of the function\n"
|
||||
"CALLERID(name)\n";
|
||||
|
||||
|
6
apps/app_setcidnum.c
Executable file → Normal file
6
apps/app_setcidnum.c
Executable file → Normal file
@@ -21,10 +21,12 @@
|
||||
*
|
||||
* \brief App to set callerid number
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -51,7 +53,7 @@ static char *descrip =
|
||||
" SetCIDNum(cnum[|a]): Set Caller*ID Number on a call to a new\n"
|
||||
"value, while preserving the original Caller*ID name. This is\n"
|
||||
"useful for providing additional information to the called\n"
|
||||
"party. Sets ANI as well if a flag is used. Always returns 0\n"
|
||||
"party. Sets ANI as well if a flag is used.\n"
|
||||
"SetCIDNum has been deprecated in favor of the function\n"
|
||||
"CALLERID(number)\n";
|
||||
|
||||
|
6
apps/app_setrdnis.c
Executable file → Normal file
6
apps/app_setrdnis.c
Executable file → Normal file
@@ -21,10 +21,12 @@
|
||||
*
|
||||
* \brief App to set rdnis
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -49,7 +51,7 @@ static char *synopsis = "Set RDNIS Number";
|
||||
|
||||
static char *descrip =
|
||||
" SetRDNIS(cnum): Set RDNIS Number on a call to a new\n"
|
||||
"value. Always returns 0\n"
|
||||
"value.\n"
|
||||
"SetRDNIS has been deprecated in favor of the function\n"
|
||||
"CALLERID(rdnis)\n";
|
||||
|
||||
|
3
apps/app_settransfercapability.c
Executable file → Normal file
3
apps/app_settransfercapability.c
Executable file → Normal file
@@ -20,6 +20,7 @@
|
||||
*
|
||||
* \brief App to set the ISDN Transfer Capability
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -57,7 +58,7 @@ static struct { int val; char *name; } transcaps[] = {
|
||||
static char *descrip =
|
||||
" SetTransferCapability(transfercapability): Set the ISDN Transfer \n"
|
||||
"Capability of a call to a new value.\n"
|
||||
"Always returns 0. Valid Transfer Capabilities are:\n"
|
||||
"Valid Transfer Capabilities are:\n"
|
||||
"\n"
|
||||
" SPEECH : 0x00 - Speech (default, voice calls)\n"
|
||||
" DIGITAL : 0x08 - Unrestricted digital information (data calls)\n"
|
||||
|
12
apps/app_skel.c
Executable file → Normal file
12
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,8 +20,11 @@
|
||||
*
|
||||
* \brief Skeleton application
|
||||
*
|
||||
* This is a skeleton for development of an Asterisk application
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@@ -50,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 }
|
||||
@@ -74,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;
|
||||
}
|
||||
|
||||
@@ -90,10 +92,10 @@ static int app_exec(struct ast_channel *chan, void *data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((argc = ast_separate_app_args(args, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
|
||||
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))
|
||||
|
45
apps/app_sms.c
Executable file → Normal file
45
apps/app_sms.c
Executable file → Normal file
@@ -17,17 +17,19 @@
|
||||
/*! \file
|
||||
*
|
||||
* \brief SMS application - ETSI ES 201 912 protocol 1 implimentation
|
||||
* \ingroup applications
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -66,8 +68,7 @@ static char *synopsis = "Communicates with SMS service centres and SMS capable a
|
||||
|
||||
static char *descrip =
|
||||
" SMS(name|[a][s]): SMS handles exchange of SMS data with a call to/from SMS capabale\n"
|
||||
"phone or SMS PSTN service centre. Can send and/or receive SMS messages.\n"
|
||||
"Returns 0 if call handled correctly, or -1 if there were any problems.\n"
|
||||
"phone or SMS PSTN service center. Can send and/or receive SMS messages.\n"
|
||||
"Works to ETSI ES 201 912 compatible with BT SMS PSTN service in UK\n"
|
||||
"Typical usage is to use to handle called from the SMS service centre CLI,\n"
|
||||
"or to set up a call using 'outgoing' or manager interface to connect\n"
|
||||
@@ -693,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;
|
||||
@@ -1177,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;
|
||||
@@ -1205,8 +1205,7 @@ static int sms_generate (struct ast_channel *chan, void *data, int len, int samp
|
||||
f.datalen = samples * 2;
|
||||
#endif
|
||||
f.offset = AST_FRIENDLY_OFFSET;
|
||||
f.mallocd = 0;
|
||||
f.data = buf;
|
||||
f.data = buf + AST_FRIENDLY_OFFSET;
|
||||
f.samples = samples;
|
||||
f.src = "app_sms";
|
||||
/* create a buffer containing the digital sms pattern */
|
||||
@@ -1378,8 +1377,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");
|
||||
@@ -1448,7 +1447,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)
|
||||
|
9
apps/app_softhangup.c
Executable file → Normal file
9
apps/app_softhangup.c
Executable file → Normal file
@@ -20,12 +20,14 @@
|
||||
*
|
||||
* \brief SoftHangup application
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
@@ -43,7 +45,8 @@ static char *synopsis = "Soft Hangup Application";
|
||||
static char *tdesc = "Hangs up the requested channel";
|
||||
|
||||
static char *desc = " SoftHangup(Technology/resource|options)\n"
|
||||
"Hangs up the requested channel. Always returns 0\n"
|
||||
"Hangs up the requested channel. If there are no channels to hangup,\n"
|
||||
"the application will report it.\n"
|
||||
"- 'options' may contain the following letter:\n"
|
||||
" 'a' : hang up all channels on a specified device instead of a single resource\n";
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user