From: <kr...@us...> - 2006-11-28 03:18:42
|
Revision: 479 http://svn.sourceforge.net/astlinux/?rev=479&view=rev Author: krisk84 Date: 2006-11-27 19:18:42 -0800 (Mon, 27 Nov 2006) Log Message: ----------- commit changes from Ingmars branch with fixes Modified Paths: -------------- trunk/package/Config.in trunk/package/asterisk/asterisk.mk trunk/package/usbutils/usbutils.mk trunk/target/generic/target_skeleton/etc/init.d/misc trunk/target/generic/target_skeleton/stat/etc/rc.conf trunk/toolchain/uClibc/uclibc.mk Added Paths: ----------- trunk/package/asterisk/app_rxfax.c trunk/package/asterisk/app_txfax.c trunk/package/asterisk/spandsp.patch trunk/package/efax/ trunk/package/efax/Config.in trunk/package/efax/efax.mk trunk/package/efax/efax.patch trunk/package/iaxmodem/ trunk/package/iaxmodem/Config.in trunk/package/iaxmodem/iaxmodem.init trunk/package/iaxmodem/iaxmodem.mk trunk/package/iaxmodem/iaxmodem.patch trunk/package/libtiff/ trunk/package/libtiff/Config.in trunk/package/libtiff/libtiff.mk trunk/package/spandsp/ trunk/package/spandsp/Config.in trunk/package/spandsp/at_interpreter_dictionary.h trunk/package/spandsp/spandsp.mk trunk/package/spandsp/spandsp.patch trunk/target/generic/target_skeleton/etc/runlevels/default/K04iaxmodem trunk/target/generic/target_skeleton/etc/runlevels/default/S61iaxmodem trunk/toolchain/uClibc/Makefile.libm trunk/toolchain/uClibc/s_lrint.c Removed Paths: ------------- trunk/package/efax/Config.in trunk/package/efax/efax.mk trunk/package/efax/efax.patch trunk/package/iaxmodem/Config.in trunk/package/iaxmodem/iaxmodem.init trunk/package/iaxmodem/iaxmodem.mk trunk/package/iaxmodem/iaxmodem.patch trunk/package/libtiff/Config.in trunk/package/libtiff/libtiff.mk trunk/package/spandsp/Config.in trunk/package/spandsp/at_interpreter_dictionary.h trunk/package/spandsp/spandsp.mk trunk/package/spandsp/spandsp.patch Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2006-11-27 17:19:44 UTC (rev 478) +++ trunk/package/Config.in 2006-11-28 03:18:42 UTC (rev 479) @@ -58,6 +58,7 @@ source "package/dm/Config.in" source "package/dnsmasq/Config.in" source "package/dropbear/Config.in" +source "package/efax/Config.in" source "package/expat/Config.in" source "package/e2fsprogs/Config.in" source "package/fakeroot/Config.in" @@ -68,6 +69,7 @@ source "package/gzip/Config.in" source "package/hostap/Config.in" source "package/hotplug/Config.in" +source "package/iaxmodem/Config.in" source "package/inadyn/Config.in" source "package/iostat/Config.in" source "package/iproute2/Config.in" @@ -88,6 +90,7 @@ source "package/libpq/Config.in" source "package/libpri/Config.in" source "package/libsysfs/Config.in" +source "package/libtiff/Config.in" source "package/libtool/Config.in" source "package/libusb/Config.in" source "package/lighttpd/Config.in" @@ -152,6 +155,7 @@ source "package/smartmontools/Config.in" source "package/socat/Config.in" source "package/sox/Config.in" +source "package/spandsp/Config.in" source "package/sqlite/Config.in" source "package/strace/Config.in" source "package/stunnel/Config.in" Copied: trunk/package/asterisk/app_rxfax.c (from rev 477, branches/ischraub/package/asterisk/app_rxfax.c) =================================================================== --- trunk/package/asterisk/app_rxfax.c (rev 0) +++ trunk/package/asterisk/app_rxfax.c 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,389 @@ +/* + * Asterisk -- A telephony toolkit for Linux. + * + * Trivial application to receive a TIFF FAX file + * + * Copyright (C) 2003, Steve Underwood + * + * Steve Underwood <st...@co...> + * + * This program is free software, distributed under the terms of + * the GNU General Public License + */ + +#include <string.h> +#include <stdlib.h> +#include <stdio.h> +#include <inttypes.h> +#include <pthread.h> +#include <errno.h> +#include <tiffio.h> + +#include <spandsp.h> + +#include "asterisk.h" + +ASTERISK_FILE_VERSION(__FILE__, "$Revision:$") + +#include "asterisk/lock.h" +#include "asterisk/file.h" +#include "asterisk/logger.h" +#include "asterisk/channel.h" +#include "asterisk/pbx.h" +#include "asterisk/module.h" +#include "asterisk/translate.h" +#include "asterisk/dsp.h" +#include "asterisk/manager.h" + +static char *tdesc = "Trivial FAX Receive Application"; + +static char *app = "RxFAX"; + +static char *synopsis = "Receive a FAX to a file"; + +static char *descrip = +" RxFAX(filename[|caller][|debug]): Receives a FAX from the channel into the\n" +"given filename. If the file exists it will be overwritten. The file\n" +"should be in TIFF/F format.\n" +"The \"caller\" option makes the application behave as a calling machine,\n" +"rather than the answering machine. The default behaviour is to behave as\n" +"an answering machine.\n" +"Uses LOCALSTATIONID to identify itself to the remote end.\n" +" LOCALHEADERINFO to generate a header line on each page.\n" +"Sets REMOTESTATIONID to the sender CSID.\n" +" FAXPAGES to the number of pages received.\n" +" FAXBITRATE to the transmition rate.\n" +" FAXRESOLUTION to the resolution.\n" +"Returns -1 when the user hangs up.\n" +"Returns 0 otherwise.\n"; + +STANDARD_LOCAL_USER; + +LOCAL_USER_DECL; + +#define MAX_BLOCK_SIZE 240 + +static void span_message(int level, const char *msg) +{ + int ast_level; + + if (level == SPAN_LOG_WARNING) + ast_level = __LOG_WARNING; + else if (level == SPAN_LOG_WARNING) + ast_level = __LOG_WARNING; + else + ast_level = __LOG_DEBUG; + ast_log(ast_level, __FILE__, __LINE__, __PRETTY_FUNCTION__, msg); +} +/*- End of function --------------------------------------------------------*/ + +static void t30_flush(t30_state_t *s, int which) +{ + //TODO: +} +/*- End of function --------------------------------------------------------*/ + +static void phase_e_handler(t30_state_t *s, void *user_data, int result) +{ + struct ast_channel *chan; + t30_stats_t t; + char local_ident[21]; + char far_ident[21]; + char buf[11]; + + chan = (struct ast_channel *) user_data; + if (result == T30_ERR_OK) + { + t30_get_transfer_statistics(s, &t); + t30_get_far_ident(s, far_ident); + t30_get_local_ident(s, local_ident); + ast_log(LOG_DEBUG, "==============================================================================\n"); + ast_log(LOG_DEBUG, "Fax successfully received.\n"); + ast_log(LOG_DEBUG, "Remote station id: %s\n", far_ident); + ast_log(LOG_DEBUG, "Local station id: %s\n", local_ident); + ast_log(LOG_DEBUG, "Pages transferred: %i\n", t.pages_transferred); + ast_log(LOG_DEBUG, "Image resolution: %i x %i\n", t.x_resolution, t.y_resolution); + ast_log(LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate); + ast_log(LOG_DEBUG, "==============================================================================\n"); + manager_event(EVENT_FLAG_CALL, + "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n", + chan->name, + chan->exten, + (chan->cid.cid_num) ? chan->cid.cid_num : "", + far_ident, + local_ident, + t.pages_transferred, + t.y_resolution, + t.bit_rate, + s->rx_file); + pbx_builtin_setvar_helper(chan, "REMOTESTATIONID", far_ident); + snprintf(buf, sizeof(buf), "%i", t.pages_transferred); + pbx_builtin_setvar_helper(chan, "FAXPAGES", buf); + snprintf(buf, sizeof(buf), "%i", t.y_resolution); + pbx_builtin_setvar_helper(chan, "FAXRESOLUTION", buf); + snprintf(buf, sizeof(buf), "%i", t.bit_rate); + pbx_builtin_setvar_helper(chan, "FAXBITRATE", buf); + } + else + { + ast_log(LOG_DEBUG, "==============================================================================\n"); + ast_log(LOG_DEBUG, "Fax receive not successful - result (%d) %s.\n", result, t30_completion_code_to_str(result)); + ast_log(LOG_DEBUG, "==============================================================================\n"); + } +} +/*- End of function --------------------------------------------------------*/ + +static void phase_d_handler(t30_state_t *s, void *user_data, int result) +{ + struct ast_channel *chan; + t30_stats_t t; + + chan = (struct ast_channel *) user_data; + if (result) + { + t30_get_transfer_statistics(s, &t); + ast_log(LOG_DEBUG, "==============================================================================\n"); + ast_log(LOG_DEBUG, "Pages transferred: %i\n", t.pages_transferred); + ast_log(LOG_DEBUG, "Image size: %i x %i\n", t.width, t.length); + ast_log(LOG_DEBUG, "Image resolution %i x %i\n", t.x_resolution, t.y_resolution); + ast_log(LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate); + ast_log(LOG_DEBUG, "Bad rows %i\n", t.bad_rows); + ast_log(LOG_DEBUG, "Longest bad row run %i\n", t.longest_bad_row_run); + ast_log(LOG_DEBUG, "Compression type %i\n", t.encoding); + ast_log(LOG_DEBUG, "Image size (bytes) %i\n", t.image_size); + ast_log(LOG_DEBUG, "==============================================================================\n"); + } +} +/*- End of function --------------------------------------------------------*/ + +static int rxfax_exec(struct ast_channel *chan, void *data) +{ + int res = 0; + char template_file[256]; + char target_file[256]; + char *s; + char *t; + char *v; + char *x; + int option; + int len; + int i; + fax_state_t fax; + int calling_party; + int verbose; + int samples; + + struct localuser *u; + struct ast_frame *inf = NULL; + struct ast_frame outf; + + int original_read_fmt; + int original_write_fmt; + + uint8_t __buf[sizeof(uint16_t)*MAX_BLOCK_SIZE + 2*AST_FRIENDLY_OFFSET]; + uint8_t *buf = __buf + AST_FRIENDLY_OFFSET; + + if (chan == NULL) + { + ast_log(LOG_WARNING, "Fax receive channel is NULL. Giving up.\n"); + return -1; + } + + span_set_message_handler(span_message); + + /* The next few lines of code parse out the filename and header from the input string */ + if (data == NULL) + { + /* No data implies no filename or anything is present */ + ast_log(LOG_WARNING, "Rxfax requires an argument (filename)\n"); + return -1; + } + + calling_party = FALSE; + verbose = FALSE; + target_file[0] = '\0'; + + for (option = 0, v = s = data; v; option++, s++) + { + t = s; + v = strchr(s, '|'); + s = (v) ? v : s + strlen(s); + strncpy((char *) buf, t, s - t); + buf[s - t] = '\0'; + if (option == 0) + { + /* The first option is always the file name */ + len = s - t; + if (len > 255) + len = 255; + strncpy(target_file, t, len); + target_file[len] = '\0'; + /* Allow the use of %d in the file name for a wild card of sorts, to + create a new file with the specified name scheme */ + if ((x = strchr(target_file, '%')) && x[1] == 'd') + { + strcpy(template_file, target_file); + i = 0; + do + { + snprintf(target_file, 256, template_file, 1); + i++; + } + while (ast_fileexists(target_file, "", chan->language) != -1); + } + } + else if (strncmp("caller", t, s - t) == 0) + { + calling_party = TRUE; + } + else if (strncmp("debug", t, s - t) == 0) + { + verbose = TRUE; + } + } + + /* Done parsing */ + + LOCAL_USER_ADD(u); + + if (chan->_state != AST_STATE_UP) + { + /* Shouldn't need this, but checking to see if channel is already answered + * Theoretically asterisk should already have answered before running the app */ + res = ast_answer(chan); + } + + if (!res) + { + original_read_fmt = chan->readformat; + if (original_read_fmt != AST_FORMAT_SLINEAR) + { + res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); + if (res < 0) + { + ast_log(LOG_WARNING, "Unable to set to linear read mode, giving up\n"); + return -1; + } + } + original_write_fmt = chan->writeformat; + if (original_write_fmt != AST_FORMAT_SLINEAR) + { + res = ast_set_write_format(chan, AST_FORMAT_SLINEAR); + if (res < 0) + { + ast_log(LOG_WARNING, "Unable to set to linear write mode, giving up\n"); + res = ast_set_read_format(chan, original_read_fmt); + if (res) + ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); + return -1; + } + } + fax_init(&fax, calling_party); + if (verbose) + fax.logging.level = SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW; + x = pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"); + if (x && x[0]) + t30_set_local_ident(&fax.t30_state, x); + x = pbx_builtin_getvar_helper(chan, "LOCALHEADERINFO"); + if (x && x[0]) + t30_set_header_info(&fax.t30_state, x); + t30_set_rx_file(&fax.t30_state, target_file, -1); + //t30_set_phase_b_handler(&fax.t30_state, phase_b_handler, chan); + t30_set_phase_d_handler(&fax.t30_state, phase_d_handler, chan); + t30_set_phase_e_handler(&fax.t30_state, phase_e_handler, chan); + t30_set_ecm_capability(&fax.t30_state, TRUE); + t30_set_supported_compressions(&fax.t30_state, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); + while (ast_waitfor(chan, -1) > -1) + { + inf = ast_read(chan); + if (inf == NULL) + { + res = -1; + break; + } + if (inf->frametype == AST_FRAME_VOICE) + { + if (fax_rx(&fax, inf->data, inf->samples)) + break; + samples = (inf->samples <= MAX_BLOCK_SIZE) ? inf->samples : MAX_BLOCK_SIZE; + len = fax_tx(&fax, (int16_t *) &buf[AST_FRIENDLY_OFFSET], samples); + if (len) + { + memset(&outf, 0, sizeof(outf)); + outf.frametype = AST_FRAME_VOICE; + outf.subclass = AST_FORMAT_SLINEAR; + outf.datalen = len*sizeof(int16_t); + outf.samples = len; + outf.data = &buf[AST_FRIENDLY_OFFSET]; + outf.offset = AST_FRIENDLY_OFFSET; + outf.src = "RxFAX"; + if (ast_write(chan, &outf) < 0) + { + ast_log(LOG_WARNING, "Unable to write frame to channel; %s\n", strerror(errno)); + break; + } + } + } + ast_frfree(inf); + } + if (inf == NULL) + { + ast_log(LOG_DEBUG, "Got hangup\n"); + res = -1; + } + if (original_read_fmt != AST_FORMAT_SLINEAR) + { + res = ast_set_read_format(chan, original_read_fmt); + if (res) + ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); + } + if (original_write_fmt != AST_FORMAT_SLINEAR) + { + res = ast_set_write_format(chan, original_write_fmt); + if (res) + ast_log(LOG_WARNING, "Unable to restore write format on '%s'\n", chan->name); + } + t30_terminate(&fax.t30_state); + } + else + { + ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name); + } + LOCAL_USER_REMOVE(u); + return res; +} +/*- End of function --------------------------------------------------------*/ + +int unload_module(void) +{ + STANDARD_HANGUP_LOCALUSERS; + return ast_unregister_application(app); +} +/*- End of function --------------------------------------------------------*/ + +int load_module(void) +{ + return ast_register_application(app, rxfax_exec, synopsis, descrip); +} +/*- End of function --------------------------------------------------------*/ + +char *description(void) +{ + return tdesc; +} +/*- End of function --------------------------------------------------------*/ + +int usecount(void) +{ + int res; + STANDARD_USECOUNT(res); + return res; +} +/*- End of function --------------------------------------------------------*/ + +char *key(void) +{ + return ASTERISK_GPL_KEY; +} +/*- End of function --------------------------------------------------------*/ +/*- End of file ------------------------------------------------------------*/ Copied: trunk/package/asterisk/app_txfax.c (from rev 477, branches/ischraub/package/asterisk/app_txfax.c) =================================================================== --- trunk/package/asterisk/app_txfax.c (rev 0) +++ trunk/package/asterisk/app_txfax.c 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,315 @@ +/* + * Asterisk -- A telephony toolkit for Linux. + * + * Trivial application to send a TIFF file as a FAX + * + * Copyright (C) 2003, Steve Underwood + * + * Steve Underwood <st...@co...> + * + * This program is free software, distributed under the terms of + * the GNU General Public License + */ + +#include <string.h> +#include <stdlib.h> +#include <stdio.h> +#include <inttypes.h> +#include <pthread.h> +#include <errno.h> +#include <tiffio.h> + +#include <spandsp.h> + +#include "asterisk.h" + +ASTERISK_FILE_VERSION(__FILE__, "$Revision:$") + +#include "asterisk/lock.h" +#include "asterisk/file.h" +#include "asterisk/logger.h" +#include "asterisk/channel.h" +#include "asterisk/pbx.h" +#include "asterisk/module.h" +#include "asterisk/translate.h" + +static char *tdesc = "Trivial FAX Transmit Application"; + +static char *app = "TxFAX"; + +static char *synopsis = "Send a FAX file"; + +static char *descrip = +" TxFAX(filename[|caller][|debug]): Send a given TIFF file to the channel as a FAX.\n" +"The \"caller\" option makes the application behave as a calling machine,\n" +"rather than the answering machine. The default behaviour is to behave as\n" +"an answering machine.\n" +"Uses LOCALSTATIONID to identify itself to the remote end.\n" +" LOCALHEADERINFO to generate a header line on each page.\n" +"Sets REMOTESTATIONID to the receiver CSID.\n" +"Returns -1 when the user hangs up, or if the file does not exist.\n" +"Returns 0 otherwise.\n"; + +STANDARD_LOCAL_USER; + +LOCAL_USER_DECL; + +#define MAX_BLOCK_SIZE 240 + +static void span_message(int level, const char *msg) +{ + int ast_level; + + if (level == SPAN_LOG_WARNING) + ast_level = __LOG_WARNING; + else if (level == SPAN_LOG_WARNING) + ast_level = __LOG_WARNING; + else + ast_level = __LOG_DEBUG; + ast_log(ast_level, __FILE__, __LINE__, __PRETTY_FUNCTION__, msg); +} +/*- End of function --------------------------------------------------------*/ + +static void t30_flush(t30_state_t *s, int which) +{ + //TODO: +} +/*- End of function --------------------------------------------------------*/ + +static void phase_e_handler(t30_state_t *s, void *user_data, int result) +{ + struct ast_channel *chan; + char far_ident[21]; + + chan = (struct ast_channel *) user_data; + if (result == T30_ERR_OK) + { + t30_get_far_ident(s, far_ident); + pbx_builtin_setvar_helper(chan, "REMOTESTATIONID", far_ident); + } + else + { + ast_log(LOG_DEBUG, "==============================================================================\n"); + ast_log(LOG_DEBUG, "Fax send not successful - result (%d) %s.\n", result, t30_completion_code_to_str(result)); + ast_log(LOG_DEBUG, "==============================================================================\n"); + } +} +/*- End of function --------------------------------------------------------*/ + +static int txfax_exec(struct ast_channel *chan, void *data) +{ + int res = 0; + char source_file[256]; + char *x; + char *s; + char *t; + char *v; + int option; + int len; + fax_state_t fax; + int calling_party; + int verbose; + int samples; + + struct localuser *u; + struct ast_frame *inf = NULL; + struct ast_frame outf; + + int original_read_fmt; + int original_write_fmt; + + uint8_t __buf[sizeof(uint16_t)*MAX_BLOCK_SIZE + 2*AST_FRIENDLY_OFFSET]; + uint8_t *buf = __buf + AST_FRIENDLY_OFFSET; + + if (chan == NULL) + { + ast_log(LOG_WARNING, "Fax transmit channel is NULL. Giving up.\n"); + return -1; + } + + span_set_message_handler(span_message); + + /* The next few lines of code parse out the filename and header from the input string */ + if (data == NULL) + { + /* No data implies no filename or anything is present */ + ast_log(LOG_WARNING, "Txfax requires an argument (filename)\n"); + return -1; + } + + calling_party = FALSE; + verbose = FALSE; + source_file[0] = '\0'; + + for (option = 0, v = s = data; v; option++, s++) + { + t = s; + v = strchr(s, '|'); + s = (v) ? v : s + strlen(s); + strncpy((char *) buf, t, s - t); + buf[s - t] = '\0'; + if (option == 0) + { + /* The first option is always the file name */ + len = s - t; + if (len > 255) + len = 255; + strncpy(source_file, t, len); + source_file[len] = '\0'; + } + else if (strncmp("caller", t, s - t) == 0) + { + calling_party = TRUE; + } + else if (strncmp("debug", t, s - t) == 0) + { + verbose = TRUE; + } + } + + /* Done parsing */ + + LOCAL_USER_ADD(u); + + if (chan->_state != AST_STATE_UP) + { + /* Shouldn't need this, but checking to see if channel is already answered + * Theoretically asterisk should already have answered before running the app */ + res = ast_answer(chan); + } + + if (!res) + { + original_read_fmt = chan->readformat; + if (original_read_fmt != AST_FORMAT_SLINEAR) + { + res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); + if (res < 0) + { + ast_log(LOG_WARNING, "Unable to set to linear read mode, giving up\n"); + return -1; + } + } + original_write_fmt = chan->writeformat; + if (original_write_fmt != AST_FORMAT_SLINEAR) + { + res = ast_set_write_format(chan, AST_FORMAT_SLINEAR); + if (res < 0) + { + ast_log(LOG_WARNING, "Unable to set to linear write mode, giving up\n"); + res = ast_set_read_format(chan, original_read_fmt); + if (res) + ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); + return -1; + } + } + fax_init(&fax, calling_party); + if (verbose) + fax.logging.level = SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW; + + x = pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"); + if (x && x[0]) + t30_set_local_ident(&fax.t30_state, x); + x = pbx_builtin_getvar_helper(chan, "LOCALHEADERINFO"); + if (x && x[0]) + t30_set_header_info(&fax.t30_state, x); + t30_set_tx_file(&fax.t30_state, source_file, -1, -1); + //t30_set_phase_b_handler(&fax.t30_state, phase_b_handler, chan); + //t30_set_phase_d_handler(&fax.t30_state, phase_d_handler, chan); + t30_set_phase_e_handler(&fax.t30_state, phase_e_handler, chan); + t30_set_ecm_capability(&fax.t30_state, TRUE); + t30_set_supported_compressions(&fax.t30_state, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); + while (ast_waitfor(chan, -1) > -1) + { + inf = ast_read(chan); + if (inf == NULL) + { + res = -1; + break; + } + if (inf->frametype == AST_FRAME_VOICE) + { + if (fax_rx(&fax, inf->data, inf->samples)) + break; + samples = (inf->samples <= MAX_BLOCK_SIZE) ? inf->samples : MAX_BLOCK_SIZE; + len = fax_tx(&fax, (int16_t *) &buf[AST_FRIENDLY_OFFSET], samples); + if (len) + { + memset(&outf, 0, sizeof(outf)); + outf.frametype = AST_FRAME_VOICE; + outf.subclass = AST_FORMAT_SLINEAR; + outf.datalen = len*sizeof(int16_t); + outf.samples = len; + outf.data = &buf[AST_FRIENDLY_OFFSET]; + outf.offset = AST_FRIENDLY_OFFSET; + if (ast_write(chan, &outf) < 0) + { + ast_log(LOG_WARNING, "Unable to write frame to channel; %s\n", strerror(errno)); + break; + } + } + } + ast_frfree(inf); + } + if (inf == NULL) + { + ast_log(LOG_DEBUG, "Got hangup\n"); + res = -1; + } + if (original_read_fmt != AST_FORMAT_SLINEAR) + { + res = ast_set_read_format(chan, original_read_fmt); + if (res) + ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name); + } + if (original_write_fmt != AST_FORMAT_SLINEAR) + { + res = ast_set_write_format(chan, original_write_fmt); + if (res) + ast_log(LOG_WARNING, "Unable to restore write format on '%s'\n", chan->name); + } + t30_terminate(&fax.t30_state); + } + else + { + ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name); + } + LOCAL_USER_REMOVE(u); + return res; +} +/*- End of function --------------------------------------------------------*/ + +int unload_module(void) +{ + STANDARD_HANGUP_LOCALUSERS; + return ast_unregister_application(app); +} +/*- End of function --------------------------------------------------------*/ + +int load_module(void) +{ + return ast_register_application(app, txfax_exec, synopsis, descrip); +} +/*- End of function --------------------------------------------------------*/ + +char *description(void) +{ + return tdesc; +} +/*- End of function --------------------------------------------------------*/ + +int usecount(void) +{ + int res; + + STANDARD_USECOUNT(res); + return res; +} +/*- End of function --------------------------------------------------------*/ + +char *key(void) +{ + return ASTERISK_GPL_KEY; +} +/*- End of function --------------------------------------------------------*/ +/*- End of file ------------------------------------------------------------*/ Modified: trunk/package/asterisk/asterisk.mk =================================================================== --- trunk/package/asterisk/asterisk.mk 2006-11-27 17:19:44 UTC (rev 478) +++ trunk/package/asterisk/asterisk.mk 2006-11-28 03:18:42 UTC (rev 479) @@ -40,6 +40,11 @@ ASTERISK_OPTIONS+="-DLOW_MEMORY" endif +ifeq ($(strip $(BR2_PACKAGE_SPANDSP)),y) +ASTERISK_EXTRAS :=$(ASTERISK_EXTRAS) +ASTERISK_EXTRAS+=spandsp +endif + $(DL_DIR)/$(ASTERISK_SOURCE): $(WGET) -P $(DL_DIR) $(ASTERISK_SITE)/$(ASTERISK_SOURCE) ifeq ($(strip $(BR2_PACKAGE_ASTERISK_CHANBLUETOOTH)),y) @@ -55,6 +60,12 @@ ifeq ($(strip $(BR2_PACKAGE_ASTERISK_METERMAID)),y) toolchain/patch-kernel.sh $(ASTERISK_DIR) package/asterisk/ metermaid.patch endif +ifeq ($(strip $(BR2_PACKAGE_SPANDSP)),y) + toolchain/patch-kernel.sh $(ASTERISK_DIR)/apps package/asterisk/ spandsp.patch + cp package/asterisk/app_?xfax.c $(ASTERISK_DIR)/apps + cp $(TARGET_DIR)/usr/lib/libspandsp* $(STAGING_DIR)/usr/lib + cp $(TARGET_DIR)/usr/lib/libtiff* $(STAGING_DIR)/usr/lib +endif touch $(ASTERISK_DIR)/.source $(ASTERISK_DIR)/.configured: $(ASTERISK_DIR)/.source Copied: trunk/package/asterisk/spandsp.patch (from rev 477, branches/ischraub/package/asterisk/spandsp.patch) =================================================================== --- trunk/package/asterisk/spandsp.patch (rev 0) +++ trunk/package/asterisk/spandsp.patch 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,27 @@ +--- asterisk/apps/Makefile.orig 2006-11-20 15:22:58.000000000 +0100 ++++ asterisk/apps/Makefile 2006-11-20 11:19:49.000000000 +0100 +@@ -54,6 +54,11 @@ + APPS+=app_osplookup.so + endif + ++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp.h $(CROSS_COMPILE_TARGET)/usr/include/spandsp.h),) ++APPS+=app_rxfax.so app_txfax.so ++CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/include ++endif ++ + ifeq ($(findstring BSD,${OSARCH}),BSD) + CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib + endif +@@ -102,6 +107,12 @@ + app_curl.so: app_curl.o + $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS) + ++app_rxfax.so : app_rxfax.o ++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(CROSS_COMPILE_TARGET)/usr/lib -lspandsp -ltiff ++ ++app_txfax.so : app_txfax.o ++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(CROSS_COMPILE_TARGET)/usr/lib -lspandsp -ltiff ++ + app_sql_postgres.o: app_sql_postgres.c + $(CC) -pipe -I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include -I$(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c + Copied: trunk/package/efax (from rev 422, branches/ischraub/package/efax) Deleted: trunk/package/efax/Config.in =================================================================== --- branches/ischraub/package/efax/Config.in 2006-10-19 08:59:14 UTC (rev 422) +++ trunk/package/efax/Config.in 2006-11-28 03:18:42 UTC (rev 479) @@ -1,7 +0,0 @@ -config BR2_PACKAGE_EFAX - bool "efax" - default n - help - efax - fax software, can be used e.g. together with iaxmodem - - http://www.cce.com/efax/download/efax-0.9a-001114.tar.gz Copied: trunk/package/efax/Config.in (from rev 422, branches/ischraub/package/efax/Config.in) =================================================================== --- trunk/package/efax/Config.in (rev 0) +++ trunk/package/efax/Config.in 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,7 @@ +config BR2_PACKAGE_EFAX + bool "efax" + default n + help + efax - fax software, can be used e.g. together with iaxmodem + + http://www.cce.com/efax/download/efax-0.9a-001114.tar.gz Deleted: trunk/package/efax/efax.mk =================================================================== --- branches/ischraub/package/efax/efax.mk 2006-10-19 08:59:14 UTC (rev 422) +++ trunk/package/efax/efax.mk 2006-11-28 03:18:42 UTC (rev 479) @@ -1,49 +0,0 @@ -############################################################# -# -# efax -# -############################################################# -EFAX_VER:=0.9a-001114 -EFAX_SOURCE:=efax-$(EFAX_VER).tar.gz -EFAX_SITE:=http://www.cce.com/efax/download -EFAX_DIR:=$(BUILD_DIR)/efax-$(EFAX_VER) -EFAX_CAT:=zcat -EFAX_BINARY:=$(EFAX_DIR)/efax -EFAX_TARGET_BINARY:=$(TARGET_DIR)/usr/sbin/efax - -$(DL_DIR)/$(EFAX_SOURCE): - $(WGET) -P $(DL_DIR) $(EFAX_SITE)/$(EFAX_SOURCE) - -$(EFAX_DIR)/.unpacked: $(DL_DIR)/$(EFAX_SOURCE) - $(EFAX_CAT) $(DL_DIR)/$(EFAX_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - touch $(EFAX_DIR)/.unpacked - -$(EFAX_DIR)/.built: $(EFAX_DIR)/.unpacked - toolchain/patch-kernel.sh $(EFAX_DIR) package/efax/ efax\*.patch - $(MAKE) CC=$(TARGET_CC) CFLAGS="-I$(STAGING_DIR)/usr/include" LDFLAGS="-L$(TARGET_DIR)/lib" -C $(EFAX_DIR) - touch $(EFAX_DIR)/.built - -$(EFAX_DIR)/.installed: $(EFAX_DIR)/.built - install -D -m 0755 $(EFAX_BINARY) $(EFAX_TARGET_BINARY) - $(STRIP) --strip-unneeded $(EFAX_TARGET_BINARY) - install -D -m 0755 $(EFAX_DIR)/efix $(TARGET_DIR)/usr/bin/efix - $(STRIP) --strip-unneeded $(TARGET_DIR)/usr/bin/efix - install -D -m 0755 $(EFAX_DIR)/fax $(TARGET_DIR)/usr/bin/fax - touch $(EFAX_DIR)/.built - -efax: uclibc $(EFAX_DIR)/.installed - -efax-clean: - $(MAKE) -C $(EFAX_DIR) clean - -efax-dirclean: - rm -rf $(EFAX_DIR) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(strip $(BR2_PACKAGE_EFAX)),y) -TARGETS+=efax -endif Copied: trunk/package/efax/efax.mk (from rev 422, branches/ischraub/package/efax/efax.mk) =================================================================== --- trunk/package/efax/efax.mk (rev 0) +++ trunk/package/efax/efax.mk 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,49 @@ +############################################################# +# +# efax +# +############################################################# +EFAX_VER:=0.9a-001114 +EFAX_SOURCE:=efax-$(EFAX_VER).tar.gz +EFAX_SITE:=http://www.cce.com/efax/download +EFAX_DIR:=$(BUILD_DIR)/efax-$(EFAX_VER) +EFAX_CAT:=zcat +EFAX_BINARY:=$(EFAX_DIR)/efax +EFAX_TARGET_BINARY:=$(TARGET_DIR)/usr/sbin/efax + +$(DL_DIR)/$(EFAX_SOURCE): + $(WGET) -P $(DL_DIR) $(EFAX_SITE)/$(EFAX_SOURCE) + +$(EFAX_DIR)/.unpacked: $(DL_DIR)/$(EFAX_SOURCE) + $(EFAX_CAT) $(DL_DIR)/$(EFAX_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + touch $(EFAX_DIR)/.unpacked + +$(EFAX_DIR)/.built: $(EFAX_DIR)/.unpacked + toolchain/patch-kernel.sh $(EFAX_DIR) package/efax/ efax\*.patch + $(MAKE) CC=$(TARGET_CC) CFLAGS="-I$(STAGING_DIR)/usr/include" LDFLAGS="-L$(TARGET_DIR)/lib" -C $(EFAX_DIR) + touch $(EFAX_DIR)/.built + +$(EFAX_DIR)/.installed: $(EFAX_DIR)/.built + $(INSTALL) -D -m 0755 $(EFAX_BINARY) $(EFAX_TARGET_BINARY) + $(STRIP) --strip-unneeded $(EFAX_TARGET_BINARY) + $(INSTALL) -D -m 0755 $(EFAX_DIR)/efix $(TARGET_DIR)/usr/bin/efix + $(STRIP) --strip-unneeded $(TARGET_DIR)/usr/bin/efix + $(INSTALL) -D -m 0755 $(EFAX_DIR)/fax $(TARGET_DIR)/usr/bin/fax + touch $(EFAX_DIR)/.built + +efax: uclibc $(EFAX_DIR)/.installed + +efax-clean: + $(MAKE) -C $(EFAX_DIR) clean + +efax-dirclean: + rm -rf $(EFAX_DIR) + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_EFAX)),y) +TARGETS+=efax +endif Deleted: trunk/package/efax/efax.patch =================================================================== --- branches/ischraub/package/efax/efax.patch 2006-10-19 08:59:14 UTC (rev 422) +++ trunk/package/efax/efax.patch 2006-11-28 03:18:42 UTC (rev 479) @@ -1,31 +0,0 @@ ---- efax-0.9a-001114/Makefile.orig 2006-09-22 15:09:13.000000000 +0200 -+++ efax-0.9a-001114/Makefile 2006-09-22 15:12:31.000000000 +0200 -@@ -3,13 +3,13 @@ - # Change the following to the name of your ANSI C compiler - # (normally gcc). - --CC=gcc -+#CC=gcc - - # Compile/load options. Add -DNO_STRERROR to CFLAGS if _strerror - # is undefined - --CFLAGS= --LDFLAGS= -+#CFLAGS= -+#LDFLAGS= - - # Change the following to the destination directories for - # binaries and man pages. Probably /usr/bin and /usr/man on -@@ -25,11 +25,9 @@ - - efax: efax.o efaxlib.o efaxio.o efaxos.o efaxmsg.o - $(CC) -o efax $(LDFLAGS) efax.o efaxlib.o efaxio.o efaxos.o efaxmsg.o -- strip efax - - efix: efix.o efaxlib.o efaxmsg.o - $(CC) -o efix $(LDFLAGS) efix.o efaxlib.o efaxmsg.o -- strip efix - - install: - cp fax efax efix $(BINDIR) Copied: trunk/package/efax/efax.patch (from rev 422, branches/ischraub/package/efax/efax.patch) =================================================================== --- trunk/package/efax/efax.patch (rev 0) +++ trunk/package/efax/efax.patch 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,31 @@ +--- efax-0.9a-001114/Makefile.orig 2006-09-22 15:09:13.000000000 +0200 ++++ efax-0.9a-001114/Makefile 2006-09-22 15:12:31.000000000 +0200 +@@ -3,13 +3,13 @@ + # Change the following to the name of your ANSI C compiler + # (normally gcc). + +-CC=gcc ++#CC=gcc + + # Compile/load options. Add -DNO_STRERROR to CFLAGS if _strerror + # is undefined + +-CFLAGS= +-LDFLAGS= ++#CFLAGS= ++#LDFLAGS= + + # Change the following to the destination directories for + # binaries and man pages. Probably /usr/bin and /usr/man on +@@ -25,11 +25,9 @@ + + efax: efax.o efaxlib.o efaxio.o efaxos.o efaxmsg.o + $(CC) -o efax $(LDFLAGS) efax.o efaxlib.o efaxio.o efaxos.o efaxmsg.o +- strip efax + + efix: efix.o efaxlib.o efaxmsg.o + $(CC) -o efix $(LDFLAGS) efix.o efaxlib.o efaxmsg.o +- strip efix + + install: + cp fax efax efix $(BINDIR) Copied: trunk/package/iaxmodem (from rev 422, branches/ischraub/package/iaxmodem) Deleted: trunk/package/iaxmodem/Config.in =================================================================== --- branches/ischraub/package/iaxmodem/Config.in 2006-10-19 08:59:14 UTC (rev 422) +++ trunk/package/iaxmodem/Config.in 2006-11-28 03:18:42 UTC (rev 479) @@ -1,7 +0,0 @@ -config BR2_PACKAGE_IAXMODEM - bool "iaxmodem" - default n - help - iaxmodem - IAX Modem for Asterisk (works with Hylafax, efax, sendfax) - - http://mesh.dl.sourceforge.net/sourceforge/iaxmodem/iaxmodem-0.1.14.tar.gz Copied: trunk/package/iaxmodem/Config.in (from rev 422, branches/ischraub/package/iaxmodem/Config.in) =================================================================== --- trunk/package/iaxmodem/Config.in (rev 0) +++ trunk/package/iaxmodem/Config.in 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,7 @@ +config BR2_PACKAGE_IAXMODEM + bool "iaxmodem" + default n + help + iaxmodem - IAX Modem for Asterisk (works with Hylafax, efax, sendfax) + + http://mesh.dl.sourceforge.net/sourceforge/iaxmodem/iaxmodem-0.1.14.tar.gz Deleted: trunk/package/iaxmodem/iaxmodem.init =================================================================== --- branches/ischraub/package/iaxmodem/iaxmodem.init 2006-10-19 08:59:14 UTC (rev 422) +++ trunk/package/iaxmodem/iaxmodem.init 2006-11-28 03:18:42 UTC (rev 479) @@ -1,59 +0,0 @@ -#!/bin/sh - -. /etc/rc.conf - -init () { -if [ ! -d /var/log/iaxmodem ] -then -mkdir /var/log/iaxmodem -fi - -if [ -d /mnt/kd/iaxmodem ] -then -ln -s /mnt/kd/iaxmodem /tmp/etc/iaxmodem -else -mkdir /tmp/etc/iaxmodem -cp -a /stat/etc/iaxmodem/* /tmp/etc/iaxmodem/ -fi -} - -start () { -echo "Starting IAXmodem..." -iaxmodem -fi -} - -stop () { -if [ -r /var/run/iaxmodem.pid ] -then -echo "Stopping IAXmodem..." -kill `cat /var/run/iaxmodem.pid` -fi -} - -case $1 in - -init) -init -start -;; - -start) -start -;; - -stop) -stop -;; - -restart) -stop -sleep 2 -start -;; - -*) -echo "Usage: start|stop|restart" -;; - -esac Copied: trunk/package/iaxmodem/iaxmodem.init (from rev 422, branches/ischraub/package/iaxmodem/iaxmodem.init) =================================================================== --- trunk/package/iaxmodem/iaxmodem.init (rev 0) +++ trunk/package/iaxmodem/iaxmodem.init 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,59 @@ +#!/bin/sh + +. /etc/rc.conf + +init () { +if [ ! -d /var/log/iaxmodem ] +then +mkdir /var/log/iaxmodem +fi + +if [ -d /mnt/kd/iaxmodem ] +then +ln -s /mnt/kd/iaxmodem /tmp/etc/iaxmodem +else +mkdir /tmp/etc/iaxmodem +cp -a /stat/etc/iaxmodem/* /tmp/etc/iaxmodem/ +fi +} + +start () { +echo "Starting IAXmodem..." +iaxmodem +fi +} + +stop () { +if [ -r /var/run/iaxmodem.pid ] +then +echo "Stopping IAXmodem..." +kill `cat /var/run/iaxmodem.pid` +fi +} + +case $1 in + +init) +init +start +;; + +start) +start +;; + +stop) +stop +;; + +restart) +stop +sleep 2 +start +;; + +*) +echo "Usage: start|stop|restart" +;; + +esac Deleted: trunk/package/iaxmodem/iaxmodem.mk =================================================================== --- branches/ischraub/package/iaxmodem/iaxmodem.mk 2006-10-19 08:59:14 UTC (rev 422) +++ trunk/package/iaxmodem/iaxmodem.mk 2006-11-28 03:18:42 UTC (rev 479) @@ -1,129 +0,0 @@ -############################################################# -# -# iaxmodem -# -############################################################# -IAXMODEM_VER:=0.1.14 -IAXMODEM_SOURCE:=iaxmodem-$(IAXMODEM_VER).tar.gz -IAXMODEM_SITE:=http://mesh.dl.sourceforge.net/sourceforge/iaxmodem -IAXMODEM_DIR:=$(BUILD_DIR)/iaxmodem-$(IAXMODEM_VER) -IAXMODEM_CAT:=zcat -IAXMODEM_BINARY:=$(IAXMODEM_DIR)/iaxmodem -IAXMODEM_TARGET_BINARY:=$(TARGET_DIR)/usr/sbin/iaxmodem - -$(DL_DIR)/$(IAXMODEM_SOURCE): - $(WGET) -P $(DL_DIR) $(IAXMODEM_SITE)/$(IAXMODEM_SOURCE) - -$(IAXMODEM_DIR)/.unpacked: $(DL_DIR)/$(IAXMODEM_SOURCE) - $(IAXMODEM_CAT) $(DL_DIR)/$(IAXMODEM_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - find $(IAXMODEM_DIR) -name "*.rej" -exec rm {} \; - toolchain/patch-kernel.sh $(IAXMODEM_DIR) package/iaxmodem/ iaxmodem\*.patch - touch $(IAXMODEM_DIR)/.unpacked - -$(IAXMODEM_DIR)/.spandsp_configured: $(IAXMODEM_DIR)/.unpacked - (cd $(IAXMODEM_DIR)/lib/spandsp; rm -rf config.cache; \ - $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \ - CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ - LDFLAGS="-L$(TARGET_DIR)/usr/lib" \ - ac_cv_file__usr_X11R6_lib=no \ - ac_cv_file__usr_X11R6_lib64=no \ - ac_cv_func_realloc_0_nonnull=yes \ - ac_cv_func_malloc_0_nonnull=yes \ - ./configure \ - --target=$(GNU_TARGET_NAME) \ - --host=$(GNU_TARGET_NAME) \ - --build=$(GNU_HOST_NAME) \ - --prefix=/usr \ - --exec-prefix=/usr \ - --bindir=/usr/bin \ - --sbindir=/usr/sbin \ - --libexecdir=/usr/lib \ - --sysconfdir=/etc \ - --datadir=/usr/share \ - --localstatedir=/var \ - --mandir=/usr/man \ - --infodir=/usr/info \ - ); - touch $(IAXMODEM_DIR)/.spandsp_configured - -$(IAXMODEM_DIR)/.spandsp_built: $(IAXMODEM_DIR)/.spandsp_configured - $(MAKE) CC=$(TARGET_CC) -C $(IAXMODEM_DIR)/lib/spandsp - touch $(IAXMODEM_DIR)/.spandsp_built - -$(IAXMODEM_DIR)/.spandsp_installed: $(IAXMODEM_DIR)/.spandsp_built - make -C $(IAXMODEM_DIR)/lib/spandsp DESTDIR=$(TARGET_DIR) install - cp -r $(TARGET_DIR)/usr/include/* $(STAGING_DIR)/usr/include - rm -rf $(TARGET_DIR)/usr/include - rm -f $(TARGET_DIR)/usr/lib/libspandsp*.a $(TARGET_DIR)/usr/lib/libspandsp*.la - $(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libspandsp* - touch $(IAXMODEM_DIR)/.spandsp_installed - -$(IAXMODEM_DIR)/.libiax2_configured: $(IAXMODEM_DIR)/.spandsp_installed - (cd $(IAXMODEM_DIR)/lib/libiax2; rm -rf config.cache; \ - $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \ - CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ - LDFLAGS="-L$(TARGET_DIR)/usr/lib" \ - ./configure \ - --target=$(GNU_TARGET_NAME) \ - --host=$(GNU_TARGET_NAME) \ - --build=$(GNU_HOST_NAME) \ - --prefix=/usr \ - --exec-prefix=/usr \ - --bindir=/usr/bin \ - --sbindir=/usr/sbin \ - --libexecdir=/usr/lib \ - --sysconfdir=/etc \ - --datadir=/usr/share \ - --localstatedir=/var \ - --mandir=/usr/man \ - --infodir=/usr/info \ - ); - touch $(IAXMODEM_DIR)/.libiax2_configured - -$(IAXMODEM_DIR)/.libiax2_built: $(IAXMODEM_DIR)/.libiax2_configured - $(MAKE) CC=$(TARGET_CC) -C $(IAXMODEM_DIR)/lib/libiax2 - touch $(IAXMODEM_DIR)/.libiax2_built - -$(IAXMODEM_DIR)/.libiax2_installed: $(IAXMODEM_DIR)/.libiax2_built - make -C $(IAXMODEM_DIR)/lib/libiax2 DESTDIR=$(TARGET_DIR) install - mkdir -p $(STAGING_DIR)/usr/include/iax - cp $(IAXMODEM_DIR)/lib/libiax2/src/iax-client.h $(STAGING_DIR)/usr/include/iax - cp $(IAXMODEM_DIR)/lib/libiax2/src/iax2.h $(STAGING_DIR)/usr/include/iax - cp $(IAXMODEM_DIR)/lib/libiax2/src/frame.h $(STAGING_DIR)/usr/include/iax - cp $(IAXMODEM_DIR)/lib/libiax2/src/iax2-parser.h $(STAGING_DIR)/usr/include/iax - rm -f $(TARGET_DIR)/usr/lib/libiax*.a $(TARGET_DIR)/usr/lib/libiax*.la - $(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libiax* - $(INSTALL) -D -m 0755 package/iaxmodem/iaxmodem.init $(TARGET_DIR)/etc/init.d/iaxmodem - touch $(IAXMODEM_DIR)/.libiax2_installed - -$(IAXMODEM_DIR)/.built: $(IAXMODEM_DIR)/.libiax2_installed - (cd $(IAXMODEM_DIR); \ - $(TARGET_CC) -Wall -g -O2 -D_GNU_SOURCE -I$(STAGING_DIR)/usr/include -L$(TARGET_DIR)/usr/lib -lm -liax -lutil -lspandsp -ltiff -o iaxmodem iaxmodem.c \ - ); - -$(IAXMODEM_DIR)/.installed: $(IAXMODEM_DIR)/.built - install -D -m 0755 $(IAXMODEM_BINARY) $(IAXMODEM_TARGET_BINARY) - $(STRIP) --strip-unneeded $(IAXMODEM_TARGET_BINARY) - mkdir -p $(TARGET_DIR)/stat/etc/iaxmodem - cp $(IAXMODEM_DIR)/iaxmodem-cfg.ttyIAX $(TARGET_DIR)/stat/etc/iaxmodem - touch $(IAXMODEM_DIR)/.built - -iaxmodem: uclibc libtiff $(IAXMODEM_DIR)/.installed - -iaxmodem-clean: - $(MAKE) -C $(IAXMODEM_DIR)/lib/spandsp clean - $(MAKE) -C $(IAXMODEM_DIR)/lib/libiax2 clean - rm $(IAXMODEM_DIR)/iaxmodem - rm $(IAXMODEM_DIR)/iaxmodem.o - -iaxmodem-dirclean: - rm -rf $(IAXMODEM_DIR) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(strip $(BR2_PACKAGE_IAXMODEM)),y) -TARGETS+=iaxmodem -endif Copied: trunk/package/iaxmodem/iaxmodem.mk (from rev 422, branches/ischraub/package/iaxmodem/iaxmodem.mk) =================================================================== --- trunk/package/iaxmodem/iaxmodem.mk (rev 0) +++ trunk/package/iaxmodem/iaxmodem.mk 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,129 @@ +############################################################# +# +# iaxmodem +# +############################################################# +IAXMODEM_VER:=0.1.14 +IAXMODEM_SOURCE:=iaxmodem-$(IAXMODEM_VER).tar.gz +IAXMODEM_SITE:=http://mesh.dl.sourceforge.net/sourceforge/iaxmodem +IAXMODEM_DIR:=$(BUILD_DIR)/iaxmodem-$(IAXMODEM_VER) +IAXMODEM_CAT:=zcat +IAXMODEM_BINARY:=$(IAXMODEM_DIR)/iaxmodem +IAXMODEM_TARGET_BINARY:=$(TARGET_DIR)/usr/sbin/iaxmodem + +$(DL_DIR)/$(IAXMODEM_SOURCE): + $(WGET) -P $(DL_DIR) $(IAXMODEM_SITE)/$(IAXMODEM_SOURCE) + +$(IAXMODEM_DIR)/.unpacked: $(DL_DIR)/$(IAXMODEM_SOURCE) + $(IAXMODEM_CAT) $(DL_DIR)/$(IAXMODEM_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + find $(IAXMODEM_DIR) -name "*.rej" -exec rm {} \; + toolchain/patch-kernel.sh $(IAXMODEM_DIR) package/iaxmodem/ iaxmodem\*.patch + touch $(IAXMODEM_DIR)/.unpacked + +$(IAXMODEM_DIR)/.spandsp_configured: $(IAXMODEM_DIR)/.unpacked + (cd $(IAXMODEM_DIR)/lib/spandsp; rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + LDFLAGS="-L$(TARGET_DIR)/usr/lib" \ + ac_cv_file__usr_X11R6_lib=no \ + ac_cv_file__usr_X11R6_lib64=no \ + ac_cv_func_realloc_0_nonnull=yes \ + ac_cv_func_malloc_0_nonnull=yes \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --libexecdir=/usr/lib \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + ); + touch $(IAXMODEM_DIR)/.spandsp_configured + +$(IAXMODEM_DIR)/.spandsp_built: $(IAXMODEM_DIR)/.spandsp_configured + $(MAKE) CC=$(TARGET_CC) -C $(IAXMODEM_DIR)/lib/spandsp + touch $(IAXMODEM_DIR)/.spandsp_built + +$(IAXMODEM_DIR)/.spandsp_installed: $(IAXMODEM_DIR)/.spandsp_built + $(MAKE) -C $(IAXMODEM_DIR)/lib/spandsp DESTDIR=$(TARGET_DIR) install + cp -r $(TARGET_DIR)/usr/include/* $(STAGING_DIR)/usr/include + rm -rf $(TARGET_DIR)/usr/include + rm -f $(TARGET_DIR)/usr/lib/libspandsp*.a $(TARGET_DIR)/usr/lib/libspandsp*.la + $(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libspandsp* + touch $(IAXMODEM_DIR)/.spandsp_installed + +$(IAXMODEM_DIR)/.libiax2_configured: $(IAXMODEM_DIR)/.spandsp_installed + (cd $(IAXMODEM_DIR)/lib/libiax2; rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + LDFLAGS="-L$(TARGET_DIR)/usr/lib" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --libexecdir=/usr/lib \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + ); + touch $(IAXMODEM_DIR)/.libiax2_configured + +$(IAXMODEM_DIR)/.libiax2_built: $(IAXMODEM_DIR)/.libiax2_configured + $(MAKE) CC=$(TARGET_CC) -C $(IAXMODEM_DIR)/lib/libiax2 + touch $(IAXMODEM_DIR)/.libiax2_built + +$(IAXMODEM_DIR)/.libiax2_installed: $(IAXMODEM_DIR)/.libiax2_built + $(MAKE) -C $(IAXMODEM_DIR)/lib/libiax2 DESTDIR=$(TARGET_DIR) install + mkdir -p $(STAGING_DIR)/usr/include/iax + cp $(IAXMODEM_DIR)/lib/libiax2/src/iax-client.h $(STAGING_DIR)/usr/include/iax + cp $(IAXMODEM_DIR)/lib/libiax2/src/iax2.h $(STAGING_DIR)/usr/include/iax + cp $(IAXMODEM_DIR)/lib/libiax2/src/frame.h $(STAGING_DIR)/usr/include/iax + cp $(IAXMODEM_DIR)/lib/libiax2/src/iax2-parser.h $(STAGING_DIR)/usr/include/iax + rm -f $(TARGET_DIR)/usr/lib/libiax*.a $(TARGET_DIR)/usr/lib/libiax*.la + $(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libiax* + $(INSTALL) -D -m 0755 package/iaxmodem/iaxmodem.init $(TARGET_DIR)/etc/init.d/iaxmodem + touch $(IAXMODEM_DIR)/.libiax2_installed + +$(IAXMODEM_DIR)/.built: $(IAXMODEM_DIR)/.libiax2_installed + (cd $(IAXMODEM_DIR); \ + $(TARGET_CC) -Wall -g -O2 -D_GNU_SOURCE -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib -lm -liax -lutil -lspandsp -ltiff -o iaxmodem iaxmodem.c \ + ); + +$(IAXMODEM_DIR)/.installed: $(IAXMODEM_DIR)/.built + install -D -m 0755 $(IAXMODEM_BINARY) $(IAXMODEM_TARGET_BINARY) + $(STRIP) --strip-unneeded $(IAXMODEM_TARGET_BINARY) + mkdir -p $(TARGET_DIR)/stat/etc/iaxmodem + cp $(IAXMODEM_DIR)/iaxmodem-cfg.ttyIAX $(TARGET_DIR)/stat/etc/iaxmodem + touch $(IAXMODEM_DIR)/.built + +iaxmodem: uclibc libtiff $(IAXMODEM_DIR)/.installed + +iaxmodem-clean: + $(MAKE) -C $(IAXMODEM_DIR)/lib/spandsp clean + $(MAKE) -C $(IAXMODEM_DIR)/lib/libiax2 clean + rm $(IAXMODEM_DIR)/iaxmodem + rm $(IAXMODEM_DIR)/iaxmodem.o + +iaxmodem-dirclean: + rm -rf $(IAXMODEM_DIR) + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_IAXMODEM)),y) +TARGETS+=iaxmodem +endif Deleted: trunk/package/iaxmodem/iaxmodem.patch =================================================================== --- branches/ischraub/package/iaxmodem/iaxmodem.patch 2006-10-19 08:59:14 UTC (rev 422) +++ trunk/package/iaxmodem/iaxmodem.patch 2006-11-28 03:18:42 UTC (rev 479) @@ -1,14 +0,0 @@ ---- iaxmodem-0.1.14/iaxmodem.c.orig 2006-10-19 10:16:37.000000000 +0200 -+++ iaxmodem-0.1.14/iaxmodem.c 2006-09-27 12:16:19.000000000 +0200 -@@ -134,6 +134,11 @@ - #define LOG_ERROR stderr - #define LOG_INFO stdout - -+long lrintf (float x) -+{ -+ return (float) lrint( (double)x ); -+} -+ - void - printlog(FILE *fp, char *fmt, ...) - { Copied: trunk/package/iaxmodem/iaxmodem.patch (from rev 422, branches/ischraub/package/iaxmodem/iaxmodem.patch) =================================================================== --- trunk/package/iaxmodem/iaxmodem.patch (rev 0) +++ trunk/package/iaxmodem/iaxmodem.patch 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,14 @@ +--- iaxmodem-0.1.14/iaxmodem.c.orig 2006-10-19 10:16:37.000000000 +0200 ++++ iaxmodem-0.1.14/iaxmodem.c 2006-09-27 12:16:19.000000000 +0200 +@@ -134,6 +134,11 @@ + #define LOG_ERROR stderr + #define LOG_INFO stdout + ++long lrintf (float x) ++{ ++ return (float) lrint( (double)x ); ++} ++ + void + printlog(FILE *fp, char *fmt, ...) + { Copied: trunk/package/libtiff (from rev 422, branches/ischraub/package/libtiff) Deleted: trunk/package/libtiff/Config.in =================================================================== --- branches/ischraub/package/libtiff/Config.in 2006-10-19 08:59:14 UTC (rev 422) +++ trunk/package/libtiff/Config.in 2006-11-28 03:18:42 UTC (rev 479) @@ -1,7 +0,0 @@ -config BR2_PACKAGE_LIBTIFF - bool "libtiff" - default n - help - Library for handling TIFF images. - - http://www.remotesensing.org/libtiff/ Copied: trunk/package/libtiff/Config.in (from rev 422, branches/ischraub/package/libtiff/Config.in) =================================================================== --- trunk/package/libtiff/Config.in (rev 0) +++ trunk/package/libtiff/Config.in 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,7 @@ +config BR2_PACKAGE_LIBTIFF + bool "libtiff" + default n + help + Library for handling TIFF images. + + http://www.remotesensing.org/libtiff/ Deleted: trunk/package/libtiff/libtiff.mk =================================================================== --- branches/ischraub/package/libtiff/libtiff.mk 2006-10-19 08:59:14 UTC (rev 422) +++ trunk/package/libtiff/libtiff.mk 2006-11-28 03:18:42 UTC (rev 479) @@ -1,61 +0,0 @@ -############################################################# -# -# libtiff (TIFF library) -# -############################################################# - -LIBTIFF_VER:=3.8.2 -LIBTIFF_DIR:=$(BUILD_DIR)/tiff-$(LIBTIFF_VER) -LIBTIFF_SITE:=ftp://ftp.remotesensing.org/pub/libtiff -LIBTIFF_SOURCE:=tiff-$(LIBTIFF_VER).tar.gz -LIBTIFF_CAT:=zcat -LIBTIFF_BINARY:libtiff.la -LIBTIFF_TARGET_BINARY:=usr/lib/libtiff.so - -$(DL_DIR)/$(LIBTIFF_SOURCE): - $(WGET) -P $(DL_DIR) $(LIBTIFF_SITE)/$(LIBTIFF_SOURCE) - -libtiff-unpacked: $(LIBTIFF_DIR)/.unpacked -$(LIBTIFF_DIR)/.unpacked: $(DL_DIR)/$(LIBTIFF_SOURCE) - $(LIBTIFF_CAT) $(DL_DIR)/$(LIBTIFF_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - touch $(LIBTIFF_DIR)/.unpacked - -$(LIBTIFF_DIR)/.configured: $(LIBTIFF_DIR)/.unpacked - (cd $(LIBTIFF_DIR); rm -rf config.cache; \ - $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \ - CFLAGS="$(TARGET_CFLAGS)" \ - ./configure \ - --target=$(GNU_TARGET_NAME) \ - --host=$(GNU_TARGET_NAME) \ - --build=$(GNU_HOST_NAME) \ - --prefix=/usr \ - --disable-debug \ - --disable-build-docs \ - ); - touch $(LIBTIFF_DIR)/.configured - -$(LIBTIFF_DIR)/$(LIBTIFF_BINARY): $(LIBTIFF_DIR)/.configured - $(TARGET_CONFIGURE_OPTS) $(MAKE) CC=$(TARGET_CC) -C $(LIBTIFF_DIR) - -$(TARGET_DIR)/$(LIBTIFF_TARGET_BINARY): $(LIBTIFF_DIR)/$(LIBTIFF_BINARY) - make -C $(LIBTIFF_DIR) DESTDIR=$(TARGET_DIR) install - rm -f $(TARGET_DIR)/usr/lib/libtiff*.a $(TARGET_DIR)/usr/lib/libtiff*.la - rm -rf $(TARGET_DIR)/usr/man - cp $(LIBTIFF_DIR)/libtiff/*.h $(STAGING_DIR)/usr/include - -tiff libtiff: uclibc $(TARGET_DIR)/$(LIBTIFF_TARGET_BINARY) - -libtiff-clean: - rm -f $(TARGET_DIR)/$(LIBTIFF_TARGET_BINARY) - -$(MAKE) -C $(LIBTIFF_DIR) clean - -libtiff-dirclean: - rm -rf $(LIBTIFF_DIR) -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(strip $(BR2_PACKAGE_LIBTIFF)),y) -TARGETS+=libtiff -endif Copied: trunk/package/libtiff/libtiff.mk (from rev 422, branches/ischraub/package/libtiff/libtiff.mk) =================================================================== --- trunk/package/libtiff/libtiff.mk (rev 0) +++ trunk/package/libtiff/libtiff.mk 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,60 @@ +############################################################# +# +# libtiff (TIFF library) +# +############################################################# + +LIBTIFF_VER:=3.8.2 +LIBTIFF_DIR:=$(BUILD_DIR)/tiff-$(LIBTIFF_VER) +LIBTIFF_SITE:=ftp://ftp.remotesensing.org/pub/libtiff +LIBTIFF_SOURCE:=tiff-$(LIBTIFF_VER).tar.gz +LIBTIFF_CAT:=zcat +LIBTIFF_BINARY:libtiff.la +LIBTIFF_TARGET_BINARY:=usr/lib/libtiff.so + +$(DL_DIR)/$(LIBTIFF_SOURCE): + $(WGET) -P $(DL_DIR) $(LIBTIFF_SITE)/$(LIBTIFF_SOURCE) + +libtiff-unpacked: $(LIBTIFF_DIR)/.unpacked +$(LIBTIFF_DIR)/.unpacked: $(DL_DIR)/$(LIBTIFF_SOURCE) + $(LIBTIFF_CAT) $(DL_DIR)/$(LIBTIFF_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + touch $(LIBTIFF_DIR)/.unpacked + +$(LIBTIFF_DIR)/.configured: $(LIBTIFF_DIR)/.unpacked + (cd $(LIBTIFF_DIR); rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \ + CFLAGS="$(TARGET_CFLAGS)" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --disable-debug \ + --disable-build-docs \ + ); + touch $(LIBTIFF_DIR)/.configured + +$(LIBTIFF_DIR)/$(LIBTIFF_BINARY): $(LIBTIFF_DIR)/.configured + $(TARGET_CONFIGURE_OPTS) $(MAKE) CC=$(TARGET_CC) -C $(LIBTIFF_DIR) + +$(TARGET_DIR)/$(LIBTIFF_TARGET_BINARY): $(LIBTIFF_DIR)/$(LIBTIFF_BINARY) + $(MAKE) -C $(LIBTIFF_DIR) DESTDIR=$(STAGING_DIR) install + cp -a $(STAGING_DIR)/usr/lib/libtiff*.so* $(TARGET_DIR)/usr/lib/ + $(STRIP) $(TARGET_DIR)/usr/lib/libtiff*.so* + +tiff libtiff: uclibc $(TARGET_DIR)/$(LIBTIFF_TARGET_BINARY) + +libtiff-clean: + rm -f $(TARGET_DIR)/$(LIBTIFF_TARGET_BINARY) + -$(MAKE) -C $(LIBTIFF_DIR) clean + +libtiff-dirclean: + rm -rf $(LIBTIFF_DIR) +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_LIBTIFF)),y) +TARGETS+=libtiff +endif Copied: trunk/package/spandsp (from rev 477, branches/ischraub/package/spandsp) Deleted: trunk/package/spandsp/Config.in =================================================================== --- branches/ischraub/package/spandsp/Config.in 2006-11-21 07:02:20 UTC (rev 477) +++ trunk/package/spandsp/Config.in 2006-11-28 03:18:42 UTC (rev 479) @@ -1,7 +0,0 @@ -config BR2_PACKAGE_SPANDSP - bool "spandsp" - default n - help - spandsp - spandsp library and rxfax/txfax for Asterisk - - http://www.soft-switch.org/downloads/snapshots/spandsp/spandsp-20061116.tar.gz Copied: trunk/package/spandsp/Config.in (from rev 477, branches/ischraub/package/spandsp/Config.in) =================================================================== --- trunk/package/spandsp/Config.in (rev 0) +++ trunk/package/spandsp/Config.in 2006-11-28 03:18:42 UTC (rev 479) @@ -0,0 +1,7 @@ +config BR2_PACKAGE_SPANDSP + bool "spandsp" + default n + help + spandsp - spandsp library and rxfax/txfax for Asterisk + + http://www.soft-switch.org/downloads/snapshots/spandsp/spandsp-20061116.tar.gz Deleted: trunk/package/spandsp/at_interpreter_dictionary.h =================================================================== --- branches/ischraub/package/spandsp/at_interpreter_dictionary.h 2006-11-21 07:02:20 UTC (rev 477) +++ trunk/package/spandsp/at_interpreter_dictionary.h 2006-11-28 03:18:42 UTC (rev 479) @@ -1,909 +0,0 @@ -// The trie contains 399 entries - -static const at_cmd_service_t at_commands[] = -{ - at_cmd_dummy, - at_cmd_amp_C, - at_cmd_amp_D, - at_cmd_amp_F, - at_cmd_plus_A8A, - at_cmd_plus_A8C, - at_cmd_plus_A8E, - at_cmd_plus_A8I, - at_cmd_plus_A8J, - at_cmd_plus_A8M, - at_cmd_plus_A8R, - at_cmd_plus_A8T, - at_cmd_plus_ASTO, - at_cmd_plus_CAAP, - at_cmd_plus_CACM, - at_cmd_plus_CACSP, - at_cmd_plus_CAD, - at_cmd_plus_CAEMLPP, - at_cmd_plus_CAHLD, - at_cmd_plus_CAJOIN, - at_cmd_plus_CALA, - at_cmd_plus_CALCC, - at_cmd_plus_CALD, - at_cmd_plus_CALM, - at_cmd_plus_CAMM, - at_cmd_plus_CANCHEV, - at_cmd_plus_CAOC, - at_cmd_plus_CAPD, - at_cmd_plus_CAPTT, - at_cmd_plus_CAREJ, - at_cmd_plus_CAULEV, - at_cmd_plus_CBC, - at_cmd_plus_CBCS, - at_cmd_plus_CBIP, - at_cmd_plus_CBST, - at_cmd_plus_CCFC, - at_cmd_plus_CCLK, - at_cmd_plus_CCS, - at_cmd_plus_CCUG, - at_cmd_plus_CCWA, - at_cmd_plus_CCWE, - at_cmd_plus_CDIP, - at_cmd_plus_CDIS, - at_cmd_plus_CDV, - at_cmd_plus_CEER, - at_cmd_plus_CESP, - at_cmd_plus_CFCS, - at_cmd_plus_CFG, - at_cmd_plus_CFUN, - at_cmd_plus_CGACT, ... [truncated message content] |