Compare commits

...

250 Commits

Author SHA1 Message Date
Kevin P. Fleming
6e20552bca Convert all release tags to Opsound music-on-hold.
For more details:
http://blogs.digium.com/2009/08/18/asterisk-music-on-hold-changes/



git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.0.4@212958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-18 20:42:51 +00:00
Kevin P. Fleming
f09fbd398e remove extraneous svn:executable properties
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.0.4@7221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29 18:24:39 +00:00
Kevin P. Fleming
517518809a remove remaining .cvsignore files
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.0.4@7220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29 18:09:49 +00:00
Kevin P. Fleming
b4cd946ef0 automatic tag renames
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.0.4@7201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-27 17:18:34 +00:00
Admin Commit
59286cfbc1 This commit was manufactured by cvs2svn to create tag 'v1-0-4'.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/v1-0-4@4850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-20 04:02:58 +00:00
Mark Spencer
1700f24dd3 Strip mp3 id3 headers (bug #2525)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-27 20:04:00 +00:00
James Golovich
aa2e435d82 Remove duplicate sys/socket.h include from res_agi.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-27 14:54:07 +00:00
James Golovich
2fc5fed79e Fix 2 memory leaks
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-27 05:06:22 +00:00
Russell Bryant
efd42d2d5c make pick-up extension configurable. update ChangeLog
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-26 20:47:01 +00:00
Mark Spencer
2ff6a84a16 Hold peerl lock while updating autocreatepeer stuff
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-26 20:42:03 +00:00
James Golovich
01c0938ddf Fix inband priindication checking in chan_zap.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-26 18:16:06 +00:00
Russell Bryant
fda8fa2367 add includes in res_agi.c to fix BSD compatibility
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-26 17:01:39 +00:00
James Golovich
998ef5948c Fix typo in cdr.txt (bug 2510)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-26 16:39:11 +00:00
Russell Bryant
cbc39f7d71 tweak the queues.conf.sample
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-26 02:31:13 +00:00
Mark Spencer
802a44a15b Fix for "show applications like" (bug #2501)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-25 22:42:17 +00:00
Mark Spencer
efbb88225c Fix URL for Tony
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-25 22:38:52 +00:00
Mark Spencer
30d264ebda Add Asterlink/anthm to the CREDITS list
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-25 21:36:01 +00:00
Mark Spencer
bf4ca23372 Make holdtime announcement say "less than 2 minutes" instead of "1 minutes" (bug #2500)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-25 14:22:27 +00:00
Anthony Minessale II
9ecfd9f33e fix polish stuff in say.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-24 22:15:43 +00:00
Anthony Minessale II
255ce93616 add app_forkcdr
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-24 21:33:48 +00:00
Mark Spencer
4ffa6c246f If no RTP stream is up, always request digits (bug #2492)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-24 19:21:24 +00:00
Mark Spencer
a9db074776 Make olle happy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-24 16:49:00 +00:00
Mark Spencer
7b10240bc3 Document hints in extensions.conf.sample (Astricon suggestion)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-24 16:41:45 +00:00
James Golovich
9812bcc03c Include sys/socket.h in res/res_agi.c (bug 2490)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-23 18:10:46 +00:00
James Golovich
fb6e840213 Fix formatting again
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-23 16:58:09 +00:00
Anthony Minessale II
2a896e5d3c tweak prior commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-23 16:39:33 +00:00
James Golovich
ab67420c37 Fix formatting
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-23 16:02:10 +00:00
Anthony Minessale II
07a6cd4592 allow file arg in ast_control_streamfile to accept trailing :end to indicate an instant seek ti the end.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-23 15:26:01 +00:00
Anthony Minessale II
762cd4621d ast_control_streamfile caused seg with null stop or pause chars
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-23 14:46:09 +00:00
Mark Spencer
a23534c4e2 Update Changelog
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-23 11:30:08 +00:00
Mark Spencer
1597114535 Implement Fast AGI (agi://) over TCP socket (Astricon talk idea)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-22 15:21:36 +00:00
Mark Spencer
aea667c7c8 Fix originate success/failure formatting (bug #2485)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-22 14:11:44 +00:00
Mark Spencer
e0f335a4eb Check to be sure # of samples is > 0...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-22 12:15:00 +00:00
Mark Spencer
78531a0f32 Handle arbitrary long dial sequences (like what we need at Astricon)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-22 05:19:06 +00:00
Mark Spencer
a2297d6776 Support colors in eterm
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-22 05:10:50 +00:00
Jeremy McNamara
ef889d6672 support early media/intercept Bug #562
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3815 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-21 18:42:37 +00:00
Jeremy McNamara
291ce3e839 Add a bit more newbie protection
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-21 15:52:42 +00:00
Anthony Minessale II
42806dc1ac fix placement of f->fmt->close
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3813 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-20 23:15:49 +00:00
Mark Spencer
45a157ec0e Fixup vm user struct (bug #2472)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-20 21:16:00 +00:00
James Golovich
49389bd690 Remove duplicate plus.gsm from sounds.txt
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3811 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-20 15:47:40 +00:00
Mark Spencer
a638a19ea2 Don't register auth against something that isn't a register (bug #2468)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-19 17:21:26 +00:00
Jeremy McNamara
199ec4356a protect against seg on busy systems. Bug #2249
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-19 16:53:01 +00:00
Mark Spencer
5dad6f4319 Merge UK + DTMF Caller*ID stuff and fix app_test description
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-19 16:17:18 +00:00
Mark Spencer
27e4a2ee57 Minor fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-18 23:39:39 +00:00
Mark Spencer
d7fb7e9ed7 Add "TrySystem" variation to System (bug #768)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-18 14:14:15 +00:00
Mark Spencer
528cf89739 Clarify descriptions of VM functions moved to app (bug #2463)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-18 14:01:35 +00:00
Mark Spencer
b96abb803c LPC fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-18 13:56:28 +00:00
Mark Spencer
574d3785ab Add extra checks for keys and convenience encrypt/decrypt functions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-18 03:59:51 +00:00
Mark Spencer
d1be79cce2 If singlepath=yes, don't send multiple RTP streams during transfer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-17 20:08:40 +00:00
Mark Spencer
9d8c71ee86 Move routines from voicemail to app for general use (part of bug #752)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-17 15:05:29 +00:00
James Golovich
877f1f64c2 Cleanup code. Spacing issues, nested if issues, lots of strlen used instead of ast_strlen_zero
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3800 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-17 14:15:11 +00:00
James Golovich
a9f5393bfe Make chan_iax2.c compile again on older gcc. Remember definitions must come first
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-17 13:58:38 +00:00
Mark Spencer
038cd054ae Merge steven davie's IAX2 jitterbuffer fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-17 12:45:03 +00:00
Mark Spencer
e228c88d2a Merge anthm's monitor patch with minor mods (bug #2383)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-17 03:49:57 +00:00
Ben Kramer
4824ee8b20 / fixed slight typo/cut-n-paste bug
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-17 00:34:51 +00:00
Ben Kramer
0da1f7593d / fixed operation with record_play
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-17 00:14:48 +00:00
Mark Spencer
8fae88d368 Use compression on "make update"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-16 18:46:39 +00:00
Mark Spencer
5c32080a0c Get rid of compile warnings
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-16 18:45:34 +00:00
Mark Spencer
610d52b054 Add IAX2/SIP register events to system (bug #2117)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-16 16:18:53 +00:00
Mark Spencer
0aa4c95a89 Fix tiny typo (bug #2455)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-16 12:53:10 +00:00
Mark Spencer
d2385517ac Fix sample macro
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-16 00:19:01 +00:00
Mark Spencer
3fc2609468 Fix app_disa to not ignore ignorepat :) (bug #2451)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 22:06:30 +00:00
Mark Spencer
0eec8c8318 Make ADSI in voicemail configurable (bug #2209)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 19:54:46 +00:00
Mark Spencer
bdc00dae0e Merge ADSI parking announcement (bug #2211)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 19:49:33 +00:00
Mark Spencer
a1442538b5 Update mp3 copyright header, fix pedantic + register in SIP (bug #2422)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 19:27:23 +00:00
Mark Spencer
ce68497243 First pass at LPC10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 18:40:07 +00:00
Mark Spencer
9a387e5a7a Queue congestion on REJECT (bug #2448)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 17:31:37 +00:00
Mark Spencer
c4aa1dadbd Use file that is in Asterisk rather than asterisk-sounds (bug #2445)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 14:12:45 +00:00
Mark Spencer
556f27ecf1 Fix extraneous message when using mysql friends
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3782 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 13:16:56 +00:00
Mark Spencer
ef2cd744cf Support both MySQL and traditional mailboxes in vmail.cgi (bug #2297)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 05:11:41 +00:00
Mark Spencer
f5b1c6c27e Update astgenkey to make empty ones too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 04:19:58 +00:00
Mark Spencer
5f93d06cf8 Oops, fix small typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-15 00:43:13 +00:00
Mark Spencer
952a5e6dd9 Consider both tags as possible matches (bug #2422)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-14 23:04:39 +00:00
Mark Spencer
238b9d24c6 Make sure patterns are always last (bug #2435)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-14 22:35:53 +00:00
Mark Spencer
7457c51bc2 Add status for async manager originate (including ActionID) (bug #2434)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-14 22:15:50 +00:00
Mark Spencer
a4437b1362 Inband notifies always succeed (bug #2420)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-14 12:36:14 +00:00
Mark Spencer
45b91a90e1 Add pulse dial support
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-13 23:07:50 +00:00
Mark Spencer
3cb1d7843b Bring sanity to inband notification on PRI
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-13 22:14:34 +00:00
Mark Spencer
4d6b943ea4 Fix star 80 to star 60 (bug #2247)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-13 21:34:47 +00:00
Mark Spencer
d8aff59a9e Add set debug option, make output for set verbose better (bug #2428)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-13 18:19:15 +00:00
Mark Spencer
e9dbd238c8 Work with globals too (bug #2427)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-13 12:32:04 +00:00
Mark Spencer
89447a99ec Use fromdomain in creating callid if specified (bug #2427)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-13 12:24:38 +00:00
Jim Dixon
e499028440 Fixed minor issue in app_rpt(). Allows it to work better with many Linux distributions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-13 12:12:17 +00:00
Mark Spencer
2f82498995 Don't forget to return something other than -1 on the first pass if appropriate!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-12 15:29:56 +00:00
Mark Spencer
71df4d92da Automatically send proper signal on iax switch following dial (bug #2420)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-12 15:05:37 +00:00
Mark Spencer
ac1e884328 Improve initial poking behavior (bug #2419)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-11 13:50:26 +00:00
Mark Spencer
e31d4ee777 Don't set guardtime if channel is only reserved (bug #2421)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-11 13:37:36 +00:00
Mark Spencer
cc30079edd Use longer timeout if using http (bug #2418)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-11 13:31:04 +00:00
Mark Spencer
b76252d68e Add readme for variable (bug #2409)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-11 13:25:15 +00:00
Mark Spencer
ce868ed5f5 Do the same thing for pri_hangup_all in terms of releasing the PRI lock
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-10 18:58:05 +00:00
Mark Spencer
8283811633 Make sure we don't try to grab the sub and channel locks while still having the PRI lock! (bug #2392)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-10 18:47:13 +00:00
Mark Spencer
00f227a684 Properly lock management stuff (bug #2406)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-10 15:11:38 +00:00
Mark Spencer
a6e748e491 Handle macros in the CDR properly (bug #2414)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-10 13:40:56 +00:00
Matthew Fredrickson
8a12240f73 macro support in the dial command
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-10 02:31:30 +00:00
Mark Spencer
815318b12f Handle both pre- and post- whitespace if pedantic checking is on (bug #2411)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-10 02:03:05 +00:00
Mark Spencer
5e0b84633e Make ${CALLINGPRES} available (bug #2409)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-09 20:05:57 +00:00
Mark Spencer
aa2a8ed77c Only pool CONGESTION if there is an owner in the case of a 501
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3754 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-09 15:40:07 +00:00
Mark Spencer
9e96cb612b Fix GotoIf logging level (bug #2396)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-09 13:00:21 +00:00
Mark Spencer
f54c287c73 Make GetVar respect ActionID (bug #2404/2405)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3752 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-09 12:50:56 +00:00
Mark Spencer
14e1fe4795 Make sure rtp->f.data is initialized properly for 3389 (asterisk dev mailing list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-09 02:33:14 +00:00
Mark Spencer
81df8343d3 Only accept first callerid number (bug #2395)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-09 02:29:10 +00:00
Mark Spencer
388ca07547 Use noncodec capability when masking (bug #2394)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-09 02:07:26 +00:00
Mark Spencer
b3fdacf9cc Minor formatting fixup (bug #2397)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-09 01:36:01 +00:00
Mark Spencer
cb896da998 Don't consider RTP timeout if the channel isn't up
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-09 01:33:17 +00:00
Mark Spencer
879c401544 Add option to register extensions on IAX or SIP registration
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 23:45:34 +00:00
Matthew Fredrickson
c6025e41c6 bug fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 15:18:14 +00:00
Matthew Fredrickson
52647db120 Changes from Dimitri for OSP codes, minor buglets
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 15:16:18 +00:00
James Golovich
5adfdcba1e Change recent patch to not use a hard coded path inside of a .c file
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 15:02:53 +00:00
James Golovich
550e8e56ba Formatting cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 15:01:48 +00:00
James Golovich
8d457d07c4 Formatting cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 14:51:20 +00:00
Mark Spencer
b3333ebc2e Don't attempt to qualify before we have a socket (bug #2331)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 14:40:34 +00:00
Mark Spencer
3454b5927f Make background support a language override (bug #2378)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3739 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 14:37:35 +00:00
James Golovich
54e81f5ca0 Formatting cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 14:36:56 +00:00
Mark Spencer
c1e14143fa Upgrade firmware to version 19 (improved timestamps from bug #2370), extra protetions for buck boost Q7.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 02:09:08 +00:00
Mark Spencer
97904aee06 Turn on usecallerid if distinctiveringdetection is on (bug #2389)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 01:56:18 +00:00
Mark Spencer
24e902d2a4 Merge anthm's "-t" flag (with minor mods) (bug #2380)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 01:49:08 +00:00
Mark Spencer
0da197d593 Compute power of 10 using ints instead of silly floats (bug #2390)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 01:28:52 +00:00
Mark Spencer
6b2e3f29f9 Consider service unavailable as CONGESTION (bug #2391)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 01:25:18 +00:00
Mark Spencer
64b9a563f2 Make menu interruptible (bug #2377), Also fix PBX "add extension" CLI (bug #2289)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-07 01:22:57 +00:00
Mark Spencer
a703e927b1 Add Czech digit/voicemail support
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-06 15:43:43 +00:00
Mark Spencer
8d0d386970 Use stdlib.h instead of alloca.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-06 15:29:41 +00:00
Mark Spencer
dc542971df Allow "-" in password to make it unchangable (bug #2386)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3729 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-06 06:19:17 +00:00
Mark Spencer
8fb1ddeb5d Don't prompt for password if one is not needed (bug #2385)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-05 19:38:17 +00:00
Mark Spencer
e94fa076cb Fix some small voicemail password bugs (bug #2373)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-05 18:31:50 +00:00
Mark Spencer
f83715ce9c Add Anthony's format_sln (bug #2381)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-05 18:00:55 +00:00
Mark Spencer
b0970b9e33 Merge Brian West's append hostname patch (bug #2372)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-05 03:48:05 +00:00
Mark Spencer
f4b60a5c65 Turn off the hook detection unless explicitly compiled in
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-04 15:00:05 +00:00
Mark Spencer
e7908a50e8 Add stream support and permit minimum respawn time (bug #2254)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-04 05:41:01 +00:00
Mark Spencer
789c4f4587 If nativeformats changes, recalculate formats (bug #2224)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-04 01:06:42 +00:00
Mark Spencer
19be63c4c3 Treat 400 response as "CONGESTION" (bug #2369)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-04 00:29:00 +00:00
Mark Spencer
04a9441769 Fix escaping ; (bug #2368)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-03 15:36:13 +00:00
Mark Spencer
a2da1f08bd Make sure shell version happens even if MySQL mailboxes are there (bug #2367)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-03 15:25:11 +00:00
Mark Spencer
eb57ea95d6 reload documentation, don't display res in app_test...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-03 14:02:12 +00:00
Mark Spencer
1e2db0e885 Allow external program to be used to change password (bug #2357)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-03 03:53:48 +00:00
Mark Spencer
d77ae42896 Display elapsed time in hours/mins/seconds (bug #2365 kinda sorta)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-03 03:44:35 +00:00
Mark Spencer
2a2d65541b Use exitcontext when available (bug #2363)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3715 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-03 03:26:29 +00:00
Mark Spencer
fd7577eed2 Don't try to look offhook with channel banks & Loopstart (bug #2362), also make individual modules reloadable...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 20:45:24 +00:00
Mark Spencer
93818c761b If '#' is sent for username, use callerid if available (bug #2301)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 19:18:35 +00:00
Mark Spencer
bc72d7584a Don't use FXO's with no battery (bug #2359)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 19:07:24 +00:00
Mark Spencer
b813a5f3fa Fix both app_read and underlying read issue (bug #2352)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 13:52:58 +00:00
Mark Spencer
d952c7ed71 Fix "duplicate answer" issue (bug #2342)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 13:48:11 +00:00
Mark Spencer
07166e63a3 Improve voicemail verbosity (bug #2351)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 04:57:37 +00:00
Mark Spencer
9888487f9c Fix minor typo (bug #2343)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 04:07:28 +00:00
Mark Spencer
3c7ab1ca5e Eliminate unnecessary historic "rm" commands from Makefile (bug #2349)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 03:34:12 +00:00
Mark Spencer
08a8632ac7 Decrease use count in wav_gsm (bug #2350)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 03:33:09 +00:00
Mark Spencer
4b2877834e Fix threeway calling + immediate mode (bug #2344)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-02 03:32:07 +00:00
Mark Spencer
344ec00439 Add additional timeout debugging information on parking
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-01 19:51:19 +00:00
Mark Spencer
082f628401 Slightly more verbose detail on PBX startup (bug #2339)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-01 18:29:43 +00:00
Mark Spencer
3cf360ae44 Fix teeny typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-09-01 02:28:38 +00:00
Mark Spencer
0c39d6de8e Grab each lock individually...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 21:55:19 +00:00
Mark Spencer
53262335c8 Add documentation for new courtesy tone (bug #2329)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 19:19:05 +00:00
Jeremy McNamara
380b9a40a3 nit picky fixups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 17:50:41 +00:00
Jeremy McNamara
f6109b7b94 add exten example. Thanks ManxPower
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 17:38:41 +00:00
Mark Spencer
1db964ad95 When queueing frames, it's pointless to queue a frame after a HANGUP frame is queued...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 17:30:46 +00:00
Mark Spencer
416079db61 Some need bigger registery
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 17:17:00 +00:00
Mark Spencer
49ca05642a Use "fullcontact" on outbound calls too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 17:12:09 +00:00
Mark Spencer
7d88098555 Use Contact for URI if supplied...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 16:49:20 +00:00
Mark Spencer
82db278716 More Asterisk sparc patches (courtesy Belgarath)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 16:33:00 +00:00
Mark Spencer
cfb711bf57 Make app_festival change more portable, allow '*' for context in iax2
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 14:59:58 +00:00
Mark Spencer
471df8f512 Be sure to do ntohl before considering extended field
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 14:03:18 +00:00
Mark Spencer
9f1562a599 Minor SIP cleanup for poking on startup (bug #2331)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 13:49:18 +00:00
Mark Spencer
e2fe8ef485 Permit in-band and out-of-band Busy/Congestion (bug #2325)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 13:47:23 +00:00
Mark Spencer
4a19a2644f Don't redefine _THREAD_SAFE (bug #2332)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 13:39:04 +00:00
Mark Spencer
066a53df8a Fix permissions for festival app (bug #2334)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 13:37:30 +00:00
Mark Spencer
2a108b9b06 Merge NetBSD and Courtesty tone with modifications (bug #2329)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 13:32:11 +00:00
Mark Spencer
6749f1b8b5 Be sure we still check for proper buffer length
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 05:09:20 +00:00
Mark Spencer
8ff9c0d1b9 Adjust Makefiles to support Ultrasparc architecture (thanks Belgarath) (bug #2319)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 03:31:59 +00:00
Mark Spencer
b48987922c First pass at handling RTP header extension bit
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 00:16:28 +00:00
Mark Spencer
5259155e52 Make sure we behave properly for parking (bug #2292)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-31 00:08:52 +00:00
Mark Spencer
2f753040ef Revert back to 16 so keys are displayed properly (bug #2240)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-30 05:27:51 +00:00
Mark Spencer
bd7ca6bb69 Track extra parameters in contact (bug #732)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-30 05:21:34 +00:00
Mark Spencer
0f88c702df Look for feature group D on all E&M Wink Lines (bug #2228)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-30 05:07:27 +00:00
Mark Spencer
28e5320ab4 Minor fix in directory app (bug #2322)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-30 01:44:41 +00:00
Mark Spencer
47f8883942 Add test application (TestClient/TestServer), thanks Russell!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-30 01:43:41 +00:00
Mark Spencer
4c133e47da Set DTMF modes by peer/user properly (bug #2303)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-29 18:58:30 +00:00
Mark Spencer
0cf6b2ba31 Minor Makefile cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-29 17:40:58 +00:00
Mark Spencer
7fffa6e20a Make the polish speech not such an insane coding style
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-29 17:23:54 +00:00
Mark Spencer
ccdd86775f Don't use "class" keyword in music on hold (bug #2316)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-29 06:09:29 +00:00
Mark Spencer
91d2e58d1b Update DISA to be internationalized (bug #2284)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-28 19:41:18 +00:00
Mark Spencer
1327846518 Oops, back out bad makefile change
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-28 17:34:40 +00:00
Mark Spencer
11b1e81197 Major DISA improvements (bug #2284)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-28 17:33:43 +00:00
Mark Spencer
616780b64e Warn if unable to open an overridden config file (but #2285)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-28 17:12:01 +00:00
Mark Spencer
90a497c3b8 Fix generator for VAD as well as for automatically syncing to incoming signal if present (bug #2312)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-27 22:53:56 +00:00
Mark Spencer
de1d9a90dd Fix nat registration (bug #2315)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-27 20:19:14 +00:00
Mark Spencer
516cd1ba8d Be sure errors on wite are passed back up (bug #2311)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3666 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-27 16:17:16 +00:00
Mark Spencer
c7541bd672 Merge "show applications" from corydon76 (bug #2291)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-27 04:21:09 +00:00
Mark Spencer
c3c13114fb Merge mochouinard's meetme fixups (bug #2230)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3664 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-27 04:12:55 +00:00
Mark Spencer
2863202bed Run generators from zap timers when available so as to interop with VAD
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-27 03:28:32 +00:00
Mark Spencer
cab4557006 When detecting a hairpin, redirect to the appropriate local extension (bug #1974)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-27 03:16:16 +00:00
Mark Spencer
f1be7d7ffc Add new "route" mode to work around UNIDEN bugs (bug #2308)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-27 02:45:35 +00:00
Mark Spencer
c22fdb7232 Include UniqueId in rename events... (bug #2306)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-26 22:45:26 +00:00
Mark Spencer
bd1c5ac3cf Fix directory name in SMS (bug #2307)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3659 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-26 21:28:42 +00:00
Mark Spencer
fa814abe05 Repair offer/answer model (bug #2293), initial CNG work for new frametype
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-26 04:56:26 +00:00
Anthony Minessale II
03cd30b746 fixed a use count bug
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-25 18:30:51 +00:00
Anthony Minessale II
7ede296efd fix a bug in some small changes to astxs utility
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-25 18:20:49 +00:00
Malcolm Davenport
264fead207 Fixed??
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-25 14:14:57 +00:00
Malcolm Davenport
e5ad308a2b Still..
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-25 14:08:51 +00:00
Malcolm Davenport
f31a210cb2 Still working to resolve this...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-25 14:05:35 +00:00
Mark Spencer
b27c9f26fe Document caveats of promiscredir (bug #2195)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-25 06:25:18 +00:00
Anthony Minessale II
0ffa958fc4 some small changes to astxs utility
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-25 02:41:38 +00:00
Malcolm Davenport
e8483c021b Still trying...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 22:34:38 +00:00
Malcolm Davenport
5596c6a5da Still more tests
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 22:31:20 +00:00
Malcolm Davenport
0a6f41cdf2 More tests for asterisk-cvs@lists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 22:28:59 +00:00
Malcolm Davenport
4219bdc2b4 More updates to test lists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 21:26:19 +00:00
Malcolm Davenport
fa9c265ce7 More attempts to fix lists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 21:09:05 +00:00
Malcolm Davenport
6d447004ea More attempts to fix lists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 21:06:57 +00:00
Malcolm Davenport
091c6c36b9 Still testing asterisk-cvs@lists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 21:00:25 +00:00
Malcolm Davenport
1f34a1dab4 Silly update to see if asterisk-cvs@lists is still borked
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 20:41:49 +00:00
Malcolm Davenport
ba55e8ae64 Silly change to see if asterisk-cvs@lists is working...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 20:29:55 +00:00
Malcolm Davenport
461596d9b1 Testing to see if asterisk-cvs@lists is still borked
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 20:15:34 +00:00
Malcolm Davenport
0e3fc6a4fe Still testing asterisk-cvs@lists...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 17:49:30 +00:00
Malcolm Davenport
6a589d5630 Still trying to debug the asterisk-cvs@lists problem :(
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 17:44:48 +00:00
Malcolm Davenport
b8c18d6176 Test "fix" to see what's wrong w/ asterisk-cvs@lists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-24 17:34:54 +00:00
Anthony Minessale II
4210fd6ad9 make bug 2272 (which is actually caused by human error) less likely to happen
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-23 19:07:15 +00:00
Mark Spencer
1ddd0afe36 Make the guardtime work even if the date is < the year 1970, and if something weird happens in zap, don't stack overflow
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-23 17:37:24 +00:00
Mark Spencer
230d4b38a3 Qualify rtptimeout with a reinvite having taken place (bug #2286)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-23 14:31:20 +00:00
Mark Spencer
1afd98d916 Handle quoted <'s (bug #2223)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-23 14:16:25 +00:00
Mark Spencer
60707a4172 Fix sigchld handling (bug #2245)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-22 18:33:19 +00:00
Jim Dixon
f2dcfca9c4 Fixed timing race with thread creation in app_rpt.c, and added settable
delays and such in config file.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-22 03:58:42 +00:00
Jim Dixon
d8436708c0 Made some what turned out to be several changes to allow for radio channels
to be handled properly in the case of an Alarm state on their span.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-21 21:41:54 +00:00
Mark Spencer
de3528f0be Save CID and switches in "save dialplan" command (bug #2279)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-21 18:55:39 +00:00
Mark Spencer
d0ab0358aa Fix small memory leak... (bug #2277)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-21 18:49:52 +00:00
Mark Spencer
4f9f6df42c Don't split unless it's got echo training
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-20 21:07:10 +00:00
Ben Kramer
ed20af4517 / check so as not to enable loo-drop on FXS
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-20 02:55:29 +00:00
Mark Spencer
3ca96a1317 Fix divide by zero (bugs #2268 and 2259)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-19 18:52:56 +00:00
Ben Kramer
3bcff2d2f9 / bit of a clean up and change of pthread_create to ast_pthread_create
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-18 23:58:07 +00:00
Malcolm Davenport
3e85e4b82c Add README.mp3 to docs to clear up confusion about working and
non-working versions of mpg123


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-18 14:27:25 +00:00
Mark Spencer
299b26ae4a Remove unused tmp2 variable
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-18 14:13:35 +00:00
Mark Spencer
bbbbcaf73f Make sure jointcapability really indicates joint capability (bug #2210)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-18 13:55:03 +00:00
Ben Kramer
37e789fd79 / lots of fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-18 05:06:26 +00:00
Mark Spencer
27f3c530ed Fix sample config typo (bug #2263)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-18 02:16:48 +00:00
Mark Spencer
534e44c599 Add another field to track whether video was invited or not (bug #2226)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-18 02:16:04 +00:00
Mark Spencer
1587fd6b84 Fix port numbers in IAX2 and iax2prov (bug #2261)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-17 23:57:36 +00:00
Mark Spencer
ce51451ca6 Fix minor typos (bug #2260)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-17 23:53:15 +00:00
Mark Spencer
3385ecc112 Can't check incoming sip debug until after we receive the packet!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-17 14:26:25 +00:00
Mark Spencer
5d589eb866 Fix broken 100 Trying on REFER and also send NOTIFY as per RFC 3515
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3615 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-17 14:20:43 +00:00
Mark Spencer
039aad9ff4 Merge Lenny's sorcery....
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3614 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-17 01:57:16 +00:00
Mark Spencer
a0b8879af4 Add little note about hold music
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-16 17:43:48 +00:00
Mark Spencer
e1c9ebc5b9 Merge MOG's first serious patch (new message patch) (bug #2071)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-16 04:05:43 +00:00
Mark Spencer
02ffc0eec8 Fix trivial typo (bug #2253)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-16 01:57:10 +00:00
Jim Dixon
a560227ccb Fixed remote base audio problem (where 2 different interfaces are in use) and
allow for non-rbi remotes and rbi remotes to co-exist on same system


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-16 01:35:02 +00:00
Mark Spencer
87a7a3aaff Fix little oops on sizeof()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-15 01:01:34 +00:00
Mark Spencer
6723ea3afb Oops, forgot message length
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-14 21:28:30 +00:00
Mark Spencer
3ff53cd50b Create binary versions of signature functions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-14 20:19:38 +00:00
Mark Spencer
94f18868f1 Build on older versions of TDS (bug #2194)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-13 20:27:58 +00:00
Mark Spencer
e85d440f88 Don't request tones when in-band DTMF mode is enabled (bug #2248)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-13 13:19:29 +00:00
Mark Spencer
6910fd79f2 Fix missing \r\n
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-12 23:12:44 +00:00
Mark Spencer
c14b405974 Make Asterisk cause codes match those of Q.931 (bug #1999)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-12 22:09:18 +00:00
Mark Spencer
0125ed120f Specify D/ package in mgcp send digit routine (first commit from Adtran!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-12 20:26:40 +00:00
Mark Spencer
be2d39a1a5 Fix duplex code for FreeBSD
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2004-08-12 03:19:19 +00:00
961 changed files with 8099 additions and 3930 deletions

View File

@@ -1,6 +0,0 @@
asterisk
build.h
ast_expr.c
.version
.depend
.applied

0
BUGS Executable file → Normal file
View File

63
CHANGES Executable file → Normal file
View File

@@ -1,3 +1,66 @@
NOTE: Corrections or additions to the ChangeLog may be submitted
to http://bugs.digium.com. A complete listing of changes
is available through the Asterisk-CVS mailing list hosted
at http://lists.digium.com.
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

8
CREDITS Executable file → Normal file
View File

@@ -5,6 +5,8 @@ Asterisk:
Pilosoft, Inc. - for supporting ADSI development in Asterisk
Asterlink, Inc. - for supporting broad Asterisk development
GFS - for supporting ALSA development
Telesthetic - for supporting SIP development
@@ -24,6 +26,8 @@ Wasim - Hangup detect
PhoneJack and Linejack card to the project. (http://www.quicknet.net)
=== MISCELLANEOUS PATCHES ===
Anthony Minessale - Countless big and small fixes, and relentless forward push
anthmct@yahoo.com http://www.asterlink.com
James Golovich - Innumerable contributions
You can find him and asterisk-perl at http://asterisk.gnuinter.net
Andre Bierwirth - Extension hints and status
@@ -54,12 +58,14 @@ Thorsten Lockert - OpenBSD, FreeBSD ports, making MacOS X port run on 10.3,
bugs. tholo@sigmasoft.com
Brian West - ODBC support and Bug Marshaling
William Waites - syslog support, SIP NAT traversal for SIP-UA. ww@styx.org
Rich Murphey - Porting to FreeBSD, NetBSD, OpenBSD, and Darwin.
rich@whiteoaklabs.com http://whiteoaklabs.com
=== OTHER CONTRIBUTIONS ===
John Todd - Monkey sounds and associated teletorture prompt
=== HOLD MUSIC ===
Music provided by www.freeplaymusic.com
Music provided by www.opsound.org
=== OTHER SOURCE CODE IN ASTERISK ===

0
HARDWARE Executable file → Normal file
View File

0
LICENSE Executable file → Normal file
View File

41
Makefile Executable file → Normal file
View File

@@ -26,6 +26,18 @@ PROC=k8
#PROC=athlon
OPTIONS+=-m64
endif
ifeq ($(PROC),sparc64)
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
#This works for even old (2.96) versions of gcc and provides a small boost either way.
#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
#So we go lowest common available by gcc and go a step down, still a step up from
#the default as we now have a better instruction set to work with. - Belgarath
PROC=ultrasparc
OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v8"; fi)
OPTIONS+=-fomit-frame-pointer
endif
endif
ifeq ($(findstring BSD,${OSARCH}),BSD)
@@ -50,7 +62,7 @@ PWD=$(shell pwd)
#K6OPT = -DK6OPT
#Tell gcc to optimize the asterisk's code
OPTIMIZE=-O6
OPTIMIZE+=-O6
#Include debug symbols in the executables (-g) and profiling info (-pg)
DEBUG=-g #-pg
@@ -116,18 +128,27 @@ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
INCLUDE=-Iinclude -I../include
CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
CFLAGS+=$(OPTIMIZE)
ifneq ($(PROC),ultrasparc)
CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
endif
CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
ifeq (${OSARCH},FreeBSD)
OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
CFLAGS+=$(if ${OSVERSION}<500016,-D_THREAD_SAFE)
LIBS+=$(if ${OSVERSION}<502102,-lc_r,-pthread)
CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
INCLUDE+=-I/usr/local/include
CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
endif # FreeBSD
ifeq (${OSARCH},NetBSD)
CFLAGS+=-pthread
INCLUDE+=-I/usr/local/include -I/usr/pkg/include
endif
ifeq (${OSARCH},OpenBSD)
CFLAGS+=-pthread
endif
@@ -175,6 +196,9 @@ endif
ifeq (${OSARCH},FreeBSD)
LIBS+=-lcrypto
endif
ifeq (${OSARCH},NetBSD)
LIBS+=-lpthread -lcrypto -lm -L/usr/local/lib -L/usr/pkg/lib -lncurses
endif
ifeq (${OSARCH},OpenBSD)
LIBS=-lcrypto -lpthread -lm -lncurses
endif
@@ -333,7 +357,7 @@ datafiles: all
update:
@if [ -d CVS ]; then \
echo "Updating from CVS..." ; \
cvs -q update -Pd; \
cvs -q -z3 update -Pd; \
rm -f .version; \
else \
echo "Not CVS"; \
@@ -347,6 +371,7 @@ bininstall: all
mkdir -p $(DESTDIR)$(ASTSBINDIR)
mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
@@ -364,13 +389,6 @@ bininstall: all
rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
fi
ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
rm -f $(DESTDIR)$(MODULES_DIR)/chan_ixj.so
rm -f $(DESTDIR)$(MODULES_DIR)/chan_tor.so
rm -f $(DESTDIR)$(MODULES_DIR)/cdr_mysql.so
rm -f $(DESTDIR)$(MODULES_DIR)/cdr_unixodbc.so
rm -f $(DESTDIR)$(MODULES_DIR)/codec_mp3_d.so
rm -f $(DESTDIR)$(MODULES_DIR)/format_mp3.so
rm -f $(DESTDIR)$(MODULES_DIR)/app_voicemail2.so
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
@@ -501,7 +519,6 @@ mpg123:
[ -f mpg123-0.59r.tar.gz ] || wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz
[ -d mpg123-0.59r ] || tar xfz mpg123-0.59r.tar.gz
make -C mpg123-0.59r linux
config:
if [ -d /etc/rc.d/init.d ]; then \

0
README Executable file → Normal file
View File

22
README.opsound Normal file
View 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

0
SECURITY Executable file → Normal file
View File

7
acl.c Executable file → Normal file
View File

@@ -242,20 +242,19 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
memset(&m_rtmsg, 0, sizeof(m_rtmsg));
m_rtmsg.m_rtm.rtm_type = RTM_GET;
m_rtmsg.m_rtm.rtm_flags = RTF_UP | RTF_HOST;
m_rtmsg.m_rtm.rtm_version = RTM_VERSION;
ast_mutex_lock(&routeseq_lock);
seq = ++routeseq;
ast_mutex_unlock(&routeseq_lock);
m_rtmsg.m_rtm.rtm_seq = seq;
m_rtmsg.m_rtm.rtm_addrs = RTA_IFA | RTA_DST;
m_rtmsg.m_rtm.rtm_addrs = RTA_DST | RTA_IFA;
m_rtmsg.m_rtm.rtm_msglen = sizeof(struct rt_msghdr) + sizeof(struct sockaddr_in);
sin = (struct sockaddr_in *)m_rtmsg.m_space;
sin->sin_family = AF_INET;
sin->sin_len = sizeof(struct sockaddr_in);
sin->sin_addr = *them;
if ((s = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) {
if ((s = socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC)) < 0) {
ast_log(LOG_ERROR, "Error opening routing socket\n");
return -1;
}
@@ -268,7 +267,7 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
}
do {
l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg));
} while (l > 0 && (m_rtmsg.m_rtm.rtm_seq != 1 || m_rtmsg.m_rtm.rtm_pid != pid));
} while (l > 0 && (m_rtmsg.m_rtm.rtm_seq != seq || m_rtmsg.m_rtm.rtm_pid != pid));
if (l < 0) {
if (errno != EAGAIN)
ast_log(LOG_ERROR, "Error reading from routing socket\n");

0
aescrypt.c Executable file → Normal file
View File

0
aeskey.c Executable file → Normal file
View File

2
aesopt.h Executable file → Normal file
View File

@@ -151,7 +151,7 @@
#if defined( __OpenBSD__ )
# include <machine/types.h>
# include <sys/endian.h>
#elif defined( __FreeBSD__ )
#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
# include <sys/types.h>
# include <sys/endian.h>
#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)

0
aestab.c Executable file → Normal file
View File

View File

@@ -1,3 +0,0 @@
eagi-test
eagi-sphinx-test
.depend

0
agi/DialAnMp3.agi Executable file → Normal file
View File

0
agi/Makefile Executable file → Normal file
View File

0
agi/agi-test.agi Executable file → Normal file
View File

0
agi/eagi-sphinx-test.c Executable file → Normal file
View File

0
agi/eagi-test.c Executable file → Normal file
View File

94
agi/fastagi-test Normal file
View File

@@ -0,0 +1,94 @@
#!/usr/bin/perl
use strict;
use Socket;
use Carp;
use IO::Handle;
my $port = 4573;
$|=1;
# Setup some variables
my %AGI; my $tests = 0; my $fail = 0; my $pass = 0;
sub checkresult {
my ($res) = @_;
my $retval;
$tests++;
chomp $res;
if ($res =~ /^200/) {
$res =~ /result=(-?\d+)/;
if (!length($1)) {
print STDERR "FAIL ($res)\n";
$fail++;
} else {
print STDERR "PASS ($1)\n";
$pass++;
}
} else {
print STDERR "FAIL (unexpected result '$res')\n";
$fail++;
}
}
socket(SERVER, PF_INET, SOCK_STREAM, 0);
setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, pack("l", 1));
bind(SERVER, sockaddr_in($port, INADDR_ANY)) || die("can't bind\n");
listen(SERVER, SOMAXCONN);
for(;;) {
my $raddr = accept(CLIENT, SERVER);
my ($s, $p) = sockaddr_in($raddr);
CLIENT->autoflush(1);
while(<CLIENT>) {
chomp;
last unless length($_);
if (/^agi_(\w+)\:\s+(.*)$/) {
$AGI{$1} = $2;
}
}
print STDERR "AGI Environment Dump from $s:$p --\n";
foreach my $i (sort keys %AGI) {
print STDERR " -- $i = $AGI{$i}\n";
}
print STDERR "1. Testing 'sendfile'...";
print CLIENT "STREAM FILE beep \"\"\n";
my $result = <CLIENT>;
&checkresult($result);
print STDERR "2. Testing 'sendtext'...";
print CLIENT "SEND TEXT \"hello world\"\n";
my $result = <CLIENT>;
&checkresult($result);
print STDERR "3. Testing 'sendimage'...";
print CLIENT "SEND IMAGE asterisk-image\n";
my $result = <CLIENT>;
&checkresult($result);
print STDERR "4. Testing 'saynumber'...";
print CLIENT "SAY NUMBER 192837465 \"\"\n";
my $result = <CLIENT>;
&checkresult($result);
print STDERR "5. Testing 'waitdtmf'...";
print CLIENT "WAIT FOR DIGIT 1000\n";
my $result = <CLIENT>;
&checkresult($result);
print STDERR "6. Testing 'record'...";
print CLIENT "RECORD FILE testagi gsm 1234 3000\n";
my $result = <CLIENT>;
&checkresult($result);
print STDERR "6a. Testing 'record' playback...";
print CLIENT "STREAM FILE testagi \"\"\n";
my $result = <CLIENT>;
&checkresult($result);
close(CLIENT);
print STDERR "================== Complete ======================\n";
print STDERR "$tests tests completed, $pass passed, $fail failed\n";
print STDERR "==================================================\n";
}

0
agi/numeralize Executable file → Normal file
View File

0
alaw.c Executable file → Normal file
View File

499
app.c Executable file → Normal file
View File

@@ -1,11 +1,11 @@
/*
* Asterisk -- A telephony toolkit for Linux.
*
* Channel Management
* Convenient Application Routines
*
* Copyright (C) 1999, Mark Spencer
* Copyright (C) 1999-2004, Digium, Inc.
*
* Mark Spencer <markster@linux-support.net>
* Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -31,12 +31,16 @@
#include "asterisk.h"
#include "astconf.h"
#define MAX_OTHER_FORMATS 10
/* 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)
{
int res,to,fto;
/* XXX Merge with full version? XXX */
if (maxlen)
s[0] = '\0';
if (prompt) {
res = ast_streamfile(c, prompt, c->language);
if (res < 0)
@@ -411,7 +415,8 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
{
struct timeval started, ended;
long elapsed = 0,last_elapsed =0;
char *breaks;
char *breaks=NULL;
char *end=NULL;
int blen=2;
int res=0;
@@ -420,17 +425,28 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
if (pause)
blen += strlen(pause);
breaks = alloca(blen + 1);
breaks[0] = '\0';
strcat(breaks, stop);
strcat(breaks, pause);
if (blen > 2) {
breaks = alloca(blen + 1);
breaks[0] = '\0';
strcat(breaks, stop);
strcat(breaks, pause);
}
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")) {
*end = '\0';
end++;
}
}
}
for (;;) {
gettimeofday(&started,NULL);
@@ -438,6 +454,10 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
ast_stopstream(chan);
res = ast_streamfile(chan, file, chan->language);
if (!res) {
if (end) {
ast_seekstream(chan->stream, 0, SEEK_END);
end=NULL;
}
res = 1;
if (elapsed) {
ast_stream_fastforward(chan->stream, elapsed);
@@ -459,9 +479,9 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
if (chan)
ast_stopstream(chan);
res = ast_waitfordigit(chan, 1000);
if(res == 0)
if (res == 0)
continue;
else if(res == -1 || strchr(pause, res) || (stop && strchr(stop, res)))
else if (res == -1 || strchr(pause, res) || (stop && strchr(stop, res)))
break;
}
if (res == *pause) {
@@ -483,3 +503,460 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
return res;
}
int ast_play_and_wait(struct ast_channel *chan, char *fn)
{
int d;
d = ast_streamfile(chan, fn, chan->language);
if (d)
return d;
d = ast_waitstream(chan, AST_DIGIT_ANY);
ast_stopstream(chan);
return d;
}
static int global_silence_threshold = 128;
static int global_maxsilence = 0;
int ast_play_and_record(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, char *fmt, int *duration, int silencethreshold, int maxsilence)
{
char d, *fmts;
char comment[256];
int x, fmtcnt=1, res=-1,outmsg=0;
struct ast_frame *f;
struct ast_filestream *others[MAX_OTHER_FORMATS];
char *sfmt[MAX_OTHER_FORMATS];
char *stringp=NULL;
time_t start, end;
struct ast_dsp *sildet; /* silence detector dsp */
int totalsilence = 0;
int dspsilence = 0;
int gotsilence = 0; /* did we timeout for silence? */
int rfmt=0;
if (silencethreshold < 0)
silencethreshold = global_silence_threshold;
if (maxsilence < 0)
maxsilence = global_maxsilence;
/* barf if no pointer passed to store duration in */
if (duration == NULL) {
ast_log(LOG_WARNING, "Error play_and_record called without duration pointer\n");
return -1;
}
ast_log(LOG_DEBUG,"play_and_record: %s, %s, '%s'\n", playfile ? playfile : "<None>", recordfile, fmt);
snprintf(comment,sizeof(comment),"Playing %s, Recording to: %s on %s\n", playfile ? playfile : "<None>", recordfile, chan->name);
if (playfile) {
d = ast_play_and_wait(chan, playfile);
if (d > -1)
d = ast_streamfile(chan, "beep",chan->language);
if (!d)
d = ast_waitstream(chan,"");
if (d < 0)
return -1;
}
fmts = ast_strdupa(fmt);
stringp=fmts;
strsep(&stringp, "|");
ast_log(LOG_DEBUG,"Recording Formats: sfmts=%s\n", fmts);
sfmt[0] = ast_strdupa(fmts);
while((fmt = strsep(&stringp, "|"))) {
if (fmtcnt > MAX_OTHER_FORMATS - 1) {
ast_log(LOG_WARNING, "Please increase MAX_OTHER_FORMATS in app_voicemail.c\n");
break;
}
sfmt[fmtcnt++] = ast_strdupa(fmt);
}
time(&start);
end=start; /* pre-initialize end to be same as start in case we never get into loop */
for (x=0;x<fmtcnt;x++) {
others[x] = ast_writefile(recordfile, sfmt[x], comment, O_TRUNC, 0, 0700);
ast_verbose( VERBOSE_PREFIX_3 "x=%i, open writing: %s format: %s, %p\n", x, recordfile, sfmt[x], others[x]);
if (!others[x]) {
break;
}
}
sildet = ast_dsp_new(); /* Create the silence detector */
if (!sildet) {
ast_log(LOG_WARNING, "Unable to create silence detector :(\n");
return -1;
}
ast_dsp_set_threshold(sildet, silencethreshold);
if (maxsilence > 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");
return -1;
}
}
if (x == fmtcnt) {
/* Loop forever, writing the packets we read to the writer(s), until
we read a # or get a hangup */
f = NULL;
for(;;) {
res = ast_waitfor(chan, 2000);
if (!res) {
ast_log(LOG_DEBUG, "One waitfor failed, trying another\n");
/* Try one more time in case of masq */
res = ast_waitfor(chan, 2000);
if (!res) {
ast_log(LOG_WARNING, "No audio available on %s??\n", chan->name);
res = -1;
}
}
if (res < 0) {
f = NULL;
break;
}
f = ast_read(chan);
if (!f)
break;
if (f->frametype == AST_FRAME_VOICE) {
/* write each format */
for (x=0;x<fmtcnt;x++) {
res = ast_writestream(others[x], f);
}
/* Silence Detection */
if (maxsilence > 0) {
dspsilence = 0;
ast_dsp_silence(sildet, f, &dspsilence);
if (dspsilence)
totalsilence = dspsilence;
else
totalsilence = 0;
if (totalsilence > maxsilence) {
/* Ended happily with silence */
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;
outmsg=2;
break;
}
}
/* Exit on any error */
if (res) {
ast_log(LOG_WARNING, "Error writing frame\n");
ast_frfree(f);
break;
}
} else if (f->frametype == AST_FRAME_VIDEO) {
/* Write only once */
ast_writestream(others[0], f);
} else if (f->frametype == AST_FRAME_DTMF) {
if (f->subclass == '#') {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
res = '#';
outmsg = 2;
ast_frfree(f);
break;
}
}
if (f->subclass == '0') {
/* Check for a '0' during message recording also, in case caller wants operator */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "User cancelled by pressing %c\n", f->subclass);
res = '0';
outmsg = 0;
ast_frfree(f);
break;
}
if (maxtime) {
time(&end);
if (maxtime < (end - start)) {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Took too long, cutting it short...\n");
outmsg = 2;
res = 't';
ast_frfree(f);
break;
}
}
ast_frfree(f);
}
if (end == start) time(&end);
if (!f) {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "User hung up\n");
res = -1;
outmsg=1;
}
} else {
ast_log(LOG_WARNING, "Error creating writestream '%s', format '%s'\n", recordfile, sfmt[x]);
}
*duration = end - start;
for (x=0;x<fmtcnt;x++) {
if (!others[x])
break;
if (res > 0) {
if (totalsilence)
ast_stream_rewind(others[x], totalsilence-200);
else
ast_stream_rewind(others[x], 200);
}
ast_truncstream(others[x]);
ast_closestream(others[x]);
}
if (rfmt) {
if (ast_set_read_format(chan, rfmt)) {
ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
}
}
if (outmsg > 1) {
/* Let them know recording is stopped */
if(!ast_streamfile(chan, "auth-thankyou", chan->language))
ast_waitstream(chan, "");
}
return res;
}
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)
{
char d = 0, *fmts;
char comment[256];
int x, fmtcnt=1, res=-1,outmsg=0;
struct ast_frame *f;
struct ast_filestream *others[MAX_OTHER_FORMATS];
struct ast_filestream *realfiles[MAX_OTHER_FORMATS];
char *sfmt[MAX_OTHER_FORMATS];
char *stringp=NULL;
time_t start, end;
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];
if (silencethreshold < 0)
silencethreshold = global_silence_threshold;
if (maxsilence < 0)
maxsilence = global_maxsilence;
/* barf if no pointer passed to store duration in */
if (duration == NULL) {
ast_log(LOG_WARNING, "Error play_and_prepend called without duration pointer\n");
return -1;
}
ast_log(LOG_DEBUG,"play_and_prepend: %s, %s, '%s'\n", playfile ? playfile : "<None>", recordfile, fmt);
snprintf(comment,sizeof(comment),"Playing %s, Recording to: %s on %s\n", playfile ? playfile : "<None>", recordfile, chan->name);
if (playfile || beep) {
if (!beep)
d = ast_play_and_wait(chan, playfile);
if (d > -1)
d = ast_streamfile(chan, "beep",chan->language);
if (!d)
d = ast_waitstream(chan,"");
if (d < 0)
return -1;
}
strncpy(prependfile, recordfile, sizeof(prependfile) -1);
strncat(prependfile, "-prepend", sizeof(prependfile) - strlen(prependfile) - 1);
fmts = ast_strdupa(fmt);
stringp=fmts;
strsep(&stringp, "|");
ast_log(LOG_DEBUG,"Recording Formats: sfmts=%s\n", fmts);
sfmt[0] = ast_strdupa(fmts);
while((fmt = strsep(&stringp, "|"))) {
if (fmtcnt > MAX_OTHER_FORMATS - 1) {
ast_log(LOG_WARNING, "Please increase MAX_OTHER_FORMATS in app_voicemail.c\n");
break;
}
sfmt[fmtcnt++] = ast_strdupa(fmt);
}
time(&start);
end=start; /* pre-initialize end to be same as start in case we never get into loop */
for (x=0;x<fmtcnt;x++) {
others[x] = ast_writefile(prependfile, sfmt[x], comment, O_TRUNC, 0, 0700);
ast_verbose( VERBOSE_PREFIX_3 "x=%i, open writing: %s format: %s, %p\n", x, prependfile, sfmt[x], others[x]);
if (!others[x]) {
break;
}
}
sildet = ast_dsp_new(); /* Create the silence detector */
if (!sildet) {
ast_log(LOG_WARNING, "Unable to create silence detector :(\n");
return -1;
}
ast_dsp_set_threshold(sildet, silencethreshold);
if (maxsilence > 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");
return -1;
}
}
if (x == fmtcnt) {
/* Loop forever, writing the packets we read to the writer(s), until
we read a # or get a hangup */
f = NULL;
for(;;) {
res = ast_waitfor(chan, 2000);
if (!res) {
ast_log(LOG_DEBUG, "One waitfor failed, trying another\n");
/* Try one more time in case of masq */
res = ast_waitfor(chan, 2000);
if (!res) {
ast_log(LOG_WARNING, "No audio available on %s??\n", chan->name);
res = -1;
}
}
if (res < 0) {
f = NULL;
break;
}
f = ast_read(chan);
if (!f)
break;
if (f->frametype == AST_FRAME_VOICE) {
/* write each format */
for (x=0;x<fmtcnt;x++) {
if (!others[x])
break;
res = ast_writestream(others[x], f);
}
/* Silence Detection */
if (maxsilence > 0) {
dspsilence = 0;
ast_dsp_silence(sildet, f, &dspsilence);
if (dspsilence)
totalsilence = dspsilence;
else
totalsilence = 0;
if (totalsilence > maxsilence) {
/* Ended happily with silence */
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;
outmsg=2;
break;
}
}
/* Exit on any error */
if (res) {
ast_log(LOG_WARNING, "Error writing frame\n");
ast_frfree(f);
break;
}
} else if (f->frametype == AST_FRAME_VIDEO) {
/* Write only once */
ast_writestream(others[0], f);
} else if (f->frametype == AST_FRAME_DTMF) {
/* stop recording with any digit */
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
res = 't';
outmsg = 2;
ast_frfree(f);
break;
}
if (maxtime) {
time(&end);
if (maxtime < (end - start)) {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Took too long, cutting it short...\n");
res = 't';
outmsg=2;
ast_frfree(f);
break;
}
}
ast_frfree(f);
}
if (end == start) time(&end);
if (!f) {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "User hung up\n");
res = -1;
outmsg=1;
#if 0
/* delete all the prepend files */
for (x=0;x<fmtcnt;x++) {
if (!others[x])
break;
ast_closestream(others[x]);
ast_filedelete(prependfile, sfmt[x]);
}
#endif
}
} else {
ast_log(LOG_WARNING, "Error creating writestream '%s', format '%s'\n", prependfile, sfmt[x]);
}
*duration = end - start;
#if 0
if (outmsg > 1) {
#else
if (outmsg) {
#endif
struct ast_frame *fr;
for (x=0;x<fmtcnt;x++) {
snprintf(comment, sizeof(comment), "Opening the real file %s.%s\n", recordfile, sfmt[x]);
realfiles[x] = ast_readfile(recordfile, sfmt[x], comment, O_RDONLY, 0, 0);
if (!others[x] || !realfiles[x])
break;
if (totalsilence)
ast_stream_rewind(others[x], totalsilence-200);
else
ast_stream_rewind(others[x], 200);
ast_truncstream(others[x]);
/* add the original file too */
while ((fr = ast_readframe(realfiles[x]))) {
ast_writestream(others[x],fr);
}
ast_closestream(others[x]);
ast_closestream(realfiles[x]);
ast_filerename(prependfile, recordfile, sfmt[x]);
#if 0
ast_verbose("Recording Format: sfmts=%s, prependfile %s, recordfile %s\n", sfmt[x],prependfile,recordfile);
#endif
ast_filedelete(prependfile, sfmt[x]);
}
}
if (rfmt) {
if (ast_set_read_format(chan, rfmt)) {
ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
}
}
if (outmsg) {
if (outmsg > 1) {
/* Let them know it worked */
ast_streamfile(chan, "auth-thankyou", chan->language);
ast_waitstream(chan, "");
}
}
return res;
}

View File

@@ -1 +0,0 @@
.depend

5
apps/Makefile Executable file → Normal file
View File

@@ -28,7 +28,8 @@ APPS=app_dial.so app_playback.so app_voicemail.so app_directory.so app_mp3.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_groupcount.so app_txtcidname.so app_controlplayback.so \
app_talkdetect.so app_alarmreceiver.so app_userevent.so app_verbose.so
app_talkdetect.so app_alarmreceiver.so app_userevent.so app_verbose.so \
app_test.so app_forkcdr.so
ifneq (${OSARCH},Darwin)
APPS+=app_intercom.so
@@ -88,7 +89,7 @@ app_sql_odbc.so: app_sql_odbc.o
$(CC) $(SOLINK) -o $@ $< -lodbc
look: look.c
gcc -pipe -O6 -g look.c -o look -lncurses
$(CC) -pipe -O6 -g look.c -o look -lncurses
ifneq ($(wildcard .depend),)
include .depend

0
apps/app_adsiprog.c Executable file → Normal file
View File

4
apps/app_alarmreceiver.c Executable file → Normal file
View File

@@ -55,7 +55,7 @@ static char *tdesc = "Alarm Receiver for Asterisk";
static char *app = "AlarmReceiver";
static char *synopsis = "Provide support for receving alarm reports from a burglar or fire alarm panel\n";
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"
@@ -817,7 +817,7 @@ static int load_config(void)
strncpy(db_family, p, sizeof(db_family) - 1);
db_family[sizeof(db_family) - 1] = '\0';
}
ast_destroy(cfg);
}
return 0;

0
apps/app_authenticate.c Executable file → Normal file
View File

0
apps/app_cdr.c Executable file → Normal file
View File

11
apps/app_chanisavail.c Executable file → Normal file
View File

@@ -38,11 +38,12 @@ static char *descrip =
"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). If any of the requested channels\n"
"are available, the next priority will be n+1, the channel variable\n"
"${AVAILCHAN} will be set to the name of the available channel and\n"
"the ChanIsAvail app will return 0. ${AVAILORIGCHAN} is\n"
"the canonical channel name that was used to create the channel.\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";
STANDARD_LOCAL_USER;

0
apps/app_controlplayback.c Executable file → Normal file
View File

0
apps/app_cut.c Executable file → Normal file
View File

0
apps/app_datetime.c Executable file → Normal file
View File

0
apps/app_db.c Executable file → Normal file
View File

83
apps/app_dial.c Executable file → Normal file
View File

@@ -3,9 +3,9 @@
*
* Trivial application to dial a channel and send an URL on answer
*
* Copyright (C) 1999, Mark Spencer
* Copyright (C) 1999-2004, Digium, Inc.
*
* Mark Spencer <markster@linux-support.net>
* Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -67,6 +67,7 @@ static char *descrip =
" that are assigned to you.\n"
" 'r' -- indicate ringing to the calling party, pass no audio until answered.\n"
" 'm' -- provide hold music to the calling party until answered.\n"
" 'M(x) -- Executes the macro (x) upon connect of the call\n"
" 'h' -- allow callee to hang up by hitting *.\n"
" 'H' -- allow caller to hang up by hitting *.\n"
" 'C' -- reset call detail record for this call.\n"
@@ -250,10 +251,11 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
if (!o->chan->callerid)
ast_log(LOG_WARNING, "Out of memory\n");
} else {
if (in->callerid)
if (in->callerid) {
o->chan->callerid = strdup(in->callerid);
if (!o->chan->callerid)
ast_log(LOG_WARNING, "Out of memory\n");
if (!o->chan->callerid)
ast_log(LOG_WARNING, "Out of memory\n");
}
strncpy(o->chan->accountcode, in->accountcode, sizeof(o->chan->accountcode) - 1);
o->chan->cdrflags = in->cdrflags;
}
@@ -279,6 +281,9 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
ast_hangup(o->chan);
o->chan = NULL;
numnochan++;
} else {
/* After calling, set callerid to extension */
ast_set_callerid(o->chan, ast_strlen_zero(in->macroexten) ? in->exten : in->macroexten, 0);
}
}
/* Hangup the original channel now, in case we needed it */
@@ -334,7 +339,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
case AST_CONTROL_PROGRESS:
if (option_verbose > 2)
ast_verbose ( VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", o->chan->name,in->name);
ast_indicate(in, AST_CONTROL_PROGRESS);
if (!outgoing->ringbackonly)
ast_indicate(in, AST_CONTROL_PROGRESS);
break;
case AST_CONTROL_OFFHOOK:
/* Ignore going off hook */
@@ -381,6 +387,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
/* Got hung up */
*to=-1;
strncpy(status, "CANCEL", statussize - 1);
if (f)
ast_frfree(f);
return NULL;
}
if (f && (f->frametype == AST_FRAME_DTMF) && *allowdisconnect_out &&
@@ -389,6 +397,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
*to=0;
strcpy(status, "CANCEL");
ast_frfree(f);
return NULL;
}
if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF))) {
@@ -409,7 +418,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
{
int res=-1;
struct localuser *u;
char info[256], *peers, *timeout, *tech, *number, *rest, *cur;
char *info, *peers, *timeout, *tech, *number, *rest, *cur;
char privdb[256] = "", *s;
char announcemsg[256] = "", *ann;
struct localuser *outgoing=NULL, *tmp;
@@ -419,6 +428,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
int allowredir_out=0;
int allowdisconnect_in=0;
int allowdisconnect_out=0;
int hasmacro = 0;
int privacy=0;
int announce=0;
int resetcdr=0;
@@ -447,6 +457,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
char *sdtmfptr;
char sdtmfdata[256] = "";
char *stack,*var;
char *mac = NULL, macroname[256] = "";
char status[256]="";
char toast[80];
int play_to_caller=0,play_to_callee=0;
@@ -458,10 +469,13 @@ static int dial_exec(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "Dial requires an argument (technology1/number1&technology2/number2...|optional timeout|options)\n");
return -1;
}
if (!(info = ast_strdupa(data))) {
ast_log(LOG_WARNING, "Unable to dupe data :(\n");
return -1;
}
LOCAL_USER_ADD(u);
strncpy(info, (char *)data, sizeof(info) - 1);
peers = info;
if (peers) {
@@ -609,6 +623,27 @@ static int dial_exec(struct ast_channel *chan, void *data)
announce = 0;
}
}
/* Get the macroname from the dial option string */
if ((mac = strstr(transfer, "M("))) {
hasmacro = 1;
strncpy(macroname, mac + 2, sizeof(macroname) - 1);
while (*mac && (*mac != ')'))
*(mac++) = 'X';
if (*mac)
*mac = 'X';
else {
ast_log(LOG_WARNING, "Could not find macro to which we should jump.\n");
hasmacro = 0;
}
mac = strchr(macroname, ')');
if (mac)
*mac = '\0';
else {
ast_log(LOG_WARNING, "Macro flag set without trailing ')'\n");
hasmacro = 0;
}
}
/* Extract privacy info from transfer */
if ((s = strstr(transfer, "P("))) {
privacy = 1;
@@ -813,9 +848,11 @@ static int dial_exec(struct ast_channel *chan, void *data)
free(tmp);
cur = rest;
continue;
} else
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
ast_set_callerid(tmp->chan, ast_strlen_zero(chan->macroexten) ? chan->exten : chan->macroexten, 0);
}
/* Put them in the list of outgoing thingies... We're ready now.
XXX If we're forcibly removed, these outgoing calls won't get
hung up XXX */
@@ -906,6 +943,32 @@ static int dial_exec(struct ast_channel *chan, void *data)
} else
res = 0;
if (hasmacro && macroname) {
void *app = NULL;
res = ast_autoservice_start(chan);
if (res) {
ast_log(LOG_ERROR, "Unable to start autoservice on calling channel\n");
res = -1;
}
app = pbx_findapp("Macro");
if (app && !res) {
res = pbx_exec(peer, app, macroname, 1);
ast_log(LOG_DEBUG, "Macro exited with status %d\n", res);
res = 0;
} else {
ast_log(LOG_ERROR, "Could not find application Macro\n");
res = -1;
}
if (ast_autoservice_stop(chan) < 0) {
ast_log(LOG_ERROR, "Could not stop autoservice on calling channel\n");
res = -1;
}
}
if (!res) {
if (calldurationlimit > 0) {
time(&now);

2
apps/app_directory.c Executable file → Normal file
View File

@@ -184,7 +184,7 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
ast_log(LOG_WARNING,
"Can't find extension '%s' in context '%s'. "
"Did you pass the wrong context to Directory?\n",
ext, context);
ext, dialcontext);
res = -1;
}
break;

126
apps/app_disa.c Executable file → Normal file
View File

@@ -17,6 +17,7 @@
#include <asterisk/file.h>
#include <asterisk/logger.h>
#include <asterisk/channel.h>
#include <asterisk/indications.h>
#include <asterisk/pbx.h>
#include <asterisk/module.h>
#include <asterisk/translate.h>
@@ -27,9 +28,6 @@
#include <math.h>
#include <sys/time.h>
/*
#define TONE_BLOCK_SIZE 320
*/
static char *tdesc = "DISA (Direct Inward System Access) Application";
@@ -82,27 +80,9 @@ STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
static float loudness=4096.0;
static int firstdigittimeout = 20000; /* 20 seconds first digit timeout */
static int digittimeout = 10000; /* 10 seconds subsequent digit timeout */
static void make_tone_block(unsigned char *data, float f1, float f2, int len, int *x)
{
int i;
float val;
for(i = 0; i < len; i++)
{
val = loudness * sin((f1 * 2.0 * M_PI * (*x))/8000.0);
val += loudness * sin((f2 * 2.0 * M_PI * (*x)++)/8000.0);
data[i] = AST_LIN2MU((int)val);
}
/* wrap back around from 8000 */
if (*x >= 8000) *x = 0;
return;
}
static int ms_diff(struct timeval *tv1, struct timeval *tv2)
{
int ms;
@@ -112,19 +92,26 @@ int ms;
return(ms);
}
static void play_dialtone(struct ast_channel *chan)
{
const struct tone_zone_sound *ts = NULL;
ts = ast_get_indication_tone(chan->zone, "dial");
if (ts)
ast_playtones_start(chan, 0, ts->data, 0);
else
ast_tonepair_start(chan, 350, 440, 0, 0);
}
static int disa_exec(struct ast_channel *chan, void *data)
{
int i,j,k,x;
int i,j,k,x,did_ignore;
struct localuser *u;
char tmp[256],arg2[256]="",exten[AST_MAX_EXTENSION],acctcode[20]="";
struct {
unsigned char offset[AST_FRIENDLY_OFFSET];
unsigned char buf[640];
} tone_block;
char *ourcontext,*ourcallerid;
struct ast_frame *f,wf;
struct ast_frame *f;
struct timeval lastout, now, lastdigittime;
int res;
time_t rstart;
FILE *fp;
char *stringp=NULL;
@@ -165,15 +152,22 @@ static int disa_exec(struct ast_channel *chan, void *data)
ast_answer(chan);
}
i = k = x = 0; /* k is 0 for pswd entry, 1 for ext entry */
did_ignore = 0;
exten[0] = 0;
acctcode[0] = 0;
/* can we access DISA without password? */
ast_log(LOG_DEBUG, "Context: %s\n",ourcontext);
if (!strcasecmp(tmp, "no-password"))
{;
k = 1;
ast_log(LOG_DEBUG, "DISA no-password login success\n");
}
gettimeofday(&lastdigittime,NULL);
play_dialtone(chan);
for(;;)
{
gettimeofday(&now,NULL);
@@ -204,25 +198,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
return -1;
}
if (f->frametype == AST_FRAME_VOICE) {
if (!i || (ast_ignore_pattern(ourcontext, exten) && k)) {
wf.frametype = AST_FRAME_VOICE;
wf.subclass = AST_FORMAT_ULAW;
wf.offset = AST_FRIENDLY_OFFSET;
wf.mallocd = 0;
wf.data = tone_block.buf;
wf.datalen = f->datalen;
wf.delivery.tv_sec = wf.delivery.tv_usec = 0;
make_tone_block(tone_block.buf, 350, 440, f->datalen, &x);
wf.samples = wf.datalen;
ast_frfree(f);
if (ast_write(chan, &wf))
{
ast_log(LOG_WARNING, "DISA Failed to write frame on %s\n",chan->name);
LOCAL_USER_REMOVE(u);
return -1;
}
} else
ast_frfree(f);
ast_frfree(f);
continue;
}
/* if not DTMF, just do it again */
@@ -234,7 +210,9 @@ static int disa_exec(struct ast_channel *chan, void *data)
j = f->subclass; /* save digit */
ast_frfree(f);
if (i == 0)
ast_playtones_stop(chan);
gettimeofday(&lastdigittime,NULL);
/* got a DTMF tone */
if (i < AST_MAX_EXTENSION) /* if still valid number of digits */
@@ -287,7 +265,9 @@ static int disa_exec(struct ast_channel *chan, void *data)
}
/* password good, set to dial state */
ast_log(LOG_WARNING,"DISA on chan %s password is good\n",chan->name);
ast_log(LOG_DEBUG,"DISA on chan %s password is good\n",chan->name);
play_dialtone(chan);
k = 1;
i = 0; /* re-set buffer pointer */
exten[sizeof(acctcode)] = 0;
@@ -297,19 +277,31 @@ static int disa_exec(struct ast_channel *chan, void *data)
continue;
}
}
exten[i++] = j; /* save digit */
exten[i] = 0;
if (!k) continue; /* if getting password, continue doing it */
/* if this exists */
if (ast_ignore_pattern(ourcontext, exten)) {
play_dialtone(chan);
did_ignore = 1;
} else
if (did_ignore) {
ast_playtones_stop(chan);
did_ignore = 0;
}
/* if can do some more, do it */
if (!ast_matchmore_extension(chan,ourcontext,exten,1, chan->callerid))
if (!ast_matchmore_extension(chan,ourcontext,exten,1, chan->callerid)) {
break;
}
}
}
if (k && ast_exists_extension(chan,ourcontext,exten,1, chan->callerid))
{
ast_playtones_stop(chan);
/* We're authenticated and have a valid extension */
if (ourcallerid && *ourcallerid)
{
@@ -326,44 +318,20 @@ static int disa_exec(struct ast_channel *chan, void *data)
}
reorder:
/* something is invalid, give em reorder forever */
x = 0;
k = 0; /* k = 0 means busy tone, k = 1 means silence) */
i = 0; /* Number of samples we've done */
for(;;)
ast_indicate(chan,AST_CONTROL_CONGESTION);
/* something is invalid, give em reorder for several seconds */
time(&rstart);
while(time(NULL) < rstart + 10)
{
if (ast_waitfor(chan, -1) < 0)
break;
f = ast_read(chan);
if (!f)
break;
if (f->frametype == AST_FRAME_VOICE) {
wf.frametype = AST_FRAME_VOICE;
wf.subclass = AST_FORMAT_ULAW;
wf.offset = AST_FRIENDLY_OFFSET;
wf.mallocd = 0;
wf.data = tone_block.buf;
wf.datalen = f->datalen;
wf.samples = wf.datalen;
if (k)
memset(tone_block.buf, 0x7f, wf.datalen);
else
make_tone_block(tone_block.buf,480.0, 620.0,wf.datalen, &x);
i += wf.datalen / 8;
if (i > 250) {
i = 0;
k = !k;
}
if (ast_write(chan, &wf))
{
ast_log(LOG_WARNING, "DISA Failed to write frame on %s\n",chan->name);
LOCAL_USER_REMOVE(u);
return -1;
}
}
ast_frfree(f);
}
ast_playtones_stop(chan);
LOCAL_USER_REMOVE(u);
return -1;
}

0
apps/app_echo.c Executable file → Normal file
View File

0
apps/app_enumlookup.c Executable file → Normal file
View File

0
apps/app_eval.c Executable file → Normal file
View File

0
apps/app_exec.c Executable file → Normal file
View File

7
apps/app_festival.c Executable file → Normal file
View File

@@ -307,6 +307,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
}
if (!vdata || ast_strlen_zero(vdata)) {
ast_log(LOG_WARNING, "festival requires an argument (text)\n");
ast_destroy(cfg);
return -1;
}
strncpy(data, vdata, sizeof(data) - 1);
@@ -324,6 +325,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
if (fd < 0) {
ast_log(LOG_WARNING,"festival_client: can't get socket\n");
ast_destroy(cfg);
return -1;
}
memset(&serv_addr, 0, sizeof(serv_addr));
@@ -332,6 +334,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
serverhost = ast_gethostbyname(host, &ahp);
if (serverhost == (struct hostent *)0) {
ast_log(LOG_WARNING,"festival_client: gethostbyname failed\n");
ast_destroy(cfg);
return -1;
}
memmove(&serv_addr.sin_addr,serverhost->h_addr, serverhost->h_length);
@@ -341,6 +344,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0) {
ast_log(LOG_WARNING,"festival_client: connect to server failed\n");
ast_destroy(cfg);
return -1;
}
@@ -362,7 +366,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
snprintf(cachefile, sizeof(cachefile), "%s/%s", cachedir, MD5Hex);
fdesc=open(cachefile,O_RDWR);
if (fdesc==-1) {
fdesc=open(cachefile,O_CREAT|O_RDWR,0);
fdesc=open(cachefile,O_CREAT|O_RDWR,0777);
if (fdesc!=-1) {
writecache=1;
strln=strlen((char *)data);
@@ -443,6 +447,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
}
} while (strcmp(ack,"OK\n") != 0);
close(fd);
ast_destroy(cfg);
LOCAL_USER_REMOVE(u);
return res;

0
apps/app_flash.c Executable file → Normal file
View File

90
apps/app_forkcdr.c Normal file
View File

@@ -0,0 +1,90 @@
/*
* Asterisk -- A telephony toolkit for Linux.
*
* Fork CDR application
* Copyright Anthony Minessale anthmct@yahoo.com
* Development of this app Sponsered/Funded by TAAN Softworks Corp
*
* This program is free software, distributed under the terms of
* the GNU General Public License
*/
#include <asterisk/file.h>
#include <asterisk/logger.h>
#include <asterisk/channel.h>
#include <asterisk/pbx.h>
#include <asterisk/cdr.h>
#include <asterisk/module.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <pthread.h>
static char *tdesc = "Fork The CDR into 2 seperate entities.";
static char *app = "ForkCDR";
static char *synopsis =
"Forks the Call Data Record";
static char *descrip =
" ForkCDR(): Causes the Call Data Record to fork an additional\n"
"cdr record starting from the time of the fork call\n";
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
static void ast_cdr_clone(struct ast_cdr *cdr) {
struct ast_cdr *newcdr = ast_cdr_alloc();
memcpy(newcdr,cdr,sizeof(struct ast_cdr));
ast_cdr_append(cdr,newcdr);
gettimeofday(&newcdr->start, NULL);
memset(&newcdr->answer, 0, sizeof(newcdr->answer));
ast_cdr_add_flag(cdr,AST_CDR_FLAG_CHILD|AST_CDR_FLAG_LOCKED);
}
static void ast_cdr_fork(struct ast_channel *chan) {
if(chan && chan->cdr) {
ast_cdr_clone(chan->cdr);
}
}
static int forkcdr_exec(struct ast_channel *chan, void *data)
{
int res=0;
struct localuser *u;
LOCAL_USER_ADD(u);
ast_cdr_fork(chan);
LOCAL_USER_REMOVE(u);
return res;
}
int unload_module(void)
{
STANDARD_HANGUP_LOCALUSERS;
return ast_unregister_application(app);
}
int load_module(void)
{
return ast_register_application(app, forkcdr_exec, synopsis, descrip);
}
char *description(void)
{
return tdesc;
}
int usecount(void)
{
int res;
STANDARD_USECOUNT(res);
return res;
}
char *key()
{
return ASTERISK_GPL_KEY;
}

10
apps/app_getcpeid.c Executable file → Normal file
View File

@@ -3,9 +3,9 @@
*
* Execute arbitrary system commands
*
* Copyright (C) 1999, Mark Spencer
* Copyright (C) 1999-2005, Digium
*
* Mark Spencer <markster@linux-support.net>
* Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -31,9 +31,9 @@ static char *app = "GetCPEID";
static char *synopsis = "Get ADSI CPE ID";
static char *descrip =
" GetCPEID: Obtains and displays CPE ID and other information in order to\n"
"properly setup zapata.conf for on-hook operations. Returns -1 on hanup\n"
"only.";
" 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";
STANDARD_LOCAL_USER;

0
apps/app_groupcount.c Executable file → Normal file
View File

30
apps/app_hasnewvoicemail.c Executable file → Normal file
View File

@@ -38,6 +38,7 @@
#include <asterisk/pbx.h>
#include <asterisk/module.h>
#include <asterisk/lock.h>
#include <asterisk/utils.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
@@ -70,7 +71,7 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
{
int res=0;
struct localuser *u;
char vmpath[256], *input, *varname = NULL, *vmbox, *vmfolder = "INBOX", *context = "default";
char vmpath[256], *temps, *input, *varname = NULL, *vmbox, *vmfolder = "INBOX", *context = "default";
DIR *vmdir;
struct dirent *vment;
int vmcount = 0;
@@ -83,21 +84,22 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
input = ast_strdupa((char *)data);
if (input) {
if ((vmbox = strsep(&input,":")))
if ((vmfolder = strsep(&input,"|")))
temps = input;
if ((temps = strsep(&input, "|"))) {
if (input && !ast_strlen_zero(input))
varname = input;
else
vmfolder = input;
else
if ((vmbox = strsep(&input,"|")))
varname = input;
else
vmbox = input;
if (index(vmbox,'@')) {
context = vmbox;
vmbox = strsep(&context,"@");
input = temps;
}
if ((temps = strsep(&input, ":"))) {
if (input && !ast_strlen_zero(input))
vmfolder = input;
input = temps;
}
if ((vmbox = strsep(&input, "@")))
if (input && !ast_strlen_zero(input))
context = input;
if (!vmbox)
vmbox = input;
snprintf(vmpath,sizeof(vmpath), "%s/voicemail/%s/%s/%s", (char *)ast_config_AST_SPOOL_DIR, context, vmbox, vmfolder);
if (!(vmdir = opendir(vmpath))) {

0
apps/app_ices.c Executable file → Normal file
View File

0
apps/app_image.c Executable file → Normal file
View File

0
apps/app_intercom.c Executable file → Normal file
View File

0
apps/app_lookupblacklist.c Executable file → Normal file
View File

0
apps/app_lookupcidname.c Executable file → Normal file
View File

3
apps/app_macro.c Executable file → Normal file
View File

@@ -140,7 +140,8 @@ static int macro_exec(struct ast_channel *chan, void *data)
while(ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->callerid)) {
if ((res = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->callerid))) {
/* Something bad happened, or a hangup has been requested. */
if (((res >= '0') && (res <= '9')) || ((res >= 'A') && (res <= 'F'))) {
if (((res >= '0') && (res <= '9')) || ((res >= 'A') && (res <= 'F')) ||
(res == '*') || (res == '#')) {
/* Just return result as to the previous application as if it had been dialed */
ast_log(LOG_DEBUG, "Oooh, got something to jump out with ('%c')!\n", res);
break;

88
apps/app_meetme.c Executable file → Normal file
View File

@@ -3,9 +3,9 @@
*
* Meet me conference bridge
*
* Copyright (C) 1999, Mark Spencer
* Copyright (C) 1999-2004, Digium, Inc.
*
* Mark Spencer <markster@linux-support.net>
* Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -69,13 +69,14 @@ static char *descrip =
" 'v' -- video mode\n"
" 'q' -- quiet mode (don't play enter/leave sounds)\n"
" 'M' -- enable music on hold when the conference has a single caller\n"
" 'x' -- close the conference when last user marked with 'x' exits\n"
" 'w' -- wait until a user marked with the 'x' option enters the conference\n"
" 'x' -- close the conference when last marked user exits\n"
" 'w' -- wait until the marked user enters the conference\n"
" 'b' -- run AGI script specified in ${MEETME_AGI_BACKGROUND}\n"
" Default: conf-background.agi\n"
" (Note: This does not work with non-Zap channels in the same conference)\n"
" 's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n"
" 'a' -- set admin mode\n";
" 'a' -- set admin mode\n"
" 'A' -- set marked mode\n";
static char *descrip2 =
" MeetMeCount(confno[|var]): Plays back the number of users in the specifiedi\n"
@@ -149,9 +150,10 @@ static int admin_exec(struct ast_channel *chan, void *data);
#define CONFFLAG_VIDEO (1 << 7) /* Set to enable video mode */
#define CONFFLAG_AGI (1 << 8) /* Set to run AGI Script in Background */
#define CONFFLAG_MOH (1 << 9) /* Set to have music on hold when user is alone in conference */
#define CONFFLAG_ADMINEXIT (1 << 10) /* If set the MeetMe will return if all marked with this flag left */
#define CONFFLAG_WAITMARKED (1 << 11) /* If set, the MeetMe will wait until a marked user enters */
#define CONFFLAG_EXIT_CONTEXT (1 << 12) /* If set, the MeetMe will wait until a marked user enters */
#define CONFFLAG_MARKEDEXIT (1 << 10) /* If set the MeetMe will return if all marked with this flag left */
#define CONFFLAG_WAITMARKED (1 << 11) /* If set, the MeetMe will wait until a marked user enters */
#define CONFFLAG_EXIT_CONTEXT (1 << 12) /* If set, the MeetMe will exit to the specified context */
#define CONFFLAG_MARKEDUSER (1 << 13) /* If set, the user will be marked */
static int careful_write(int fd, unsigned char *data, int len)
@@ -217,7 +219,7 @@ static struct ast_conference *build_conf(char *confno, char *pin, int make, int
memset(cnf, 0, sizeof(struct ast_conference));
strncpy(cnf->confno, confno, sizeof(cnf->confno) - 1);
strncpy(cnf->pin, pin, sizeof(cnf->pin) - 1);
cnf->markedusers = -1;
cnf->markedusers = 0;
cnf->chan = ast_request("zap", AST_FORMAT_ULAW, "pseudo");
if (cnf->chan) {
cnf->fd = cnf->chan->fds[0]; /* for use by conf_play() */
@@ -306,7 +308,7 @@ static int conf_cmd(int fd, int argc, char **argv) {
}
ast_cli(fd, header_format, "Conf Num", "Parties", "Marked", "Activity", "Creation");
while(cnf) {
if (cnf->markedusers < 0)
if (cnf->markedusers == 0)
strncpy(cmdline, "N/A ", sizeof(cmdline) - 1);
else
snprintf(cmdline, sizeof(cmdline), "%4.4d", cnf->markedusers);
@@ -475,7 +477,7 @@ static int confnonzero(void *ptr)
struct ast_conference *conf = ptr;
int res;
ast_mutex_lock(&conflock);
res = (conf->markedusers < 0);
res = (conf->markedusers == 0);
ast_mutex_unlock(&conflock);
return res;
}
@@ -509,6 +511,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
char *agifiledefault = "conf-background.agi";
char meetmesecs[30] = "";
char exitcontext[AST_MAX_EXTENSION] = "";
int dtmf;
ZT_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
@@ -521,7 +524,9 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
memset(user, 0, sizeof(struct ast_conf_user));
user->user_no = 0; /* User number 0 means starting up user! (dead - not in the list!) */
time(&user->jointime);
if (conf->locked) {
/* Sorry, but this confernce is locked! */
if (!ast_streamfile(chan, "conf-locked", chan->language))
@@ -529,13 +534,8 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
goto outrun;
}
conf->users++;
if (confflags & CONFFLAG_ADMINEXIT) {
if (conf->markedusers == -1) {
conf->markedusers = 1;
} else {
conf->markedusers++;
}
}
if (confflags & CONFFLAG_MARKEDUSER)
conf->markedusers++;
ast_mutex_lock(&conflock);
if (conf->firstuser == NULL) {
@@ -559,7 +559,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
conf->lastuser = user;
}
}
strncpy(user->usrvalue, "test", sizeof(user->usrvalue) - 1);
user->chan = chan;
user->userflags = confflags;
user->adminflags = 0;
@@ -573,7 +572,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
else
strncpy(exitcontext, chan->context, sizeof(exitcontext) - 1);
}
while((confflags & CONFFLAG_WAITMARKED) && (conf->markedusers < 0)) {
while((confflags & CONFFLAG_WAITMARKED) && (conf->markedusers == 0)) {
confflags &= ~CONFFLAG_QUIET;
confflags |= origquiet;
/* XXX Announce that we're waiting on the conference lead to join */
@@ -765,7 +764,7 @@ zapretry:
}
/* Leave if the last marked user left */
if (conf->markedusers == 0) {
if (conf->markedusers == 0 && confflags & CONFFLAG_MARKEDEXIT) {
ret = -1;
break;
}
@@ -843,10 +842,14 @@ zapretry:
menu_active = 1;
/* Record this sound! */
if (!ast_streamfile(chan, "conf-adminmenu", chan->language))
ast_waitstream(chan, "");
} else {
switch(f->subclass - 48) {
case 1: /* Un/Mute */
dtmf = ast_waitstream(chan, AST_DIGIT_ANY);
else
dtmf = 0;
} else
dtmf = f->subclass;
if (dtmf) {
switch(dtmf) {
case '1': /* Un/Mute */
menu_active = 0;
if (ztc.confmode & ZT_CONF_TALKER) {
ztc.confmode = ZT_CONF_CONF | ZT_CONF_LISTENER;
@@ -868,7 +871,7 @@ zapretry:
ast_waitstream(chan, "");
}
break;
case 2: /* Un/Lock the Conference */
case '2': /* Un/Lock the Conference */
menu_active = 0;
if (conf->locked) {
conf->locked = 0;
@@ -894,10 +897,14 @@ zapretry:
menu_active = 1;
/* Record this sound! */
if (!ast_streamfile(chan, "conf-usermenu", chan->language))
ast_waitstream(chan, "");
} else {
switch(f->subclass - 48) {
case 1: /* Un/Mute */
dtmf = ast_waitstream(chan, AST_DIGIT_ANY);
else
dtmf = 0;
} else
dtmf = f->subclass;
if (dtmf) {
switch(dtmf) {
case '1': /* Un/Mute */
menu_active = 0;
if (ztc.confmode & ZT_CONF_TALKER) {
ztc.confmode = ZT_CONF_CONF | ZT_CONF_LISTENER;
@@ -986,7 +993,7 @@ outrun:
chan->name, chan->uniqueid, conf->confno, user->user_no);
prev = NULL;
conf->users--;
if (confflags & CONFFLAG_ADMINEXIT)
if (confflags & CONFFLAG_MARKEDUSER)
conf->markedusers--;
cur = confs;
if (!conf->users) {
@@ -1037,10 +1044,10 @@ outrun:
else
ast_log(LOG_ERROR, "Bad! Bad! Bad! user->prevuser is NULL but we're not the beginning!\n");
}
/* Return the number of seconds the user was in the conf */
snprintf(meetmesecs, sizeof(meetmesecs), "%i", (int) (user->jointime - time(NULL)));
pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
}
/* Return the number of seconds the user was in the conf */
snprintf(meetmesecs, sizeof(meetmesecs), "%i", (int) (time(NULL) - user->jointime));
pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
}
free(user);
ast_mutex_unlock(&conflock);
@@ -1210,9 +1217,11 @@ static int conf_exec(struct ast_channel *chan, void *data)
if (strchr(inflags, 'M'))
confflags |= CONFFLAG_MOH;
if (strchr(inflags, 'x'))
confflags |= CONFFLAG_ADMINEXIT;
confflags |= CONFFLAG_MARKEDEXIT;
if (strchr(inflags, 'X'))
confflags |= CONFFLAG_EXIT_CONTEXT;
if (strchr(inflags, 'A'))
confflags |= CONFFLAG_MARKEDUSER;
if (strchr(inflags, 'b'))
confflags |= CONFFLAG_AGI;
if (strchr(inflags, 'w'))
@@ -1446,14 +1455,17 @@ static int admin_exec(struct ast_channel *chan, void *data) {
command = strsep(&params, "|");
caller = strsep(&params, "|");
ast_mutex_lock(&conflock);
if (!command) {
ast_log(LOG_WARNING, "MeetmeAdmin requires a command!\n");
ast_mutex_unlock(&conflock);
return -1;
}
cnf = confs;
while (cnf) {
if (strcmp(cnf->confno, conf) == 0)
break;
cnf = cnf->next;
}
ast_mutex_unlock(&conflock);
if (caller)
user = find_user(cnf, caller);

0
apps/app_milliwatt.c Executable file → Normal file
View File

19
apps/app_mp3.c Executable file → Normal file
View File

@@ -3,9 +3,9 @@
*
* Silly application to play an MP3 file -- uses mpg123
*
* Copyright (C) 1999, Mark Spencer
* Copyright (C) 1999-2004, Digium, Inc.
*
* Mark Spencer <markster@linux-support.net>
* Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -60,7 +60,7 @@ static int mp3play(char *filename, int fd)
close(x);
}
/* Execute mpg123, but buffer if it's a net connection */
if (!strncmp(filename, "http://", 7)) {
if (!strncasecmp(filename, "http://", 7)) {
/* Most commonly installed in /usr/local/bin */
execl(LOCAL_MPG_123, "mpg123", "-q", "-s", "-b", "1024", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
/* But many places has it in /usr/bin */
@@ -80,15 +80,15 @@ static int mp3play(char *filename, int fd)
return -1;
}
static int timed_read(int fd, void *data, int datalen)
static int timed_read(int fd, void *data, int datalen, int timeout)
{
int res;
struct pollfd fds[1];
fds[0].fd = fd;
fds[0].events = POLLIN;
res = poll(fds, 1, 2000);
res = poll(fds, 1, timeout);
if (res < 1) {
ast_log(LOG_NOTICE, "Selected timed out/errored out with %d\n", res);
ast_log(LOG_NOTICE, "Poll timed out/errored out with %d\n", res);
return -1;
}
return read(fd, data, datalen);
@@ -103,6 +103,7 @@ static int mp3_exec(struct ast_channel *chan, void *data)
int ms = -1;
int pid = -1;
int owriteformat;
int timeout = 2000;
struct timeval now, next;
struct ast_frame *f;
struct myframe {
@@ -110,7 +111,6 @@ static int mp3_exec(struct ast_channel *chan, void *data)
char offset[AST_FRIENDLY_OFFSET];
short frdata[160];
} myf;
if (!data) {
ast_log(LOG_WARNING, "MP3 Playback requires an argument (filename)\n");
return -1;
@@ -131,6 +131,9 @@ static int mp3_exec(struct ast_channel *chan, void *data)
gettimeofday(&now, NULL);
res = mp3play((char *)data, fds[1]);
if (!strncasecmp((char *)data, "http://", 7)) {
timeout = 10000;
}
/* Wait 1000 ms first */
next = now;
next.tv_sec += 1;
@@ -155,7 +158,7 @@ static int mp3_exec(struct ast_channel *chan, void *data)
last = tv;
}
#endif
res = timed_read(fds[0], myf.frdata, sizeof(myf.frdata));
res = timed_read(fds[0], myf.frdata, sizeof(myf.frdata), timeout);
if (res > 0) {
myf.f.frametype = AST_FRAME_VOICE;
myf.f.subclass = AST_FORMAT_SLINEAR;

0
apps/app_nbscat.c Executable file → Normal file
View File

0
apps/app_osplookup.c Executable file → Normal file
View File

2
apps/app_parkandannounce.c Executable file → Normal file
View File

@@ -94,7 +94,7 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
}
dial=strsep(&s, "|");
if(!dial) {
ast_log(LOG_WARNING, "PARK: A dial resouce must be specified i.e: Console/dsp or Zap/g1/5551212\n");
ast_log(LOG_WARNING, "PARK: A dial resource must be specified i.e: Console/dsp or Zap/g1/5551212\n");
free(orig_s);
return -1;
} else {

0
apps/app_playback.c Executable file → Normal file
View File

0
apps/app_privacy.c Executable file → Normal file
View File

0
apps/app_qcall.c Executable file → Normal file
View File

35
apps/app_queue.c Executable file → Normal file
View File

@@ -208,6 +208,7 @@ struct ast_call_queue {
char sound_calls[80]; /* Sound file: "calls waiting to speak to a representative." (def. queue-callswaiting)*/
char sound_holdtime[80]; /* Sound file: "The current estimated total holdtime is" (def. queue-holdtime) */
char sound_minutes[80]; /* Sound file: "minutes." (def. queue-minutes) */
char sound_lessthan[80]; /* Sound file: "less-than" (def. queue-lessthan) */
char sound_seconds[80]; /* Sound file: "seconds." (def. queue-seconds) */
char sound_thanks[80]; /* Sound file: "Thank you for your patience." (def. queue-thankyou) */
@@ -225,6 +226,7 @@ struct ast_call_queue {
int wrapped; /* Round Robin - wrapped around? */
int joinempty; /* Do we care if the queue has no members? */
int eventwhencalled; /* Generate an event when the agent is called (before pickup) */
int leavewhenempty; /* If all agents leave the queue, remove callers from the queue */
struct member *members; /* Member channels to be tried */
struct queue_ent *head; /* Start of the actual queue */
@@ -434,7 +436,11 @@ static int say_position(struct queue_ent *qe)
if ((avgholdmins+avgholdsecs) > 0 && (qe->parent->announceholdtime) && (!(qe->parent->announceholdtime==1 && qe->last_pos)) ) {
res += play_file(qe->chan, qe->parent->sound_holdtime);
if(avgholdmins>0) {
res += ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, (char*) NULL);
if (avgholdmins < 2) {
res += play_file(qe->chan, qe->parent->sound_lessthan);
res += ast_say_number(qe->chan, 2, AST_DIGIT_ANY, qe->chan->language, (char *)NULL);
} else
res += ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, (char*) NULL);
res += play_file(qe->chan, qe->parent->sound_minutes);
}
if(avgholdsecs>0) {
@@ -907,6 +913,12 @@ static int wait_our_turn(struct queue_ent *qe, int ringing)
break;
}
/* leave the queue if no agents, if enabled */
if (!(qe->parent->members) && qe->parent->leavewhenempty) {
leave_queue(qe);
break;
}
/* Make a position announcement, if enabled */
if (qe->parent->announcefrequency && !ringing)
say_position(qe);
@@ -1621,7 +1633,7 @@ check_turns:
/* This is the wait loop for the head caller*/
/* To exit, they may get their call answered; */
/* they may dial a digit from the queue context; */
/* or, they may may timeout. */
/* or, they may timeout. */
/* Leave if we have exceeded our queuetimeout */
if (qe.queuetimeout && ( (time(NULL) - qe.start) >= qe.queuetimeout) ) {
@@ -1629,6 +1641,12 @@ check_turns:
break;
}
/* leave the queue if no agents, if enabled */
if (!((qe.parent)->members) && (qe.parent)->leavewhenempty) {
leave_queue(&qe);
break;
}
/* Make a position announcement, if enabled */
if (qe.parent->announcefrequency && !ringing)
say_position(&qe);
@@ -1686,7 +1704,7 @@ check_turns:
}
}
/* Don't allow return code > 0 */
if (res > 0 && res != AST_PBX_KEEPALIVE) {
if ((res == 0) || (res > 0 && res != AST_PBX_KEEPALIVE)) {
res = 0;
if (ringing) {
ast_indicate(chan, -1);
@@ -1776,6 +1794,7 @@ static void reload_queues(void)
strncpy(q->sound_minutes, "queue-minutes", sizeof(q->sound_minutes) - 1);
strncpy(q->sound_seconds, "queue-seconds", sizeof(q->sound_seconds) - 1);
strncpy(q->sound_thanks, "queue-thankyou", sizeof(q->sound_thanks) - 1);
strncpy(q->sound_lessthan, "queue-less-than", sizeof(q->sound_lessthan) - 1);
prev = q->members;
if (prev) {
/* find the end of any dynamic members */
@@ -1812,7 +1831,7 @@ static void reload_queues(void)
q->members = cur;
prev = cur;
}
} else if (!strcasecmp(var->name, "music")) {
} else if (!strcasecmp(var->name, "music") || !strcasecmp(var->name, "musiconhold")) {
strncpy(q->moh, var->value, sizeof(q->moh) - 1);
} else if (!strcasecmp(var->name, "announce")) {
strncpy(q->announce, var->value, sizeof(q->announce) - 1);
@@ -1836,6 +1855,8 @@ static void reload_queues(void)
strncpy(q->sound_minutes, var->value, sizeof(q->sound_minutes) - 1);
} else if (!strcasecmp(var->name, "queue-seconds")) {
strncpy(q->sound_seconds, var->value, sizeof(q->sound_seconds) - 1);
} else if (!strcasecmp(var->name, "queue-lessthan")) {
strncpy(q->sound_lessthan, var->value, sizeof(q->sound_lessthan) - 1);
} else if (!strcasecmp(var->name, "queue-thankyou")) {
strncpy(q->sound_thanks, var->value, sizeof(q->sound_thanks) - 1);
} else if (!strcasecmp(var->name, "announce-frequency")) {
@@ -1864,6 +1885,8 @@ static void reload_queues(void)
}
} else if (!strcasecmp(var->name, "joinempty")) {
q->joinempty = ast_true(var->value);
} else if (!strcasecmp(var->name, "leavewhenempty")) {
q->leavewhenempty = ast_true(var->value);
} else if (!strcasecmp(var->name, "eventwhencalled")) {
q->eventwhencalled = ast_true(var->value);
} else {
@@ -2047,6 +2070,7 @@ static int manager_queues_status( struct mansession *s, struct message *m )
/* List queue properties */
if(q->callscompleted > 0)
sl = 100*((float)q->callscompletedinsl/(float)q->callscompleted);
ast_mutex_lock(&s->lock);
ast_cli(s->fd, "Event: QueueParams\r\n"
"Queue: %s\r\n"
"Max: %d\r\n"
@@ -2088,6 +2112,7 @@ static int manager_queues_status( struct mansession *s, struct message *m )
"%s"
"\r\n",
q->name, pos++, qe->chan->name, (qe->chan->callerid ? qe->chan->callerid : ""), (long)(now - qe->start), idText);
ast_mutex_unlock(&s->lock);
ast_mutex_unlock(&q->lock);
}
ast_mutex_unlock(&qlock);
@@ -2174,7 +2199,7 @@ static int handle_add_queue_member(int fd, int argc, char *argv[])
return RESULT_SHOWUSAGE;
} else if (strcmp(argv[4], "to")) {
return RESULT_SHOWUSAGE;
} else if ((argc == 8) && strcmp(argv[6], "priority")) {
} else if ((argc == 8) && strcmp(argv[6], "penalty")) {
return RESULT_SHOWUSAGE;
}

0
apps/app_random.c Executable file → Normal file
View File

8
apps/app_read.c Executable file → Normal file
View File

@@ -103,9 +103,13 @@ static int read_exec(struct ast_channel *chan, void *data)
if (!res) {
ast_stopstream(chan);
res = ast_app_getdata(chan, filename, tmp, maxdigits, 0);
if (res > -1)
if (res > -1) {
pbx_builtin_setvar_helper(chan, varname, tmp);
ast_verbose(VERBOSE_PREFIX_3 "User entered '%s'\n", tmp);
ast_verbose(VERBOSE_PREFIX_3 "User entered '%s'\n", tmp);
res = 0;
} else {
ast_verbose(VERBOSE_PREFIX_3 "User disconnected\n");
}
}
LOCAL_USER_REMOVE(u);
return res;

32
apps/app_record.c Executable file → Normal file
View File

@@ -56,7 +56,7 @@ static int record_exec(struct ast_channel *chan, void *data)
char fil[256];
char tmp[256];
char ext[10];
char * vdata; /* Used so I don't have to typecast every use of *data */
char *vdata;
int i = 0;
int j = 0;
@@ -78,15 +78,32 @@ static int record_exec(struct ast_channel *chan, void *data)
int option_skip = 0;
int option_noanswer = 0;
int rfmt = 0;
int flags;
char *end=NULL;
char *p=NULL;
vdata = data; /* explained above */
/* The next few lines of code parse out the filename and header from the input string */
if (!vdata) { /* no data implies no filename or anything is present */
if (!data) { /* no data implies no filename or anything is present */
ast_log(LOG_WARNING, "Record requires an argument (filename)\n");
return -1;
}
vdata = ast_strdupa(data);
p = vdata;
while(p && (p=strchr(p,':'))) {
end=p;
if(!strcasecmp(end,":end")) {
*end='\0';
end++;
break;
}
p++;
end=NULL;
}
for (; vdata[i] && (vdata[i] != ':') && (vdata[i] != '|'); i++ ) {
if ((vdata[i] == '%') && (vdata[i+1] == 'd')) {
percentflag = 1; /* the wildcard is used */
@@ -205,8 +222,11 @@ static int record_exec(struct ast_channel *chan, void *data)
ast_dsp_set_threshold(sildet, 256);
}
s = ast_writefile( tmp, ext, NULL, O_CREAT|O_TRUNC|O_WRONLY , 0, 0644);
flags = end ? O_CREAT|O_APPEND|O_WRONLY : O_CREAT|O_TRUNC|O_WRONLY;
s = ast_writefile( tmp, ext, NULL, flags , 0, 0644);
if (s) {
if (maxduration > 0)
timeout = time(NULL) + (time_t)maxduration;
@@ -281,7 +301,7 @@ static int record_exec(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name);
LOCAL_USER_REMOVE(u);
if (silence > 0) {
if ((silence > 0) && rfmt) {
res = ast_set_read_format(chan, rfmt);
if (res)
ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name);

294
apps/app_rpt.c Executable file → Normal file
View File

@@ -3,7 +3,7 @@
* Asterisk -- A telephony toolkit for Linux.
*
* Radio Repeater / Remote Base program
* version 0.13 7/12/04
* version 0.17 9/13/04
*
* See http://www.zapatatelephony.org/app_rpt.html
*
@@ -103,6 +103,8 @@ enum {REM_LOWPWR,REM_MEDPWR,REM_HIPWR};
enum {DC_INDETERMINATE, DC_REQ_FLUSH, DC_ERROR, DC_COMPLETE};
enum {SOURCE_RPT, SOURCE_LNK, SOURCE_RMT};
enum {DLY_TELEM, DLY_ID, DLY_UNKEY, DLY_CALLTERM};
#include <asterisk/utils.h>
#include <asterisk/lock.h>
#include <asterisk/file.h>
@@ -114,7 +116,6 @@ enum {SOURCE_RPT, SOURCE_LNK, SOURCE_RMT};
#include <asterisk/translate.h>
#include <asterisk/options.h>
#include <asterisk/config.h>
#include <asterisk/utils.h>
#include <asterisk/say.h>
#include <asterisk/localtime.h>
#include <stdio.h>
@@ -136,7 +137,7 @@ enum {SOURCE_RPT, SOURCE_LNK, SOURCE_RMT};
#include <tonezone.h>
#include <linux/zaptel.h>
static char *tdesc = "Radio Repeater / Remote Base version 0.13 07/12/2004";
static char *tdesc = "Radio Repeater / Remote Base version 0.17 09/13/2004";
static char *app = "Rpt";
static char *synopsis = "Radio Repeater/Remote Base Control System";
@@ -160,6 +161,7 @@ LOCAL_USER_DECL;
#define IDTIME 300000
#define MAXRPTS 20
#define POLITEID 30000
#define FUNCTDELAY 1500
static pthread_t rpt_master_thread;
@@ -237,7 +239,7 @@ static struct rpt
char remotetx;
char remoteon;
char simple;
char remote;
char *remote;
char tounkeyed;
char tonotify;
char enable;
@@ -621,20 +623,34 @@ static int telem_any(struct ast_channel *chan, char *entry)
* 4 types of telemtry are handled: Morse ID, Morse Message, Tone Sequence, and a File containing a recording.
*/
static int telem_lookup(struct ast_channel *chan, char *name)
static int telem_lookup(struct ast_channel *chan, char *node, char *name)
{
int res;
int i;
char *entry;
char *telemetry;
char *telemetry_save;
res = 0;
telemetry_save = NULL;
entry = NULL;
/* Retrieve the section name for telemetry from the node section */
telemetry = ast_variable_retrieve(cfg, node, TELEMETRY);
if(telemetry){
telemetry_save = ast_strdupa(telemetry);
if(!telemetry_save){
ast_log(LOG_WARNING,"ast_strdupa() failed in telem_lookup()\n");
return res;
}
entry = ast_variable_retrieve(cfg, telemetry_save, name);
}
/* Try to look up the telemetry name */
entry = ast_variable_retrieve(cfg, TELEMETRY, name);
if(!entry){
/* Telemetry name wasn't found in the config file, use the default */
for(i = 0; i < sizeof(tele_defs)/sizeof(struct telem_defaults) ; i++){
@@ -651,6 +667,67 @@ static int telem_lookup(struct ast_channel *chan, char *name)
return res;
}
/*
* Wait a configurable interval of time
*/
static void wait_interval(struct rpt *myrpt, int type)
{
int interval;
char *wait_times;
char *wait_times_save;
wait_times_save = NULL;
wait_times = ast_variable_retrieve(cfg, myrpt->name, "wait_times");
if(wait_times){
wait_times_save = ast_strdupa(wait_times);
if(!wait_times_save){
ast_log(LOG_WARNING, "Out of memory in wait_interval()\n");
wait_times = NULL;
}
}
switch(type){
case DLY_TELEM:
if(wait_times)
interval = retrieve_astcfgint(wait_times_save, "telemwait", 500, 5000, 1000);
else
interval = 1000;
break;
case DLY_ID:
if(wait_times)
interval = retrieve_astcfgint(wait_times_save, "idwait",250,5000,500);
else
interval = 500;
break;
case DLY_UNKEY:
if(wait_times)
interval = retrieve_astcfgint(wait_times_save, "unkeywait",500,5000,1000);
else
interval = 1000;
break;
case DLY_CALLTERM:
if(wait_times)
interval = retrieve_astcfgint(wait_times_save, "calltermwait",500,5000,1500);
else
interval = 1500;
break;
default:
return;
}
usleep(1000 * interval);
return;
}
static void *rpt_tele_thread(void *this)
{
ZT_CONFINFO ci; /* conference info */
@@ -713,8 +790,7 @@ struct tm localtm;
case ID:
case ID1:
/* wait a bit */
usleep(500000);
wait_interval(myrpt, (mytele->mode == ID) ? DLY_ID : DLY_TELEM);
res = telem_any(mychannel, ident);
imdone=1;
@@ -730,22 +806,22 @@ struct tm localtm;
case PROC:
/* wait a little bit longer */
usleep(1500000);
wait_interval(myrpt, DLY_TELEM);
res = ast_streamfile(mychannel, "rpt/callproceeding", mychannel->language);
break;
case TERM:
/* wait a little bit longer */
usleep(1500000);
wait_interval(myrpt, DLY_CALLTERM);
res = ast_streamfile(mychannel, "rpt/callterminated", mychannel->language);
break;
case COMPLETE:
/* wait a little bit */
usleep(1000000);
res = telem_lookup(mychannel, "functcomplete");
wait_interval(myrpt, DLY_TELEM);
res = telem_lookup(mychannel, myrpt->name, "functcomplete");
break;
case UNKEY:
/* wait a little bit */
usleep(1000000);
wait_interval(myrpt, DLY_UNKEY);
hastx = 0;
@@ -760,7 +836,7 @@ struct tm localtm;
}
ast_mutex_unlock(&myrpt->lock);
res = telem_lookup(mychannel,(!hastx) ? "remotemon" : "remotetx");
res = telem_lookup(mychannel, myrpt->name, (!hastx) ? "remotemon" : "remotetx");
if(res)
ast_log(LOG_WARNING, "telem_lookup:remotexx failed on %s\n", mychannel->name);
@@ -769,7 +845,7 @@ struct tm localtm;
if (myrpt->cmdnode[0])
{
ast_safe_sleep(mychannel,200);
res = telem_lookup(mychannel, "cmdmode");
res = telem_lookup(mychannel, myrpt->name, "cmdmode");
if(res)
ast_log(LOG_WARNING, "telem_lookup:cmdmode failed on %s\n", mychannel->name);
ast_stopstream(mychannel);
@@ -777,7 +853,7 @@ struct tm localtm;
}
else if((ct = ast_variable_retrieve(cfg, nodename, "unlinkedct"))){ /* Unlinked Courtesy Tone */
ct_copy = ast_strdupa(ct);
res = telem_lookup(mychannel, ct_copy);
res = telem_lookup(mychannel, myrpt->name, ct_copy);
if(res)
ast_log(LOG_WARNING, "telem_lookup:ctx failed on %s\n", mychannel->name);
}
@@ -786,7 +862,7 @@ struct tm localtm;
break;
case REMDISC:
/* wait a little bit */
usleep(1000000);
wait_interval(myrpt, DLY_TELEM);
res = ast_streamfile(mychannel, "rpt/node", mychannel->language);
if (!res)
res = ast_waitstream(mychannel, "");
@@ -799,22 +875,22 @@ struct tm localtm;
break;
case REMALREADY:
/* wait a little bit */
usleep(1000000);
wait_interval(myrpt, DLY_TELEM);
res = ast_streamfile(mychannel, "rpt/remote_already", mychannel->language);
break;
case REMNOTFOUND:
/* wait a little bit */
usleep(1000000);
wait_interval(myrpt, DLY_TELEM);
res = ast_streamfile(mychannel, "rpt/remote_notfound", mychannel->language);
break;
case REMGO:
/* wait a little bit */
usleep(1000000);
wait_interval(myrpt, DLY_TELEM);
res = ast_streamfile(mychannel, "rpt/remote_go", mychannel->language);
break;
case CONNECTED:
/* wait a little bit */
usleep(1000000);
wait_interval(myrpt, DLY_TELEM);
res = ast_streamfile(mychannel, "rpt/node", mychannel->language);
if (!res)
res = ast_waitstream(mychannel, "");
@@ -836,7 +912,7 @@ struct tm localtm;
break;
case STATUS:
/* wait a little bit */
usleep(1000000);
wait_interval(myrpt, DLY_TELEM);
hastx = 0;
linkbase.next = &linkbase;
linkbase.prev = &linkbase;
@@ -936,9 +1012,9 @@ struct tm localtm;
break;
case STATS_TIME:
usleep(1000000); /* Wait a little bit */
wait_interval(myrpt, DLY_TELEM); /* Wait a little bit */
t = time(NULL);
ast_localtime(&t, &localtm, NULL);
localtime_r(&t, &localtm);
/* Say the phase of the day is before the time */
if((localtm.tm_hour >= 0) && (localtm.tm_hour < 12))
p = "rpt/goodmorning";
@@ -970,7 +1046,7 @@ struct tm localtm;
break;
if(sscanf(p, "version %d.%d", &vmajor, &vminor) != 2)
break;
usleep(1000000); /* Wait a little bit */
wait_interval(myrpt, DLY_TELEM); /* Wait a little bit */
/* Say "version" */
if (sayfile(mychannel,"rpt/version") == -1)
{
@@ -998,7 +1074,7 @@ struct tm localtm;
imdone = 1;
break;
case ARB_ALPHA:
usleep(1000000); /* Wait a little bit */
wait_interval(myrpt, DLY_TELEM); /* Wait a little bit */
if(mytele->param)
saycharstr(mychannel, mytele->param);
imdone = 1;
@@ -2469,7 +2545,10 @@ static int setrbi(struct rpt *myrpt)
char tmp[MAXREMSTR] = "",rbicmd[5],*s;
int band,txoffset = 0,txpower = 0,rxpl;
/* must be a remote system */
if (!myrpt->remote) return(0);
/* must have rbi hardware */
if (strncmp(myrpt->remote,"rbi",3)) return(0);
strncpy(tmp, myrpt->freq, sizeof(tmp) - 1);
s = strchr(tmp,'.');
/* if no decimal, is invalid */
@@ -2663,7 +2742,7 @@ int seq,res;
ast_indicate(myrpt->remchannel,AST_CONTROL_RADIO_KEY);
}
if (ast_safe_sleep(myrpt->remchannel,1000) == -1) return -1;
res = telem_lookup(myrpt->remchannel,"functcomplete");
res = telem_lookup(myrpt->remchannel, myrpt->name, "functcomplete");
if (!myrpt->remoterx)
{
ast_indicate(myrpt->remchannel,AST_CONTROL_RADIO_UNKEY);
@@ -2683,21 +2762,32 @@ time_t dtmf_time,t;
struct rpt_link *l,*m;
struct rpt_tele *telem;
pthread_attr_t attr;
char tmpstr[300];
char cmd[MAXDTMF+1] = "";
ast_mutex_lock(&myrpt->lock);
tele = strchr(myrpt->rxchanname,'/');
strncpy(tmpstr,myrpt->rxchanname,sizeof(tmpstr) - 1);
tele = strchr(tmpstr,'/');
if (!tele)
{
fprintf(stderr,"rpt:Dial number (%s) must be in format tech/number\n",myrpt->rxchanname);
ast_mutex_unlock(&myrpt->lock);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
*tele++ = 0;
myrpt->rxchannel = ast_request(myrpt->rxchanname,AST_FORMAT_SLINEAR,tele);
myrpt->rxchannel = ast_request(tmpstr,AST_FORMAT_SLINEAR,tele);
if (myrpt->rxchannel)
{
if (myrpt->rxchannel->_state == AST_STATE_BUSY)
{
fprintf(stderr,"rpt:Sorry unable to obtain Rx channel\n");
ast_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->rxchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
ast_set_read_format(myrpt->rxchannel,AST_FORMAT_SLINEAR);
ast_set_write_format(myrpt->rxchannel,AST_FORMAT_SLINEAR);
myrpt->rxchannel->whentohangup = 0;
@@ -2705,28 +2795,47 @@ char cmd[MAXDTMF+1] = "";
myrpt->rxchannel->data = "(Repeater Rx)";
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
myrpt->rxchanname,tele,myrpt->rxchannel->name);
tmpstr,tele,myrpt->rxchannel->name);
ast_call(myrpt->rxchannel,tele,999);
if (myrpt->rxchannel->_state != AST_STATE_UP)
{
ast_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->rxchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
}
else
{
fprintf(stderr,"rpt:Sorry unable to obtain Rx channel\n");
ast_mutex_unlock(&myrpt->lock);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
if (myrpt->txchanname)
{
tele = strchr(myrpt->txchanname,'/');
strncpy(tmpstr,myrpt->txchanname,sizeof(tmpstr) - 1);
tele = strchr(tmpstr,'/');
if (!tele)
{
fprintf(stderr,"rpt:Dial number (%s) must be in format tech/number\n",myrpt->txchanname);
ast_mutex_unlock(&myrpt->lock);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
*tele++ = 0;
myrpt->txchannel = ast_request(myrpt->txchanname,AST_FORMAT_SLINEAR,tele);
myrpt->txchannel = ast_request(tmpstr,AST_FORMAT_SLINEAR,tele);
if (myrpt->txchannel)
{
if (myrpt->txchannel->_state == AST_STATE_BUSY)
{
fprintf(stderr,"rpt:Sorry unable to obtain Tx channel\n");
ast_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->txchannel);
ast_hangup(myrpt->rxchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
ast_set_read_format(myrpt->txchannel,AST_FORMAT_SLINEAR);
ast_set_write_format(myrpt->txchannel,AST_FORMAT_SLINEAR);
myrpt->txchannel->whentohangup = 0;
@@ -2734,13 +2843,23 @@ char cmd[MAXDTMF+1] = "";
myrpt->txchannel->data = "(Repeater Rx)";
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
myrpt->txchanname,tele,myrpt->txchannel->name);
tmpstr,tele,myrpt->txchannel->name);
ast_call(myrpt->txchannel,tele,999);
if (myrpt->rxchannel->_state != AST_STATE_UP)
{
ast_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->rxchannel);
ast_hangup(myrpt->txchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
}
else
{
fprintf(stderr,"rpt:Sorry unable to obtain Tx channel\n");
ast_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->rxchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
}
@@ -2754,6 +2873,10 @@ char cmd[MAXDTMF+1] = "";
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
ast_mutex_unlock(&myrpt->lock);
if (myrpt->txchannel != myrpt->rxchannel)
ast_hangup(myrpt->txchannel);
ast_hangup(myrpt->rxchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
/* make a conference for the tx */
@@ -2765,6 +2888,11 @@ char cmd[MAXDTMF+1] = "";
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
ast_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->pchannel);
if (myrpt->txchannel != myrpt->rxchannel)
ast_hangup(myrpt->txchannel);
ast_hangup(myrpt->rxchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
/* save tx conference number */
@@ -2778,6 +2906,11 @@ char cmd[MAXDTMF+1] = "";
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
ast_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->pchannel);
if (myrpt->txchannel != myrpt->rxchannel)
ast_hangup(myrpt->txchannel);
ast_hangup(myrpt->rxchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
/* save pseudo channel conference number */
@@ -2788,6 +2921,11 @@ char cmd[MAXDTMF+1] = "";
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
ast_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->pchannel);
if (myrpt->txchannel != myrpt->rxchannel)
ast_hangup(myrpt->txchannel);
ast_hangup(myrpt->rxchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
/* make a conference for the tx */
@@ -2799,6 +2937,12 @@ char cmd[MAXDTMF+1] = "";
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
ast_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->txpchannel);
ast_hangup(myrpt->pchannel);
if (myrpt->txchannel != myrpt->rxchannel)
ast_hangup(myrpt->txchannel);
ast_hangup(myrpt->rxchannel);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
/* Now, the idea here is to copy from the physical rx channel buffer
@@ -2840,6 +2984,9 @@ char cmd[MAXDTMF+1] = "";
if (ast_check_hangup(myrpt->txpchannel)) break;
ast_mutex_lock(&myrpt->lock);
myrpt->localtx = keyed && (myrpt->dtmfidx == -1) && (!myrpt->cmdnode[0]);
/* If someone's connected, and they're transmitting from their end to us, set remrx true */
l = myrpt->links.next;
remrx = 0;
while(l != &myrpt->links)
@@ -2921,8 +3068,8 @@ char cmd[MAXDTMF+1] = "";
if (!myrpt->totimer) myrpt->tailtimer = 0;
/* if not timed-out, add in tail */
if (myrpt->totimer) totx = totx || myrpt->tailtimer;
/* If user keys up or is keyed up over standard ID, switch to talkover ID, if one is defined */
if (identqueued && keyed && idtalkover) {
/* If user or links key up or are keyed up over standard ID, switch to talkover ID, if one is defined */
if (identqueued && (keyed || remrx) && idtalkover) {
int hasid = 0,hastalkover = 0;
telem = myrpt->tele.next;
@@ -3381,8 +3528,8 @@ char cmd[MAXDTMF+1] = "";
ast_mutex_lock(&myrpt->lock);
ast_hangup(myrpt->pchannel);
ast_hangup(myrpt->txpchannel);
ast_hangup(myrpt->rxchannel);
if (myrpt->txchannel != myrpt->rxchannel) ast_hangup(myrpt->txchannel);
ast_hangup(myrpt->rxchannel);
l = myrpt->links.next;
while(l != &myrpt->links)
{
@@ -3397,6 +3544,7 @@ char cmd[MAXDTMF+1] = "";
}
ast_mutex_unlock(&myrpt->lock);
if (debug) printf("@@@@ rpt:Hung up channel\n");
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
return NULL;
}
@@ -3408,6 +3556,7 @@ static void *rpt_master(void *ignore)
char *this,*val;
struct ast_variable *vp;
int i,j,n,longestnode;
pthread_attr_t attr;
/* start with blank config */
memset(&rpt_vars,0,sizeof(rpt_vars));
@@ -3449,6 +3598,7 @@ int i,j,n,longestnode;
ast_mutex_init(&rpt_vars[n].lock);
rpt_vars[n].tele.next = &rpt_vars[n].tele;
rpt_vars[n].tele.prev = &rpt_vars[n].tele;
rpt_vars[n].rpt_thread = AST_PTHREADT_NULL;
rpt_vars[n].name = this;
rpt_vars[n].rxchanname = ast_variable_retrieve(cfg,this,"rxchannel");
rpt_vars[n].txchanname = ast_variable_retrieve(cfg,this,"txchannel");
@@ -3466,10 +3616,7 @@ int i,j,n,longestnode;
rpt_vars[n].idtime = retrieve_astcfgint( this, "idtime", 60000, 2400000, IDTIME); /* Enforce a min max */
rpt_vars[n].politeid = retrieve_astcfgint( this, "politeid", 30000, 300000, POLITEID); /* Enforce a min max */
val = ast_variable_retrieve(cfg,this,"remote");
if (val) rpt_vars[n].remote = ast_true(val);
else rpt_vars[n].remote = 0;
rpt_vars[n].remote = ast_variable_retrieve(cfg,this,"remote");
rpt_vars[n].tonezone = ast_variable_retrieve(cfg,this,"tonezone");
val = ast_variable_retrieve(cfg,this,"iobase");
if (val) rpt_vars[n].iobase = atoi(val);
@@ -3540,16 +3687,39 @@ int i,j,n,longestnode;
ast_log(LOG_WARNING,"Did not specify ident for node %s\n",rpt_vars[i].name);
pthread_exit(NULL);
}
ast_pthread_create(&rpt_vars[i].rpt_thread,NULL,rpt,(void *) &rpt_vars[i]);
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ast_pthread_create(&rpt_vars[i].rpt_thread,&attr,rpt,(void *) &rpt_vars[i]);
}
usleep(500000);
for(;;)
{
/* Now monitor each thread, and restart it if necessary */
for(i = 0; i < n; i++)
{
int rv;
if (rpt_vars[i].remote) continue;
if (rpt_vars[i].rpt_thread == AST_PTHREADT_STOP)
rv = -1;
else
rv = pthread_kill(rpt_vars[i].rpt_thread,0);
if (rv)
{
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ast_pthread_create(&rpt_vars[i].rpt_thread,&attr,rpt,(void *) &rpt_vars[i]);
ast_log(LOG_WARNING, "rpt_thread restarted on node %s\n", rpt_vars[i].name);
}
}
usleep(2000000);
}
/* wait for first one to die (should be never) */
pthread_join(rpt_vars[0].rpt_thread,NULL);
pthread_exit(NULL);
}
static int rpt_exec(struct ast_channel *chan, void *data)
{
int res=-1,i,keyed = 0,rem_totx;
int res=-1,i,keyed = 0,rem_totx,n;
struct localuser *u;
char tmp[256];
char *options,*stringp,*tele;
@@ -3705,7 +3875,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
ast_set_write_format(myrpt->rxchannel,AST_FORMAT_SLINEAR);
myrpt->rxchannel->whentohangup = 0;
myrpt->rxchannel->appl = "Apprpt";
myrpt->rxchannel->data = "(Repeater Rx)";
myrpt->rxchannel->data = "(Link Rx)";
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "rpt (Rx) initiating call to %s/%s on %s\n",
myrpt->rxchanname,tele,myrpt->rxchannel->name);
@@ -3737,7 +3907,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
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 = "(Link Tx)";
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "rpt (Tx) initiating call to %s/%s on %s\n",
myrpt->txchanname,tele,myrpt->txchannel->name);
@@ -3776,14 +3946,17 @@ static int rpt_exec(struct ast_channel *chan, void *data)
if (chan->_state != AST_STATE_UP) {
ast_answer(chan);
}
cs[0] = chan;
cs[1] = myrpt->rxchannel;
n = 0;
cs[n++] = chan;
cs[n++] = myrpt->rxchannel;
if (myrpt->rxchannel != myrpt->txchannel)
cs[n++] = myrpt->txchannel;
for(;;)
{
if (ast_check_hangup(chan)) break;
if (ast_check_hangup(myrpt->rxchannel)) break;
ms = MSWAIT;
who = ast_waitfor_n(cs,2,&ms);
who = ast_waitfor_n(cs,n,&ms);
if (who == NULL) ms = 0;
elap = MSWAIT - ms;
if (!ms) continue;
@@ -3895,6 +4068,27 @@ static int rpt_exec(struct ast_channel *chan, void *data)
ast_frfree(f);
continue;
}
if ((myrpt->rxchannel != myrpt->txchannel) &&
(who == myrpt->txchannel)) /* do this cuz you have to */
{
f = ast_read(myrpt->txchannel);
if (!f)
{
if (debug) printf("@@@@ link:Hung Up\n");
break;
}
if (f->frametype == AST_FRAME_CONTROL)
{
if (f->subclass == AST_CONTROL_HANGUP)
{
if (debug) printf("@@@@ rpt:Hung Up\n");
ast_frfree(f);
break;
}
}
ast_frfree(f);
continue;
}
}
ast_mutex_lock(&myrpt->lock);

0
apps/app_sayunixtime.c Executable file → Normal file
View File

0
apps/app_senddtmf.c Executable file → Normal file
View File

0
apps/app_sendtext.c Executable file → Normal file
View File

0
apps/app_setcallerid.c Executable file → Normal file
View File

0
apps/app_setcdruserfield.c Executable file → Normal file
View File

0
apps/app_setcidname.c Executable file → Normal file
View File

0
apps/app_setcidnum.c Executable file → Normal file
View File

0
apps/app_skel.c Executable file → Normal file
View File

19
apps/app_sms.c Executable file → Normal file
View File

@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <dirent.h>
#include <ctype.h>
#include "../astconf.h"
/* ToDo */
/* When acting as SC and answering, should check for messages and send instead of sending EST as first packet */
@@ -36,6 +37,9 @@
static unsigned char message_ref; /* arbitary message ref */
static char log_file[255];
static char spool_dir[255];
static char *tdesc = "SMS/PSTN handler";
static char *app = "SMS";
@@ -203,7 +207,7 @@ static void
packdate (unsigned char *o, time_t w)
{
struct tm *t = localtime (&w);
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__)
int z = - t->tm_gmtoff / 3600 / 15;
#else
int z = timezone / 3600 / 15;
@@ -315,7 +319,7 @@ sms_log (sms_t * h, char status)
{ /* log the output, and remove file */
if (*h->oa || *h->da)
{
int o = open ("/var/log/asterisk/sms", O_CREAT | O_APPEND | O_WRONLY, 0666);
int o = open (log_file, O_CREAT | O_APPEND | O_WRONLY, 0666);
if (o >= 0)
{
char line[1000], *p;
@@ -517,7 +521,7 @@ sms_writefile (sms_t * h)
char fn2[200] = "";
FILE *o;
strncpy(fn, "/var/spool/asterisk/sms", sizeof(fn) - 1);
strncpy(fn, spool_dir, sizeof(fn) - 1);
mkdir (fn, 0777); /* ensure it exists */
snprintf(fn + strlen(fn), sizeof(fn) - strlen(fn), "/%s.%s", h->smsc ? "me-sc" : "sc-me", h->queue);
mkdir (fn, 0777); /* ensure it exists */
@@ -689,7 +693,7 @@ sms_nextoutgoing (sms_t * h)
DIR *d;
char more = 0;
strncpy(fn, "/var/spool/asterisk/sms", sizeof(fn) - 1);
strncpy(fn, spool_dir, sizeof(fn) - 1);
mkdir(fn, 0777); /* ensure it exists */
snprintf(fn + strlen (fn), sizeof(fn) - strlen(fn), "/%s.%s", h->smsc ? "sc-me" : "me-sc", h->queue);
mkdir (fn, 0777); /* ensure it exists */
@@ -769,6 +773,7 @@ sms_nextoutgoing (sms_t * h)
{ /* no message */
h->omsg[0] = 0x94; /* SMS_REL */
h->omsg[1] = 0;
h->hangup = 1;
sms_messagetx (h);
}
}
@@ -1069,11 +1074,11 @@ sms_exec(struct ast_channel *chan, void *data)
return -1;
}
for (p = d; *p && *p != '|'; p++);
if (p - d >= sizeof (h.queue)) {
if (p - d + 1 >= sizeof (h.queue)) {
ast_log (LOG_ERROR, "Queue name too long\n");
return -1;
}
strncpy(h.queue, d, p - d - 1);
strncpy(h.queue, d, p - d);
if (*p == '|')
p++;
d = p;
@@ -1204,6 +1209,8 @@ load_module (void)
for (p = 0; p < 128; p++)
sms8to7[sms7to8[p]] = p;
}
snprintf(log_file, sizeof(log_file), "%s/sms", ast_config_AST_LOG_DIR);
snprintf(spool_dir, sizeof(spool_dir), "%s/sms", ast_config_AST_SPOOL_DIR);
return ast_register_application (app, sms_exec, synopsis, descrip);
}

0
apps/app_softhangup.c Executable file → Normal file
View File

0
apps/app_sql_postgres.c Executable file → Normal file
View File

0
apps/app_striplsd.c Executable file → Normal file
View File

0
apps/app_substring.c Executable file → Normal file
View File

35
apps/app_system.c Executable file → Normal file
View File

@@ -3,9 +3,9 @@
*
* Execute arbitrary system commands
*
* Copyright (C) 1999, Mark Spencer
* Copyright (C) 1999-2004, Digium, Inc.
*
* Mark Spencer <markster@linux-support.net>
* Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -28,8 +28,12 @@ static char *tdesc = "Generic System() application";
static char *app = "System";
static char *app2 = "TrySystem";
static char *synopsis = "Execute a system command";
static char *synopsis2 = "Try executing a system command";
static char *descrip =
" System(command): Executes a command by using system(). Returns -1 on\n"
"failure to execute the specified command. If the command itself executes\n"
@@ -37,27 +41,34 @@ static char *descrip =
"priority of the current instance, then the channel will be setup to\n"
"continue at that priority level. Otherwise, System returns 0.\n";
static char *descrip2 =
" TrySystem(command): Executes a command by using system(). Returns 0\n"
"on any situation. If the command itself executes but is in error, and if\n"
"there exists a priority n + 101, where 'n' is the priority of the current\n"
"instance, then the channel will be setup to continue at that\n"
"priority level. Otherwise, System returns 0.\n";
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
static int system_exec(struct ast_channel *chan, void *data)
static int system_exec_helper(struct ast_channel *chan, void *data, int failmode)
{
int res=0;
struct localuser *u;
if (!data) {
ast_log(LOG_WARNING, "System requires an argument(command)\n");
return -1;
return failmode;
}
LOCAL_USER_ADD(u);
/* Do our thing here */
res = ast_safe_system((char *)data);
if ((res < 0) && (errno != ECHILD)) {
ast_log(LOG_WARNING, "Unable to execute '%s'\n", (char *)data);
res = -1;
res = failmode;
} else if (res == 127) {
ast_log(LOG_WARNING, "Unable to execute '%s'\n", (char *)data);
res = -1;
res = failmode;
} else {
if (res < 0)
res = 0;
@@ -69,14 +80,26 @@ static int system_exec(struct ast_channel *chan, void *data)
return res;
}
static int system_exec(struct ast_channel *chan, void *data)
{
return system_exec_helper(chan, data, -1);
}
static int trysystem_exec(struct ast_channel *chan, void *data)
{
return system_exec_helper(chan, data, 0);
}
int unload_module(void)
{
STANDARD_HANGUP_LOCALUSERS;
ast_unregister_application(app2);
return ast_unregister_application(app);
}
int load_module(void)
{
ast_register_application(app2, trysystem_exec, synopsis2, descrip2);
return ast_register_application(app, system_exec, synopsis, descrip);
}

0
apps/app_talkdetect.c Executable file → Normal file
View File

473
apps/app_test.c Normal file
View File

@@ -0,0 +1,473 @@
/*
* Asterisk -- A telephony toolkit for Linux.
*
* Applications to test connection and produce report in text file
*
* Copyright (C) 2004, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
* Russell Bryant <russelb@clemson.edu>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
*/
#include <sys/types.h>
#include <asterisk/channel.h>
#include <asterisk/options.h>
#include <asterisk/module.h>
#include <asterisk/logger.h>
#include <asterisk/lock.h>
#include <asterisk/app.h>
#include <asterisk/pbx.h>
#include <asterisk/utils.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include "../astconf.h"
static char *tdesc = "Interface Test Application";
static char *tests_descrip =
"TestServer(): Perform test server function and write call report.\n"
"Results stored in /var/log/asterisk/testreports/<testid>-server.txt";
static char *tests_app = "TestServer";
static char *tests_synopsis = "Execute Interface Test Server";
static char *testc_descrip =
"TestClient(testid): Executes test client with given testid.\n"
"Results stored in /var/log/asterisk/testreports/<testid>-client.txt";
static char *testc_app = "TestClient";
static char *testc_synopsis = "Execute Interface Test Client";
static int measurenoise(struct ast_channel *chan, int ms, char *who)
{
int res=0;
int mssofar;
int noise=0;
int samples=0;
int x;
short *foo;
struct timeval start, tv;
struct ast_frame *f;
int rformat;
rformat = chan->readformat;
if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) {
ast_log(LOG_NOTICE, "Unable to set to linear mode!\n");
return -1;
}
gettimeofday(&start, NULL);
for(;;) {
gettimeofday(&tv, NULL);
mssofar = (tv.tv_sec - start.tv_sec) * 1000;
mssofar += (tv.tv_usec - start.tv_usec) / 1000;
if (mssofar > ms)
break;
res = ast_waitfor(chan, ms - mssofar);
if (res < 1)
break;
f = ast_read(chan);
if (!f) {
res = -1;
break;
}
if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) {
foo = (short *)f->data;
for (x=0;x<f->samples;x++) {
noise += abs(foo[x]);
samples++;
}
}
}
if (rformat) {
if (ast_set_read_format(chan, rformat)) {
ast_log(LOG_NOTICE, "Unable to restore original format!\n");
return -1;
}
}
if (res < 0)
return res;
if (!samples) {
ast_log(LOG_NOTICE, "No samples were received from the other side!\n");
return -1;
}
ast_log(LOG_DEBUG, "%s: Noise: %d, samples: %d, avg: %d\n", who, noise, samples, noise / samples);
return (noise / samples);
}
static int sendnoise(struct ast_channel *chan, int ms)
{
int res;
res = ast_tonepair_start(chan, 1537, 2195, ms, 8192);
if (!res) {
res = ast_waitfordigit(chan, ms);
ast_tonepair_stop(chan);
}
return res;
}
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
static int testclient_exec(struct ast_channel *chan, void *data)
{
struct localuser *u;
int res = 0;
char *testid=data;
char fn[80];
char serverver[80];
FILE *f;
LOCAL_USER_ADD(u);
/* Check for test id */
if (!testid || ast_strlen_zero(testid)) {
ast_log(LOG_WARNING, "TestClient requires an argument - the test id\n");
return -1;
}
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
/* Wait a few just to be sure things get started */
res = ast_safe_sleep(chan, 3000);
/* Transmit client version */
if (!res)
res = ast_dtmf_stream(chan, NULL, "8378*1#", 0);
ast_log(LOG_DEBUG, "Transmit client version\n");
/* Read server version */
ast_log(LOG_DEBUG, "Read server version\n");
if (!res)
res = ast_app_getdata(chan, NULL, serverver, sizeof(serverver) - 1, 0);
if (res > 0)
res = 0;
ast_log(LOG_DEBUG, "server version: %s\n", serverver);
if (res > 0)
res = 0;
if (!res)
res = ast_safe_sleep(chan, 1000);
/* Send test id */
if (!res)
res = ast_dtmf_stream(chan, NULL, testid, 0);
if (!res)
res = ast_dtmf_stream(chan, NULL, "#", 0);
ast_log(LOG_DEBUG, "send test identifier: %s\n", testid);
if ((res >=0) && (!ast_strlen_zero(testid))) {
/* Make the directory to hold the test results in case it's not there */
snprintf(fn, sizeof(fn), "%s/testresults", ast_config_AST_LOG_DIR);
mkdir(fn, 0777);
snprintf(fn, sizeof(fn), "%s/testresults/%s-client.txt", ast_config_AST_LOG_DIR, testid);
if ((f = fopen(fn, "w+"))) {
setlinebuf(f);
fprintf(f, "CLIENTCHAN: %s\n", chan->name);
fprintf(f, "CLIENTTEST ID: %s\n", testid);
fprintf(f, "ANSWER: PASS\n");
res = 0;
if (!res) {
/* Step 1: Wait for "1" */
ast_log(LOG_DEBUG, "TestClient: 2. Wait DTMF 1\n");
res = ast_waitfordigit(chan, 3000);
fprintf(f, "WAIT DTMF 1: %s\n", (res != '1') ? "FAIL" : "PASS");
if (res == '1')
res = 0;
else
res = -1;
}
if (!res)
res = ast_safe_sleep(chan, 1000);
if (!res) {
/* Step 2: Send "2" */
ast_log(LOG_DEBUG, "TestClient: 2. Send DTMF 2\n");
res = ast_dtmf_stream(chan, NULL, "2", 0);
fprintf(f, "SEND DTMF 2: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 3: Wait one second */
ast_log(LOG_DEBUG, "TestClient: 3. Wait one second\n");
res = ast_safe_sleep(chan, 1000);
fprintf(f, "WAIT 1 SEC: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 4: Measure noise */
ast_log(LOG_DEBUG, "TestClient: 4. Measure noise\n");
res = measurenoise(chan, 5000, "TestClient");
fprintf(f, "MEASURENOISE: %s (%d)\n", (res < 0) ? "FAIL" : "PASS", res);
if (res > 0)
res = 0;
}
if (!res) {
/* Step 5: Wait for "4" */
ast_log(LOG_DEBUG, "TestClient: 5. Wait DTMF 4\n");
res = ast_waitfordigit(chan, 3000);
fprintf(f, "WAIT DTMF 4: %s\n", (res != '4') ? "FAIL" : "PASS");
if (res == '4')
res = 0;
else
res = -1;
}
if (!res) {
/* Step 6: Transmit tone noise */
ast_log(LOG_DEBUG, "TestClient: 6. Transmit tone\n");
res = sendnoise(chan, 6000);
fprintf(f, "SENDTONE: %s\n", (res < 0) ? "FAIL" : "PASS");
}
if (!res || (res == '5')) {
/* Step 7: Wait for "5" */
ast_log(LOG_DEBUG, "TestClient: 7. Wait DTMF 5\n");
if (!res)
res = ast_waitfordigit(chan, 3000);
fprintf(f, "WAIT DTMF 5: %s\n", (res != '5') ? "FAIL" : "PASS");
if (res == '5')
res = 0;
else
res = -1;
}
if (!res) {
/* Step 8: Wait one second */
ast_log(LOG_DEBUG, "TestClient: 8. Wait one second\n");
res = ast_safe_sleep(chan, 1000);
fprintf(f, "WAIT 1 SEC: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 9: Measure noise */
ast_log(LOG_DEBUG, "TestClient: 6. Measure tone\n");
res = measurenoise(chan, 4000, "TestClient");
fprintf(f, "MEASURETONE: %s (%d)\n", (res < 0) ? "FAIL" : "PASS", res);
if (res > 0)
res = 0;
}
if (!res) {
/* Step 10: Send "7" */
ast_log(LOG_DEBUG, "TestClient: 7. Send DTMF 7\n");
res = ast_dtmf_stream(chan, NULL, "7", 0);
fprintf(f, "SEND DTMF 7: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res =0;
}
if (!res) {
/* Step 11: Wait for "8" */
ast_log(LOG_DEBUG, "TestClient: 11. Wait DTMF 8\n");
res = ast_waitfordigit(chan, 3000);
fprintf(f, "WAIT DTMF 8: %s\n", (res != '8') ? "FAIL" : "PASS");
if (res == '8')
res = 0;
else
res = -1;
}
if (!res) {
/* Step 12: Hangup! */
ast_log(LOG_DEBUG, "TestClient: 12. Hangup\n");
}
ast_log(LOG_DEBUG, "-- TEST COMPLETE--\n");
fprintf(f, "-- END TEST--\n");
fclose(f);
res = -1;
} else
res = -1;
} else {
ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name);
res = -1;
}
LOCAL_USER_REMOVE(u);
return res;
}
static int testserver_exec(struct ast_channel *chan, void *data)
{
struct localuser *u;
int res = 0;
char testid[80]="";
char fn[80];
FILE *f;
LOCAL_USER_ADD(u);
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
/* Read version */
ast_log(LOG_DEBUG, "Read client version\n");
if (!res)
res = ast_app_getdata(chan, NULL, testid, sizeof(testid) - 1, 0);
if (res > 0)
res = 0;
ast_log(LOG_DEBUG, "client version: %s\n", testid);
ast_log(LOG_DEBUG, "Transmit server version\n");
res = ast_safe_sleep(chan, 1000);
if (!res)
res = ast_dtmf_stream(chan, NULL, "8378*1#", 0);
if (res > 0)
res = 0;
if (!res)
res = ast_app_getdata(chan, NULL, testid, sizeof(testid) - 1, 0);
ast_log(LOG_DEBUG, "read test identifier: %s\n", testid);
/* Check for sneakyness */
if (strchr(testid, '/'))
res = -1;
if ((res >=0) && (!ast_strlen_zero(testid))) {
/* Got a Test ID! Whoo hoo! */
/* Make the directory to hold the test results in case it's not there */
snprintf(fn, sizeof(fn), "%s/testresults", ast_config_AST_LOG_DIR);
mkdir(fn, 0777);
snprintf(fn, sizeof(fn), "%s/testresults/%s-server.txt", ast_config_AST_LOG_DIR, testid);
if ((f = fopen(fn, "w+"))) {
setlinebuf(f);
fprintf(f, "SERVERCHAN: %s\n", chan->name);
fprintf(f, "SERVERTEST ID: %s\n", testid);
fprintf(f, "ANSWER: PASS\n");
ast_log(LOG_DEBUG, "Processing Test ID '%s'\n", testid);
res = ast_safe_sleep(chan, 1000);
if (!res) {
/* Step 1: Send "1" */
ast_log(LOG_DEBUG, "TestServer: 1. Send DTMF 1\n");
res = ast_dtmf_stream(chan, NULL, "1", 0);
fprintf(f, "SEND DTMF 1: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 2: Wait for "2" */
ast_log(LOG_DEBUG, "TestServer: 2. Wait DTMF 2\n");
res = ast_waitfordigit(chan, 3000);
fprintf(f, "WAIT DTMF 2: %s\n", (res != '2') ? "FAIL" : "PASS");
if (res == '2')
res = 0;
else
res = -1;
}
if (!res) {
/* Step 3: Measure noise */
ast_log(LOG_DEBUG, "TestServer: 3. Measure noise\n");
res = measurenoise(chan, 6000, "TestServer");
fprintf(f, "MEASURENOISE: %s (%d)\n", (res < 0) ? "FAIL" : "PASS", res);
if (res > 0)
res = 0;
}
if (!res) {
/* Step 4: Send "4" */
ast_log(LOG_DEBUG, "TestServer: 4. Send DTMF 4\n");
res = ast_dtmf_stream(chan, NULL, "4", 0);
fprintf(f, "SEND DTMF 4: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 5: Wait one second */
ast_log(LOG_DEBUG, "TestServer: 5. Wait one second\n");
res = ast_safe_sleep(chan, 1000);
fprintf(f, "WAIT 1 SEC: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 6: Measure noise */
ast_log(LOG_DEBUG, "TestServer: 6. Measure tone\n");
res = measurenoise(chan, 4000, "TestServer");
fprintf(f, "MEASURETONE: %s (%d)\n", (res < 0) ? "FAIL" : "PASS", res);
if (res > 0)
res = 0;
}
if (!res) {
/* Step 7: Send "5" */
ast_log(LOG_DEBUG, "TestServer: 7. Send DTMF 5\n");
res = ast_dtmf_stream(chan, NULL, "5", 0);
fprintf(f, "SEND DTMF 5: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 8: Transmit tone noise */
ast_log(LOG_DEBUG, "TestServer: 8. Transmit tone\n");
res = sendnoise(chan, 6000);
fprintf(f, "SENDTONE: %s\n", (res < 0) ? "FAIL" : "PASS");
}
if (!res || (res == '7')) {
/* Step 9: Wait for "7" */
ast_log(LOG_DEBUG, "TestServer: 9. Wait DTMF 7\n");
if (!res)
res = ast_waitfordigit(chan, 3000);
fprintf(f, "WAIT DTMF 7: %s\n", (res != '7') ? "FAIL" : "PASS");
if (res == '7')
res = 0;
else
res = -1;
}
if (!res)
res = ast_safe_sleep(chan, 1000);
if (!res) {
/* Step 10: Send "8" */
ast_log(LOG_DEBUG, "TestServer: 10. Send DTMF 8\n");
res = ast_dtmf_stream(chan, NULL, "8", 0);
fprintf(f, "SEND DTMF 8: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 11: Wait for hangup to arrive! */
ast_log(LOG_DEBUG, "TestServer: 11. Waiting for hangup\n");
res = ast_safe_sleep(chan, 10000);
fprintf(f, "WAIT HANGUP: %s\n", (res < 0) ? "PASS" : "FAIL");
}
ast_log(LOG_DEBUG, "-- TEST COMPLETE--\n");
fprintf(f, "-- END TEST--\n");
fclose(f);
res = -1;
} else
res = -1;
} else {
ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name);
res = -1;
}
LOCAL_USER_REMOVE(u);
return res;
}
int unload_module(void)
{
STANDARD_HANGUP_LOCALUSERS;
ast_unregister_application(testc_app);
return ast_unregister_application(tests_app);
}
int load_module(void)
{
ast_register_application(testc_app, testclient_exec, testc_synopsis, testc_descrip);
return ast_register_application(tests_app, testserver_exec, tests_synopsis, tests_descrip);
}
char *description(void)
{
return tdesc;
}
int usecount(void)
{
int res;
STANDARD_USECOUNT(res);
return res;
}
char *key(void)
{
return ASTERISK_GPL_KEY;
}

0
apps/app_transfer.c Executable file → Normal file
View File

0
apps/app_txtcidname.c Executable file → Normal file
View File

0
apps/app_url.c Executable file → Normal file
View File

2
apps/app_userevent.c Executable file → Normal file
View File

@@ -54,12 +54,12 @@ static int userevent_exec(struct ast_channel *chan, void *data)
}
strncpy(info, (char *)data, strlen((char *)data) + AST_MAX_EXTENSION-1);
snprintf(eventname, sizeof(eventname), "UserEvent%s", info);
eventbody = strchr(eventname, '|');
if (eventbody) {
*eventbody = '\0';
eventbody++;
}
snprintf(eventname, sizeof(eventname), "UserEvent%s", info);
LOCAL_USER_ADD(u);
if(eventbody) {

0
apps/app_verbose.c Executable file → Normal file
View File

1505
apps/app_voicemail.c Executable file → Normal file

File diff suppressed because it is too large Load Diff

0
apps/app_waitforring.c Executable file → Normal file
View File

0
apps/app_zapateller.c Executable file → Normal file
View File

0
apps/app_zapbarge.c Executable file → Normal file
View File

0
apps/app_zapras.c Executable file → Normal file
View File

0
apps/app_zapscan.c Executable file → Normal file
View File

0
apps/enter.h Executable file → Normal file
View File

0
apps/leave.h Executable file → Normal file
View File

0
apps/rpt_flow.pdf Executable file → Normal file
View File

68
ast_expr.y Executable file → Normal file
View File

@@ -215,6 +215,7 @@ struct val *vp;
}
if (vp->type == string || vp->type == numeric_string)
free (vp->u.s);
free (vp);
}
@@ -650,19 +651,24 @@ struct val *a, *b;
{
struct val *r;
if (!to_integer (a) || !to_integer (b)) {
if (!to_integer (a)) {
ast_log(LOG_WARNING,"non-numeric argument\n");
free_value(a);
if (!to_integer (b)) {
free_value(a);
free_value(b);
return make_integer(0);
} else {
free_value(a);
return (b);
}
} else if (!to_integer(b)) {
free_value(b);
return(NULL);
return (a);
}
r = make_integer (/*(quad_t)*/(a->u.i + b->u.i));
if (chk_plus (a->u.i, b->u.i, r->u.i)) {
ast_log(LOG_WARNING,"overflow\n");
free_value(a);
free_value(b);
return(NULL);
}
free_value (a);
free_value (b);
@@ -690,19 +696,27 @@ struct val *a, *b;
{
struct val *r;
if (!to_integer (a) || !to_integer (b)) {
free_value(a);
free_value(b);
if (!to_integer (a)) {
ast_log(LOG_WARNING, "non-numeric argument\n");
return(NULL);
if (!to_integer (b)) {
free_value(a);
free_value(b);
return make_integer(0);
} else {
r = make_integer(0 - b->u.i);
free_value(a);
free_value(b);
return (r);
}
} else if (!to_integer(b)) {
ast_log(LOG_WARNING, "non-numeric argument\n");
free_value(b);
return (a);
}
r = make_integer (/*(quad_t)*/(a->u.i - b->u.i));
if (chk_minus (a->u.i, b->u.i, r->u.i)) {
free_value(a);
free_value(b);
ast_log(LOG_WARNING, "overload\n");
return(NULL);
ast_log(LOG_WARNING, "overflow\n");
}
free_value (a);
free_value (b);
@@ -732,15 +746,12 @@ struct val *a, *b;
free_value(a);
free_value(b);
ast_log(LOG_WARNING, "non-numeric argument\n");
return(NULL);
return(make_integer(0));
}
r = make_integer (/*(quad_t)*/(a->u.i * b->u.i));
if (chk_times (a->u.i, b->u.i, r->u.i)) {
ast_log(LOG_WARNING, "overflow\n");
free_value(a);
free_value(b);
return(NULL);
}
free_value (a);
free_value (b);
@@ -765,26 +776,28 @@ struct val *a, *b;
{
struct val *r;
if (!to_integer (a) || !to_integer (b)) {
if (!to_integer (a)) {
free_value(a);
free_value(b);
ast_log(LOG_WARNING, "non-numeric argument\n");
return(NULL);
return make_integer(0);
} else if (!to_integer (b)) {
free_value(a);
free_value(b);
ast_log(LOG_WARNING, "non-numeric argument\n");
return make_integer(INT_MAX);
}
if (b->u.i == 0) {
ast_log(LOG_WARNING, "division by zero\n");
free_value(a);
free_value(b);
return(NULL);
return make_integer(INT_MAX);
}
r = make_integer (/*(quad_t)*/(a->u.i / b->u.i));
if (chk_div (a->u.i, b->u.i)) {
ast_log(LOG_WARNING, "overflow\n");
free_value(a);
free_value(b);
return(NULL);
}
free_value (a);
free_value (b);
@@ -801,14 +814,13 @@ struct val *a, *b;
ast_log(LOG_WARNING, "non-numeric argument\n");
free_value(a);
free_value(b);
return(NULL);
return make_integer(0);
}
if (b->u.i == 0) {
ast_log(LOG_WARNING, "div by zero\n");
free_value(a);
free_value(b);
return(NULL);
return (b);
}
r = make_integer (/*(quad_t)*/(a->u.i % b->u.i));
@@ -838,7 +850,7 @@ struct val *a, *b;
ast_log(LOG_WARNING,"regcomp() error : %s",errbuf);
free_value(a);
free_value(b);
return(NULL);
return make_str("");
}
/* compare string against pattern */

Some files were not shown because too many files have changed in this diff Show More