From: Kevin P. Fleming Date: Thu, 3 Jan 2008 19:56:29 +0000 (+0000) Subject: eliminiate sound_thread() and other stuff from chan_oss since Asterisk indications... X-Git-Tag: 1.6.0-beta1~3^2~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e566f4eda75ad7a9781adbea5ddd7b4803b34bf7;p=thirdparty%2Fasterisk.git eliminiate sound_thread() and other stuff from chan_oss since Asterisk indications can handle it remove gentone and all the headers containing tones that are no longer needed git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96270 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/Makefile b/channels/Makefile index f2c6b0ec4c..88056066ec 100644 --- a/channels/Makefile +++ b/channels/Makefile @@ -58,7 +58,6 @@ ifneq ($(findstring $(OSARCH), mingw32 cygwin ),) endif clean:: - rm -f gentone $(MAKE) -C misdn clean ifneq ($(wildcard h323/Makefile.ast),) @@ -81,23 +80,6 @@ endif dist-clean:: rm -f h323/Makefile -# gentone must be built with the HOST environment -gentone: gentone.c - $(ECHO_PREFIX) echo " [HOST_CC] $^ -> $@" - $(CMD_PREFIX) $(HOST_CC) -o $@ $^ -lm - -busy.h: gentone - -@mv $@ $@.tmp - ./gentone busy 480 620 - @cmp -s $@.tmp $@ && mv $@.tmp $@ - -@rm -f $@.tmp - -ringtone.h: gentone - -@mv $@ $@.tmp - ./gentone ringtone 440 480 - @cmp -s $@.tmp $@ && mv $@.tmp $@ - -@rm -f $@.tmp - $(if $(filter chan_iax2,$(EMBEDDED_MODS)),modules.link,chan_iax2.so): iax2-parser.o iax2-provision.o ifeq ($(OSARCH),linux-gnu) diff --git a/channels/answer.h b/channels/answer.h deleted file mode 100644 index 4168c50125..0000000000 --- a/channels/answer.h +++ /dev/null @@ -1,237 +0,0 @@ -/*!\file - * \brief Signed 16-bit audio data - * - * Source: answer.raw - * - * Copyright (C) 1999-2005, Digium, Inc. - * - * Distributed under the terms of the GNU General Public License - * - */ - -static signed short answer[] = { -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 0x19b7, 0x0245, 0xeee5, 0xb875, 0xd9a4, 0x6018, 0x660a, 0xc3c6, -0x8741, 0xff55, 0x4c2e, 0x2146, 0xfed2, 0xf079, 0xcbd4, 0xe561, 0x3c41, 0x3166, -0xd425, 0xdc59, 0x2748, 0x087d, 0xc72b, 0xfe3a, 0x4681, 0x14c6, 0xcf45, 0xdd38, -0xf8dd, 0x0a39, 0x3a5a, 0x32b9, 0xbfec, 0x957f, 0x15a3, 0x70f4, 0x1d95, 0xbfc4, -0xd367, 0xfda0, 0x0dc0, 0x29eb, 0x1fc2, 0xd684, 0xcab1, 0x19c7, 0x29ef, 0xe679, -0xe9d0, 0x2b82, 0x151a, 0xca9f, 0xdb68, 0x1f4a, 0x271c, 0x0e2a, 0xfb32, 0xd1b2, -0xc8ff, 0x2382, 0x6380, 0x0a52, 0xa118, 0xccbf, 0x2ddc, 0x33fd, 0x0964, 0xf2a4, -0xdd81, 0xe092, 0x1a00, 0x325c, 0xf5e3, 0xd6a1, 0x0b6c, 0x1c75, 0xe4f8, 0xe07c, -0x2082, 0x2b3e, 0xf445, 0xdaa9, 0xea13, 0xff3c, 0x245c, 0x35c1, 0xf308, 0xab53, -0xdf59, 0x4698, 0x3f3b, 0xe7f7, 0xca84, 0xed4d, 0x0c3f, 0x1e94, 0x1c2d, 0xf06f, -0xd4df, 0xff34, 0x23d8, 0x001e, 0xe3f1, 0x0b15, 0x2113, 0xf3fd, 0xd768, 0xf9a0, -0x1d31, 0x1c6e, 0x0797, 0xe3a0, 0xce6c, 0xfd7b, 0x422a, 0x2c4c, 0xd364, 0xbf42, -0x0278, 0x303e, 0x1c51, 0xf737, 0xe25a, 0xe75f, 0x0a8f, 0x22ab, 0x05f4, 0xe3f9, -0xf8c4, 0x1705, 0x0162, 0xe49f, 0xfb8b, 0x1e2b, 0x13ac, 0xf044, 0xe07b, 0xf01a, -0x1567, 0x2cbf, 0x0b75, 0xd01b, 0xd206, 0x1563, 0x38d7, 0x0f2e, 0xdb32, 0xdc30, -0x023b, 0x1e44, 0x16eb, 0xf5f7, 0xe425, 0xfa33, 0x14d5, 0x0968, 0xeff2, 0xf762, -0x1137, 0x0e59, 0xf13a, 0xe651, 0xff41, 0x1d60, 0x18fd, 0xf1e6, 0xd75f, 0xf097, -0x20ec, 0x27fa, 0xfba4, 0xd5b8, 0xe68e, 0x1657, 0x2518, 0x04f6, 0xe5a3, 0xe976, -0x0578, 0x18fa, 0x0a92, 0xec0a, 0xef2a, 0x111f, 0x12f4, 0xeec3, 0xe95e, 0x0d3a, -0x18fd, 0xff72, 0xeefc, 0xf114, 0xfaaa, 0x14ee, 0x21db, 0xf56e, 0xcb49, 0xf621, -0x3323, 0x1947, 0xe017, 0xe7e9, 0x0819, 0x0707, 0x084c, 0x0f57, 0xf152, 0xdf92, -0x104a, 0x28eb, 0xedcc, 0xd4ad, 0x1415, 0x296d, 0xed9a, 0xdf57, 0x0cc2, 0x0d95, -0xf7b5, 0x0deb, 0x0b34, 0xd713, 0xea08, 0x38d6, 0x216d, 0xc727, 0xdc32, 0x2cd2, -0x1822, 0xe2d5, 0xfeb3, 0x106c, 0xe6e5, 0xf81e, 0x2fe8, 0x01af, 0xc180, 0x037a, -0x42d8, 0xf88d, 0xc344, 0x0a4f, 0x2c4e, 0xf19d, 0xebeb, 0x162c, 0xf9e9, 0xde93, -0x1b56, 0x2c60, 0xd8aa, 0xce3e, 0x2a41, 0x2eeb, 0xdab1, 0xde32, 0x1c32, 0x0aba, -0xeabe, 0x1008, 0x136d, 0xda2f, 0xec3b, 0x31dd, 0x1130, 0xca79, 0xf5b8, 0x3423, -0x0274, 0xd27d, 0x035e, 0x1e68, 0xf641, 0xf904, 0x1691, 0xef7d, 0xd57a, 0x1c3b, -0x3c23, 0xe881, 0xc274, 0x0af5, 0x2962, 0xfa34, 0xf676, 0x0f71, 0xefcc, 0xe01f, -0x19e7, 0x276f, 0xe694, 0xe134, 0x1c3a, 0x0e8b, 0xd8e7, 0xfa81, 0x2f8b, 0x07c5, -0xd904, 0xf6fa, 0x0ca5, 0xf9a2, 0x0dc7, 0x2623, 0xec54, 0xbe23, 0x02b6, 0x4296, -0x10cd, 0xda61, 0xf11c, 0x0103, 0xf41c, 0x10b4, 0x2a03, 0xf63c, 0xce1a, 0xfdbd, -0x1fb4, 0xfc51, 0xf727, 0x1c8a, 0x04ff, 0xcf41, 0xec05, 0x2913, 0x1ce8, 0xf70c, -0xf744, 0xede8, 0xdd77, 0x0d99, 0x43f1, 0x119c, 0xc14f, 0xd60e, 0x17cb, 0x1e19, -0x0d4e, 0x0c95, 0xeed1, 0xcdf4, 0xf7a5, 0x331f, 0x1cd0, 0xeb17, 0xf082, 0xfb19, -0xe899, 0xfdeb, 0x323c, 0x2036, 0xdad3, 0xd134, 0xfd03, 0x1345, 0x1c10, 0x2239, -0xf656, 0xbc22, 0xdc3f, 0x3392, 0x3d59, 0xfd77, 0xdb4d, 0xe23f, 0xedbe, 0x0f7e, -0x35cc, 0x1947, 0xd5dc, 0xd1bf, 0x035d, 0x16fc, 0x1174, 0x1675, 0x0249, 0xd2d4, -0xd851, 0x184d, 0x32fe, 0x0f91, 0xee14, 0xe1e6, 0xdf9b, 0x016b, 0x3668, 0x2b2b, -0xe20c, 0xc554, 0xf257, 0x1c05, 0x1fc5, 0x14f0, 0xf891, 0xd41c, 0xdf83, 0x1865, -0x2de1, 0x0b16, 0xed58, 0xea0c, 0xea79, 0xfbd9, 0x22af, 0x2732, 0xf62f, 0xd389, -0xe7d9, 0x0b39, 0x1cdc, 0x1de3, 0x038a, 0xd809, 0xd5f7, 0x0b55, 0x305e, 0x1910, -0xf02e, 0xe089, 0xe7c7, 0x0195, 0x2265, 0x21da, 0xf743, 0xd8f2, 0xe978, 0x09a1, -0x190a, 0x17c5, 0x045a, 0xe46d, 0xdd06, 0xffb2, 0x2293, 0x1cfe, 0xfd4d, 0xe4f9, -0xe310, 0xfaf1, 0x1d22, 0x2376, 0x0113, 0xde3a, 0xe21b, 0x0204, 0x1ba1, 0x1bd6, -0x0333, 0xe563, 0xe104, 0xfd51, 0x1bc1, 0x1ccf, 0x0285, 0xe757, 0xe35e, 0xfaf2, -0x185d, 0x1d46, 0x06b7, 0xec13, 0xe108, 0xef6e, 0x121d, 0x2a17, 0x16a6, 0xe32c, -0xc9a9, 0xf070, 0x2f48, 0x3788, 0xfa4e, 0xc32a, 0xd9c2, 0x1fa1, 0x36fe, 0x07fa, -0xd9e4, 0xe577, 0x0e5e, 0x1755, 0xfb53, 0xed71, 0x0540, 0x19e0, 0x0301, 0xdc97, -0xe391, 0x1937, 0x367c, 0x0bc9, 0xca4c, 0xc96b, 0x105d, 0x461f, 0x2416, 0xd481, -0xbc97, 0xf8b7, 0x39af, 0x2ec9, 0xecc6, 0xcb50, 0xeee3, 0x1ffe, 0x1e8e, 0xf700, -0xe66a, 0xff58, 0x149f, 0x02e5, 0xe792, 0xf2d8, 0x1a4d, 0x225a, 0xf642, 0xce7f, -0xe6a6, 0x25e2, 0x38f5, 0x01d0, 0xc50f, 0xd243, 0x19bd, 0x3fc6, 0x14f0, 0xd2d7, -0xcdb6, 0x069a, 0x2ffe, 0x1847, 0xe6f8, 0xdf0a, 0x0337, 0x1a90, 0x067a, 0xeb5b, -0xf541, 0x143b, 0x14f2, 0xf092, 0xdc02, 0xfb91, 0x28a3, 0x2274, 0xeaa8, 0xc9e7, -0xef48, 0x2d01, 0x322e, 0xf6d2, 0xc7cb, 0xe13b, 0x1fda, 0x3217, 0x0458, 0xd690, -0xe2bf, 0x11c4, 0x21d5, 0x0291, 0xe5c8, 0xf3a9, 0x12ba, 0x11aa, 0xf22b, 0xe627, -0x03ec, 0x219a, 0x1036, 0xe2f2, 0xd93f, 0x059c, 0x2ed6, 0x1b75, 0xe227, 0xce55, -0xfb19, 0x2de0, 0x2477, 0xed08, 0xd148, 0xf307, 0x21d4, 0x2002, 0xf543, 0xdeac, -0xf7f9, 0x18a9, 0x11d6, 0xf0ef, 0xe8e4, 0x05ea, 0x1ba5, 0x0727, 0xe448, 0xe748, -0x100e, 0x265e, 0x07fc, 0xdbae, 0xde78, 0x0efa, 0x2ce0, 0x0f94, 0xddf1, 0xd9ea, -0x0797, 0x28f6, 0x12eb, 0xe60c, 0xdf46, 0x0469, 0x1fbb, 0x0ced, 0xe9f6, 0xe95f, -0x09fe, 0x1ab9, 0x02cb, 0xe5a4, 0xef2a, 0x1327, 0x1d7b, 0xfd07, 0xde3d, 0xed9c, -0x17e5, 0x22e7, 0xfe3a, 0xdb38, 0xe9b9, 0x161a, 0x2416, 0x0175, 0xde3d, 0xe9de, -0x1294, 0x1fc9, 0x00ea, 0xe2a7, 0xeee2, 0x1298, 0x1a7d, 0xfc1d, 0xe3bb, 0xf47a, -0x1642, 0x185e, 0xf727, 0xe1af, 0xf709, 0x19c3, 0x18e7, 0xf50d, 0xe010, 0xf75b, -0x1a9c, 0x18d8, 0xf4c5, 0xe0c9, 0xf865, 0x1a1c, 0x16d5, 0xf3a6, 0xe257, 0xfaf2, -0x1a44, 0x14d5, 0xf34f, 0xe4b6, 0xfc77, 0x17d5, 0x0ff8, 0xf133, 0xe8b7, 0x0344, -0x1a37, 0x0ad5, 0xe95e, 0xe61a, 0x08a5, 0x227e, 0x0e33, 0xe4a7, 0xdd70, 0x03b0, -0x25f4, 0x17b2, 0xec0a, 0xdb4e, 0xf898, 0x1ba3, 0x18f6, 0xf973, 0xe87f, 0xf77a, -0x0b93, 0x096c, 0xfb0e, 0xfb03, 0x0896, 0x0940, 0xf51d, 0xe904, 0xfdc7, 0x1dda, -0x1bf9, 0xf29b, 0xd37f, 0xea1b, 0x1f37, 0x3175, 0x07eb, 0xd3f7, 0xd46b, 0x077d, -0x2eeb, 0x1e67, 0xeeae, 0xd8c7, 0xef85, 0x1119, 0x18d3, 0x088e, 0xf953, 0xf5ad, -0xf556, 0xf63d, 0x0234, 0x167a, 0x19a1, 0xfbf9, 0xd873, 0xdd4b, 0x0f06, 0x3748, -0x21e6, 0xe181, 0xc032, 0xe79a, 0x2bec, 0x3e76, 0x0b1b, 0xce41, 0xcb23, 0xff96, -0x2d79, 0x26d1, 0xfcc7, 0xdf8a, 0xe525, 0xfd83, 0x10f1, 0x16d7, 0x0f50, 0xfaea, -0xe3f1, 0xe20f, 0x0158, 0x27d9, 0x2866, 0xf96f, 0xcb34, 0xd563, 0x11d6, 0x3d25, -0x2424, 0xe254, 0xc2c9, 0xe7cd, 0x248d, 0x34f5, 0x0c42, 0xdcd0, 0xd827, 0xfa65, -0x19eb, 0x1b50, 0x0721, 0xf396, 0xeb9c, 0xefde, 0x0016, 0x1594, 0x1cc1, 0x0658, -0xe22b, 0xd852, 0xfb3e, 0x2923, 0x2c78, 0xfc87, 0xcdb5, 0xd69c, 0x0e3c, 0x3527, -0x201f, 0xe993, 0xcf9e, 0xeb21, 0x183f, 0x25ea, 0x0c93, 0xed4d, 0xe5f9, 0xf548, -0x07fb, 0x117c, 0x0ff2, 0x0398, 0xf08c, 0xe628, 0xf489, 0x143b, 0x2419, 0x0ccf, -0xe2cc, 0xd5a6, 0xf861, 0x2615, 0x2a1b, 0xfeb4, 0xd543, 0xdc53, 0x09b4, 0x2901, -0x19ff, 0xf24a, 0xde86, 0xeec4, 0x0b7b, 0x1733, 0x0d0a, 0xfc24, 0xf1bb, 0xf110, -0xfa03, 0x0a0f, 0x15d4, 0x0e21, 0xf435, 0xe17e, 0xee90, 0x1225, 0x2527, 0x0efa, -0xe61f, 0xd916, 0xf7b8, 0x1f50, 0x2326, 0x0099, 0xe01e, 0xe473, 0x0491, 0x1b37, -0x1360, 0xfb17, 0xecd9, 0xf20d, 0x0051, 0x0aec, 0x0d4a, 0x073d, 0xfa5a, 0xeeb8, -0xf165, 0x0516, 0x17dc, 0x12da, 0xf71b, 0xe213, 0xed85, 0x0eef, 0x20c8, 0x0e09, -0xebcc, 0xe0d4, 0xf848, 0x1637, 0x19d6, 0x026b, 0xec09, 0xed00, 0xff9b, 0x0e5a, -0x0d6b, 0x026c, 0xf865, 0xf4da, 0xf888, 0x025a, 0x0cbb, 0x0d53, 0xff96, 0xeefa, -0xee80, 0x021c, 0x15d6, 0x126a, 0xf9c1, 0xe724, 0xf017, 0x0aa1, 0x18b6, 0x0b4e, -0xf2d7, 0xea91, 0xf957, 0x0cac, 0x1061, 0x03f4, 0xf6ad, 0xf476, 0xfbdf, 0x0489, -0x08b1, 0x06df, 0xffcf, 0xf766, 0xf537, 0xfddf, 0x0ad4, 0x0e15, 0x01da, 0xf205, -0xf0a0, 0x0082, 0x1066, 0x0e41, 0xfc71, 0xef1b, 0xf4ad, 0x05cd, 0x0f32, 0x07ed, -0xf9c8, 0xf401, 0xfa93, 0x04af, 0x088c, 0x04a7, 0xfe15, 0xf9f1, 0xfa64, 0xff1e, -0x0539, 0x078c, 0x02af, 0xfa1a, 0xf69d, 0xfd09, 0x075b, 0x0a3d, 0x01f2, 0xf761, -0xf642, 0xffa7, 0x08f3, 0x0830, 0xff05, 0xf7db, 0xf9bc, 0x0174, 0x068b, 0x04b2, -0xfeff, 0xfb39, 0xfc1a, 000000, 0x0371, 0x03d7, 0x00fe, 0xfd37, 0xfbe0, 0xfe78, -0x02af, 0x044a, 0x0180, 0xfd43, 0xfc00, 0xfed1, 0x02aa, 0x0346, 0x00dd, 0xfde0, -0xfbfe, 0x0114, 0x0987, 0x04bc, 0xf49d, 0xf23a, 0x06ab, 0x162e, 0x0544, 0xe76b, -0xea25, 0x1015, 0x2474, 0x0431, 0xd7d3, 0xe1ec, 0x1923, 0x2df5, 0x01cd, 0xd386, -0xe3d9, 0x1b9d, 0x2c62, 0xfeb8, 0xd31a, 0xe6ba, 0x1dbd, 0x2abb, 0xfbab, 0xd2ed, -0xe9ab, 0x1fa7, 0x28ef, 0xf8b3, 0xd2f5, 0xeca5, 0x2160, 0x26fd, 0xf5d7, 0xd334, -0xefa1, 0x22e5, 0x24ea, 0xf31b, 0xd3a9, 0xf29f, 0x2435, 0x22b6, 0xf07e, 0xd44e, -0xf59b, 0x2551, 0x2067, 0xee08, 0xd527, 0xf88e, 0x2639, 0x1e00, 0xebb6, 0xd62d, -0xfb77, 0x26eb, 0x1b85, 0xe98b, 0xd75f, 0xfe51, 0x276b, 0x18f9, 0xe78e, 0xd8b9, -0x011a, 0x27b6, 0x1660, 0xe5bb, 0xda3a, 0x03cc, 0x27cf, 0x13bd, 0xe415, 0xdbdf, -0x066a, 0x27b7, 0x1117, 0xe29e, 0xdda5, 0x08ec, 0x276e, 0x0e6d, 0xe154, 0xdf89, -0x0b52, 0x26f6, 0x0bc7, 0xe039, 0xe185, 0x0d96, 0x2653, 0x0924, 0xdf4e, 0xe399, -0x0fb9, 0x2584, 0x068b, 0xde93, 0xe5c0, 0x11b8, 0x248e, 0x03fd, 0xde08, 0xe7f8, -0x1390, 0x2372, 0x0180, 0xddaa, 0xea3c, 0x1544, 0x2231, 0xff12, 0xdd7a, 0xec89, -0x16cf, 0x20d0, 0xfcb9, 0xdd77, 0xeedb, 0x1831, 0x1f52, 0xfa77, 0xdd9f, 0xf132, -0x1969, 0x1db7, 0xf850, 0xddf1, 0xf385, 0x1a75, 0x1c06, 0xf645, 0xde6b, 0xf5d7, -0x1b5b, 0x1a3f, 0xf457, 0xdf0d, 0xf820, 0x1c13, 0x1867, 0xf288, 0xdfd2, 0xfa5f, -0x1ca1, 0x167f, 0xf0db, 0xe0ba, 0xfc92, 0x1d06, 0x148b, 0xef50, 0xe1c1, 0xfeb5, -0x1d43, 0x1290, 0xede9, 0xe2e6, 0x00c6, 0x1d58, 0x108e, 0xeca7, 0xe426, 0x02c4, -0x1d45, 0x0e8a, 0xeb8a, 0xe57f, 0x04a9, 0x1d0e, 0x0c87, 0xea92, 0xe6ec, 0x0677, -0x1cb2, 0x0a87, 0xe9be, 0xe86e, 0x082a, 0x1c34, 0x088b, 0xe912, 0xe9fe, 0x09c1, -0x1b95, 0x069c, 0xe88c, 0xeb9c, 0x0b3a, 0x1ad9, 0x04b6, 0xe82a, 0xed43, 0x0c96, -0x1a00, 0x02df, 0xe7eb, 0xeef3, 0x0dd0, 0x190d, 0x0116, 0xe7d0, 0xf0a8, 0x0eec, -0x1804, 0xff61, 0xe7d8, 0xf25d, 0x0fe6, 0x16e3, 0xfdc0, 0xe800, 0xf412, 0x10bf, -0x15b1, 0xfc36, 0xe848, 0xf5c5, 0x1176, 0x146e, 0xfac2, 0xe8ad, 0xf771, 0x120d, -0x1320, 0xf969, 0xe92e, 0xf913, 0x1282, 0x11c4, 0xf828, 0xe9cb, 0xfaac, 0x12d8, -0x1062, 0xf703, 0xea7e, 0xfc38, 0x130e, 0x0efa, 0xf5fb, 0xeb49, 0xfdb5, 0x1325, -0x0d8e, 0xf50e, 0xec26, 0xff20, 0x131e, 0x0c21, 0xf43f, 0xed15, 0x007a, 0x12fa, -0x0ab6, 0xf38d, 0xee15, 0x01be, 0x12bd, 0x094f, 0xf2f9, 0xef22, 0x02ef, 0x1265, -0x07f0, 0xf283, 0xf037, 0x0408, 0x11f6, 0x0699, 0xf226, 0xf156, 0x050a, 0x1170, -0x054b, 0xf1e8, 0xf27a, 0x05f4, 0x10d8, 0x040c, 0xf1c5, 0xf3a3, 0x06c2, 0x102c, -0x02da, 0xf1bc, 0xf4cc, 0x0779, 0x0f71, 0x01b7, 0xf1cc, 0xf5f5, 0x0815, 0x0ea7, -0x00a8, 0xf1f4, 0xf719, 0x0899, 0x0dd2, 0xffab, 0xf233, 0xf839, 0x0902, 0x0cf4, -0xfec0, 0xf288, 0xf950, 0x0952, 0x0c0e, 0xfdec, 0xf2ee, 0xfa5d, 0x0989, 0x0b23, -0xfd2d, 0xf368, 0xfb62, 0x09a7, 0x0a35, 0xfc85, 0xf3f1, 0xfc58, 0x09af, 0x0946, -0xfbf2, 0xf488, 0xfd3f, 0x09a1, 0x0859, 0xfb77, 0xf52c, 0xfe17, 0x097d, 0x076f, -0xfb14, 0xf5d8, 0xfede, 0x0945, 0x068a, 0xfac6, 0xf68d, 0xff93, 0x08fb, 0x05ad, -0xfa8e, 0xf747, 0x0034, 0x08a1, 0x04da, 0xfa6f, 0xf805, 0x00c2, 0x0836, 0x0410, -0xfa63, 0xf8c6, 0x013c, 0x07bf, 0x0354, 0xfa6c, 0xf985, 0x01a1, 0x073b, 0x02a4, -0xfa8a, 0xfa43, 0x01f1, 0x06af, 0x0204, 0xfab9, 0xfafc, 0x022c, 0x0619, 0x0175, -0xfafa, 0xfbae, 0x0252, 0x057f, 0x00f6, 0xfb4b, 0xfc5a, 0x0263, 0x04e0, 0x008b, -0xfbaa, 0xfcfa, 0x0262, 0x0440, 0x0032, 0xfc16, 0xfd90, 0x024b, 0x03a0, 0xffec, -0xfc8c, 0xfe19, 0x0225, 0x0301, 0xffb9, 0xfd0c, 0xfe93, 0x01ea, 0x0267, 0xff9c, -0xfd95, 0xfefe, 0x01a0, 0x01d3, 0xff90, 0xfe22, 0xff5a, 0x0147, 0x0145, 0xff99, -0xfeb3, 0xffa1, 0x00e0, 0x00c3, 0xffb6, 0xff46, 0xffd9, 0x006d, 0x004b, 0xffe5, -0xffda, 0xfffc, 000000, 0xfffe, 000000, 0xffff, 000000, 0xffff, 0xffff, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, 000000, -000000 }; diff --git a/channels/busy.h b/channels/busy.h deleted file mode 100644 index 6e5db8e47e..0000000000 --- a/channels/busy.h +++ /dev/null @@ -1,55 +0,0 @@ -/* busy.h: Generated from frequencies 480 and 620 - by gentone. 400 samples */ -static short busy[400] = { - 0, 13697, 24766, 31109, 31585, 26222, 16198, 3569, - -9162, -19575, -25812, -26935, -23069, -15322, -5493, 4339, - 12277, 16985, 17934, 15440, 10519, 4585, -908, -4827, - -6592, -6269, -4489, -2220, -467, 30, -983, -3203, - -5839, -7844, -8215, -6301, -2035, 3975, 10543, 16141, - 19260, 18787, 14322, 6338, -3845, -14296, -22858, -27611, - -27309, -21691, -11585, 1213, 14285, 25068, 31388, 31915, - 26457, 16010, 2568, -11282, -22885, -30054, -31509, -27120, - -17908, -5805, 6760, 17379, 24147, 26028, 23020, 16094, - 6931, -2478, -10279, -15136, -16474, -14538, -10253, -4949, - 0, 3515, 5052, 4688, 3045, 1069, -268, -272, - 1269, 3996, 7067, 9381, 9889, 7910, 3365, -3123, - -10320, -16622, -20424, -20510, -16384, -8448, 2006, 13026, - 22383, 28040, 28613, 23696, 13996, 1232, -12193, -23670, - -30918, -32459, -27935, -18190, -5103, 8795, 20838, 28764, - 31164, 27753, 19395, 7893, -4412, -15136, -22342, -24909, - -22717, -16609, -8143, 780, 8361, 13272, 14909, 13455, - 9758, 5067, 678, -2387, -3624, -3133, -1538, 224, - 1209, 751, -1315, -4580, -8145, -10848, -11585, -9628, - -4878, 2038, 9844, 16867, 21403, 22124, 18429, 10638, - 0, -11524, -21643, -28211, -29702, -25561, -16364, -3737, - 9946, 22044, 30180, 32733, 29182, 20210, 7573, -6269, - -18655, -27259, -30558, -28117, -20645, -9807, 2148, 12878, - 20426, 23599, 22173, 16865, 9117, 731, -6552, -11426, - -13269, -12216, -9050, -4941, -1118, 1460, 2335, 1635, - 0, -1635, -2335, -1460, 1118, 4941, 9050, 12216, - 13269, 11426, 6552, -731, -9117, -16865, -22173, -23599, - -20426, -12878, -2148, 9807, 20645, 28117, 30558, 27259, - 18655, 6269, -7573, -20210, -29182, -32733, -30180, -22044, - -9946, 3737, 16364, 25561, 29702, 28211, 21643, 11524, - 0, -10638, -18429, -22124, -21403, -16867, -9844, -2038, - 4878, 9628, 11585, 10848, 8145, 4580, 1315, -751, - -1209, -224, 1538, 3133, 3624, 2387, -678, -5067, - -9758, -13455, -14909, -13272, -8361, -780, 8143, 16609, - 22717, 24909, 22342, 15136, 4412, -7893, -19395, -27753, - -31164, -28764, -20838, -8795, 5103, 18190, 27935, 32459, - 30918, 23670, 12193, -1232, -13996, -23696, -28613, -28040, - -22383, -13026, -2006, 8448, 16384, 20510, 20424, 16622, - 10320, 3123, -3365, -7910, -9889, -9381, -7067, -3996, - -1269, 272, 268, -1069, -3045, -4688, -5052, -3515, - 0, 4949, 10253, 14538, 16474, 15136, 10279, 2478, - -6931, -16094, -23020, -26028, -24147, -17379, -6760, 5805, - 17908, 27120, 31509, 30054, 22885, 11282, -2568, -16010, - -26457, -31915, -31388, -25068, -14285, -1213, 11585, 21691, - 27309, 27611, 22858, 14296, 3845, -6338, -14322, -18787, - -19260, -16141, -10543, -3975, 2035, 6301, 8215, 7844, - 5839, 3203, 983, -30, 467, 2220, 4489, 6269, - 6592, 4827, 908, -4585, -10519, -15440, -17934, -16985, - -12277, -4339, 5493, 15322, 23069, 26935, 25812, 19575, - 9162, -3569, -16198, -26222, -31585, -31109, -24766, -13697, - -}; diff --git a/channels/chan_oss.c b/channels/chan_oss.c index cabb734b2a..9bf749459e 100644 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -65,12 +65,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "console_video.h" -/* ringtones we use */ -#include "busy.h" -#include "ringtone.h" -#include "ring10.h" -#include "answer.h" - /*! Global jitterbuffer configuration - by default, jb is disabled */ static struct ast_jb_conf default_jbconf = { @@ -246,30 +240,6 @@ static char *config = "oss.conf"; /* default config file */ static int oss_debug; -/*! - * Each sound is made of 'datalen' samples of sound, repeated as needed to - * generate 'samplen' samples of data, then followed by 'silencelen' samples - * of silence. The loop is repeated if 'repeat' is set. - */ -struct sound { - int ind; - char *desc; - short *data; - int datalen; - int samplen; - int silencelen; - int repeat; -}; - -static struct sound sounds[] = { - { AST_CONTROL_RINGING, "RINGING", ringtone, sizeof(ringtone)/2, 16000, 32000, 1 }, - { AST_CONTROL_BUSY, "BUSY", busy, sizeof(busy)/2, 4000, 4000, 1 }, - { AST_CONTROL_CONGESTION, "CONGESTION", busy, sizeof(busy)/2, 2000, 2000, 1 }, - { AST_CONTROL_RING, "RING10", ring10, sizeof(ring10)/2, 16000, 32000, 1 }, - { AST_CONTROL_ANSWER, "ANSWER", answer, sizeof(answer)/2, 2200, 0, 0 }, - { -1, NULL, 0, 0, 0, 0 }, /* end marker */ -}; - /*! * \brief descriptor for one of our channels. * @@ -282,18 +252,6 @@ struct chan_oss_pvt { struct chan_oss_pvt *next; char *name; - /*! - * cursound indicates which in struct sound we play. -1 means nothing, - * any other value is a valid sound, in which case sampsent indicates - * the next sample to send in [0..samplen + silencelen] - * nosound is set to disable the audio data from the channel - * (so we can play the tones etc.). - */ - int sndcmd[2]; /*!< Sound command pipe */ - int cursound; /*!< index of sound to send */ - int sampsent; /*!< # of sound samples sent */ - int nosound; /*!< set to block audio from the PBX */ - int total_blocks; /*!< total blocks in the output device */ int sounddev; enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex; @@ -356,7 +314,6 @@ struct video_desc *get_video_desc(struct ast_channel *c) return o ? o->env : NULL; } static struct chan_oss_pvt oss_default = { - .cursound = -1, .sounddev = -1, .duplex = M_UNSET, /* XXX check this */ .autoanswer = 1, @@ -510,135 +467,6 @@ static int soundcard_writeframe(struct chan_oss_pvt *o, short *data) return write(o->sounddev, (void *)data, FRAME_SIZE * 2); } -/*! - * \brief Handler for 'sound writable' events from the sound thread. - * - * Builds a frame from the high level description of the sounds, - * and passes it to the audio device. - * The actual sound is made of 1 or more sequences of sound samples - * (s->datalen, repeated to make s->samplen samples) followed by - * s->silencelen samples of silence. The position in the sequence is stored - * in o->sampsent, which goes between 0 .. s->samplen+s->silencelen. - * In case we fail to write a frame, don't update o->sampsent. - */ -static void send_sound(struct chan_oss_pvt *o) -{ - short myframe[FRAME_SIZE]; - int ofs, l, start; - int l_sampsent = o->sampsent; - struct sound *s; - - if (o->cursound < 0) /* no sound to send */ - return; - - s = &sounds[o->cursound]; - - for (ofs = 0; ofs < FRAME_SIZE; ofs += l) { - l = s->samplen - l_sampsent; /* # of available samples */ - if (l > 0) { - start = l_sampsent % s->datalen; /* source offset */ - l = MIN(l, FRAME_SIZE - ofs); /* don't overflow the frame */ - l = MIN(l, s->datalen - start); /* don't overflow the source */ - bcopy(s->data + start, myframe + ofs, l * 2); - if (0) - ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n", l_sampsent, l, s->samplen, ofs); - l_sampsent += l; - } else { /* end of samples, maybe some silence */ - static const short silence[FRAME_SIZE] = { 0, }; - - l += s->silencelen; - if (l > 0) { - l = MIN(l, FRAME_SIZE - ofs); - bcopy(silence, myframe + ofs, l * 2); - l_sampsent += l; - } else { /* silence is over, restart sound if loop */ - if (s->repeat == 0) { /* last block */ - o->cursound = -1; - o->nosound = 0; /* allow audio data */ - if (ofs < FRAME_SIZE) /* pad with silence */ - bcopy(silence, myframe + ofs, (FRAME_SIZE - ofs) * 2); - } - l_sampsent = 0; - } - } - } - l = soundcard_writeframe(o, myframe); - if (l > 0) - o->sampsent = l_sampsent; /* update status */ -} - -static void *sound_thread(void *arg) -{ - char ign[4096]; - struct chan_oss_pvt *o = (struct chan_oss_pvt *) arg; - - /* - * Just in case, kick the driver by trying to read from it. - * Ignore errors - this read is almost guaranteed to fail. - */ - read(o->sounddev, ign, sizeof(ign)); - for (;;) { - fd_set rfds, wfds; - int maxfd, res; - struct timeval *to = NULL, t; - - FD_ZERO(&rfds); - FD_ZERO(&wfds); - FD_SET(o->sndcmd[0], &rfds); - maxfd = o->sndcmd[0]; /* pipe from the main process */ - if (o->cursound > -1 && o->sounddev < 0) - setformat(o, O_RDWR); /* need the channel, try to reopen */ - else if (o->cursound == -1 && o->owner == NULL) - setformat(o, O_CLOSE); /* can close */ - if (o->sounddev > -1) { - if (!o->owner) { /* no one owns the audio, so we must drain it */ - FD_SET(o->sounddev, &rfds); - maxfd = MAX(o->sounddev, maxfd); - } - if (o->cursound > -1) { - /* - * We would like to use select here, but the device - * is always writable, so this would become busy wait. - * So we rather set a timeout to 1/2 of the frame size. - */ - t.tv_sec = 0; - t.tv_usec = (1000000 * FRAME_SIZE) / (5 * DEFAULT_SAMPLE_RATE); - to = &t; - } - } - /* ast_select emulates linux behaviour in terms of timeout handling */ - res = ast_select(maxfd + 1, &rfds, &wfds, NULL, to); - if (res < 0) { - ast_log(LOG_WARNING, "select failed: %s\n", strerror(errno)); - sleep(1); - continue; - } - if (FD_ISSET(o->sndcmd[0], &rfds)) { - /* read which sound to play from the pipe */ - int i, what = -1; - - read(o->sndcmd[0], &what, sizeof(what)); - for (i = 0; sounds[i].ind != -1; i++) { - if (sounds[i].ind == what) { - o->cursound = i; - o->sampsent = 0; - o->nosound = 1; /* block audio from pbx */ - break; - } - } - if (sounds[i].ind == -1) - ast_log(LOG_WARNING, "invalid sound index: %d\n", what); - } - if (o->sounddev > -1) { - if (FD_ISSET(o->sounddev, &rfds)) /* read and ignore errors */ - read(o->sounddev, ign, sizeof(ign)); - if (to != NULL) /* maybe it is possible to write */ - send_sound(o); - } - } - return NULL; /* Never reached */ -} - /*! * reset and close the device if opened, * then open and initialize it in the desired mode, @@ -763,13 +591,6 @@ static int oss_text(struct ast_channel *c, const char *text) return 0; } -/*! \brief Play ringtone 'x' on device 'o' */ -static void ring(struct chan_oss_pvt *o, int x) -{ - write(o->sndcmd[1], &x, sizeof(x)); -} - - /*! * \brief handler for incoming calls. Either autoanswer, or start ringing */ @@ -794,7 +615,7 @@ static int oss_call(struct ast_channel *c, char *dest, int timeout) f.frametype = AST_FRAME_CONTROL; f.subclass = AST_CONTROL_RINGING; ast_queue_frame(c, &f); - ring(o, AST_CONTROL_RING); + ast_indicate(c, AST_CONTROL_RINGING); } else if (o->autoanswer) { ast_verbose(" << Auto-answered >> \n"); f.frametype = AST_FRAME_CONTROL; @@ -805,7 +626,7 @@ static int oss_call(struct ast_channel *c, char *dest, int timeout) f.frametype = AST_FRAME_CONTROL; f.subclass = AST_CONTROL_RINGING; ast_queue_frame(c, &f); - ring(o, AST_CONTROL_RING); + ast_indicate(c, AST_CONTROL_RINGING); } return 0; } @@ -815,16 +636,8 @@ static int oss_call(struct ast_channel *c, char *dest, int timeout) */ static int oss_answer(struct ast_channel *c) { - struct chan_oss_pvt *o = c->tech_pvt; - ast_verbose(" << Console call has been answered >> \n"); -#if 0 - /* play an answer tone (XXX do we really need it ?) */ - ring(o, AST_CONTROL_ANSWER); -#endif ast_setstate(c, AST_STATE_UP); - o->cursound = -1; - o->nosound = 0; return 0; } @@ -832,8 +645,6 @@ static int oss_hangup(struct ast_channel *c) { struct chan_oss_pvt *o = c->tech_pvt; - o->cursound = -1; - o->nosound = 0; c->tech_pvt = NULL; o->owner = NULL; ast_verbose(" << Hangup on console >> \n"); @@ -844,9 +655,6 @@ static int oss_hangup(struct ast_channel *c) /* Assume auto-hangup too */ o->hookstate = 0; setformat(o, O_CLOSE); - } else { - /* Make congestion noise */ - ring(o, AST_CONTROL_CONGESTION); } } return 0; @@ -858,11 +666,6 @@ static int oss_write(struct ast_channel *c, struct ast_frame *f) int src; struct chan_oss_pvt *o = c->tech_pvt; - /* Immediately return if no sound is enabled */ - if (o->nosound) - return 0; - /* Stop any currently playing sound */ - o->cursound = -1; /* * we could receive a block which is not a multiple of our * FRAME_SIZE, so buffer it locally and write to the device @@ -948,43 +751,33 @@ static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) static int oss_indicate(struct ast_channel *c, int cond, const void *data, size_t datalen) { struct chan_oss_pvt *o = c->tech_pvt; - int res = -1; + int res = 0; switch (cond) { case AST_CONTROL_BUSY: case AST_CONTROL_CONGESTION: case AST_CONTROL_RINGING: - res = cond; - break; - case -1: - o->cursound = -1; - o->nosound = 0; /* when cursound is -1 nosound must be 0 */ - return 0; - - case AST_CONTROL_VIDUPDATE: res = -1; break; - + case AST_CONTROL_PROGRESS: + case AST_CONTROL_PROCEEDING: + case AST_CONTROL_VIDUPDATE: + break; case AST_CONTROL_HOLD: ast_verbose(" << Console Has Been Placed on Hold >> \n"); ast_moh_start(c, data, o->mohinterpret); break; - case AST_CONTROL_UNHOLD: ast_verbose(" << Console Has Been Retrieved from Hold >> \n"); ast_moh_stop(c); break; - default: ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, c->name); return -1; } - if (res > -1) - ring(o, res); - - return 0; + return res; } /*! @@ -1149,8 +942,7 @@ static char *console_autoanswer(struct ast_cli_entry *e, int cmd, struct ast_cli } /*! \brief helper function for the answer key/cli command */ -char *console_do_answer(int fd); -char *console_do_answer(int fd) +static char *console_do_answer(int fd) { struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER }; struct chan_oss_pvt *o = find_desc(oss_active); @@ -1160,8 +952,6 @@ char *console_do_answer(int fd) return CLI_FAILURE; } o->hookstate = 1; - o->cursound = -1; - o->nosound = 0; ast_queue_frame(o->owner, &f); return CLI_SUCCESS; } @@ -1242,8 +1032,6 @@ static char *console_hangup(struct ast_cli_entry *e, int cmd, struct ast_cli_arg if (a->argc != e->args) return CLI_SHOWUSAGE; - o->cursound = -1; - o->nosound = 0; if (!o->owner && !o->hookstate) { /* XXX maybe only one ? */ ast_cli(a->fd, "No call to hang up\n"); return CLI_FAILURE; @@ -1271,8 +1059,6 @@ static char *console_flash(struct ast_cli_entry *e, int cmd, struct ast_cli_args if (a->argc != e->args) return CLI_SHOWUSAGE; - o->cursound = -1; - o->nosound = 0; /* when cursound is -1 nosound must be 0 */ if (!o->owner) { /* XXX maybe !o->hookstate too ? */ ast_cli(a->fd, "No call to flash\n"); return CLI_FAILURE; @@ -1595,7 +1381,7 @@ static struct chan_oss_pvt *store_config(struct ast_config *cfg, char *ctg) if (o == &oss_default) /* we are done with the default */ return NULL; - openit: +openit: #ifdef TRYOPEN if (setformat(o, O_RDWR) < 0) { /* open device */ ast_verb(1, "Device %s not detected\n", ctg); @@ -1605,11 +1391,7 @@ static struct chan_oss_pvt *store_config(struct ast_config *cfg, char *ctg) if (o->duplex != M_FULL) ast_log(LOG_WARNING, "XXX I don't work right with non " "full-duplex sound cards XXX\n"); #endif /* TRYOPEN */ - if (pipe(o->sndcmd) != 0) { - ast_log(LOG_ERROR, "Unable to create pipe\n"); - goto error; - } - ast_pthread_create_background(&o->sthread, NULL, sound_thread, o); + /* link into list of devices */ if (o != &oss_default) { o->next = oss_default.next; @@ -1617,10 +1399,12 @@ static struct chan_oss_pvt *store_config(struct ast_config *cfg, char *ctg) } return o; - error: +#ifdef TRYOPEN +error: if (o != &oss_default) ast_free(o); return NULL; +#endif } static int load_module(void) @@ -1673,15 +1457,10 @@ static int unload_module(void) for (o = oss_default.next; o; o = o->next) { close(o->sounddev); - if (o->sndcmd[0] > 0) { - close(o->sndcmd[0]); - close(o->sndcmd[1]); - } if (o->owner) ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD); if (o->owner) /* XXX how ??? */ return -1; - /* XXX what about the thread ? */ /* XXX what about the memory allocated ? */ } return 0; diff --git a/channels/gentone.c b/channels/gentone.c deleted file mode 100644 index fc97e389e4..0000000000 --- a/channels/gentone.c +++ /dev/null @@ -1,100 +0,0 @@ -/* Generate a header file for a particular - single or double frequency */ - -/*! \file - * \brief - * Generate a header file for a particular single or double frequency - */ - -#include -#include -#include -#include -#include -#define CLIP 32635 -#define BIAS 0x84 -static float loudness=16384.0; - -static int calc_samples(int freq) -{ - int x, samples; - /* Calculate the number of samples at 8000hz sampling - we need to have this wave form */ - samples = 8000; - /* Take out common 2's up to six times */ - for (x=0;x<6;x++) - if (!(freq % 2)) { - freq /= 2; - samples /= 2; - } - /* Take out common 5's (up to three times */ - for (x=0;x<3;x++) - if (!(freq % 5)) { - freq /= 5; - samples /=5; - } - /* No more common factors. */ - return samples; -} - -int main(int argc, char *argv[]) -{ - FILE *f; - int freq1, freq2; - float wlen1, wlen2; - float val; - int x, samples1, samples2=0, samples=0; - char fn[256]; - if (argc < 3) { - fprintf(stderr, "Usage: gensound [freq2]\n"); - exit(1); - } - freq1 = atoi(argv[2]); - if (argc > 3) - freq2 = atoi(argv[3]); - else - freq2 = 0; - wlen1 = 8000.0/(float)freq1; - samples1 = calc_samples(freq1); - printf("Wavelength 1 (in samples): %10.5f\n", wlen1); - printf("Minimum samples (1): %d (%f.3 wavelengths)\n", samples1, samples1 / wlen1); - if (freq2) { - wlen2 = 8000.0/(float)freq2; - samples2 = calc_samples(freq2); - printf("Wavelength 1 (in samples): %10.5f\n", wlen2); - printf("Minimum samples (1): %d (%f.3 wavelengths)\n", samples2, samples2 / wlen2); - } - samples = samples1; - if (freq2) { - while(samples % samples2) - samples += samples1; - } - printf("Need %d samples\n", samples); - snprintf(fn, sizeof(fn), "%s.h", argv[1]); - if ((f = fopen(fn, "w"))) { - if (freq2) - fprintf(f, "/* %s: Generated from frequencies %d and %d \n" - " by gentone. %d samples */\n", fn, freq1, freq2, samples); - else - fprintf(f, "/* %s: Generated from frequency %d\n" - " by gentone. %d samples */\n", fn, freq1, samples); - fprintf(f, "static short %s[%d] = {\n\t", argv[1], samples); - for (x=0;x