[Pkg-voip-commits] r5762 - in /asterisk/trunk/debian: changelog patches/bristuff/ast-send-message patches/bristuff/ast-send-message-users patches/bristuff/uniqueid-30-app-chanspy patches/bristuff/xagi
paravoid at alioth.debian.org
paravoid at alioth.debian.org
Wed May 21 11:07:18 UTC 2008
Author: paravoid
Date: Wed May 21 11:07:18 2008
New Revision: 5762
URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=5762
Log:
Merge the last two unreleased versions, fix msp's revert to refer to the correct version
Modified:
asterisk/trunk/debian/changelog
asterisk/trunk/debian/patches/bristuff/ast-send-message
asterisk/trunk/debian/patches/bristuff/ast-send-message-users
asterisk/trunk/debian/patches/bristuff/uniqueid-30-app-chanspy
asterisk/trunk/debian/patches/bristuff/xagi
Modified: asterisk/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/changelog?rev=5762&op=diff
==============================================================================
--- asterisk/trunk/debian/changelog (original)
+++ asterisk/trunk/debian/changelog Wed May 21 11:07:18 2008
@@ -1,25 +1,19 @@
-asterisk (1:1.4.19~dfsg-2) UNRELEASED; urgency=low
+asterisk (1:1.4.19.2~dfsg-1) UNRELEASED; urgency=low
[ Lionel Elie Mamane ]
* New upstream version.
- Fix IAX performance issues introduced by security fix in 1.4.19.1
- [ Tzafrir Cohen ]
- * Fixed name of section in doc-base files.
-
- -- Lionel Elie Mamane <lmamane at debian.org> Sun, 18 May 2008 00:31:08 +0200
-
-asterisk (1:1.4.19.1~dfsg-2) UNRELEASED; urgency=low
-
[ Victor Seva ]
* Patch sample files pointing now to the correct doc files. (Closes: #475681)
* Added support for armel, thanks to Riku Voipio. (Closes: #477389)
[ Tzafrir Cohen ]
+ * Fixed name of section in doc-base files.
* Provide /usr/include/asterisk.h as well (through a symlink).
* Remove {,} bashism from debian/rules (Closes: #478361).
- -- Tzafrir Cohen <tzafrir.cohen at xorcom.com> Tue, 29 Apr 2008 01:57:43 +0300
+ -- Faidon Liambotis <paravoid at debian.org> Wed, 21 May 2008 14:04:59 +0300
asterisk (1:1.4.19.1~dfsg-1) unstable; urgency=low
Modified: asterisk/trunk/debian/patches/bristuff/ast-send-message
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff/ast-send-message?rev=5762&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/bristuff/ast-send-message (original)
+++ asterisk/trunk/debian/patches/bristuff/ast-send-message Wed May 21 11:07:18 2008
@@ -3,16 +3,17 @@
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
-@@ -245,7 +245,7 @@ struct ast_channel_tech {
- int (* const write)(struct ast_channel *chan, struct ast_frame *frame);
+@@ -247,6 +247,9 @@ struct ast_channel_tech {
+ /*! \brief Display or transmit text */
+ int (* const send_text)(struct ast_channel *chan, const char *text);
- /*! \brief Display or transmit text */
-- int (* const send_text)(struct ast_channel *chan, const char *text);
-+ int (* const send_text)(struct ast_channel *chan, const char *dest, const char *text, int ispdu);
-
++ /*! \brief send a message */
++ int (* const send_message)(struct ast_channel *chan, const char *dest, const char *text, int ispdu);
++
/*! \brief Display or send an image */
int (* const send_image)(struct ast_channel *chan, struct ast_frame *frame);
-@@ -689,6 +689,16 @@ struct ast_channel *ast_request_and_dial
+
+@@ -689,6 +692,16 @@ struct ast_channel *ast_request_and_dial
struct ast_channel *__ast_request_and_dial(const char *type, int format, void *data, int timeout, int *reason, const char *cidnum, const char *cidname, struct outgoing_helper *oh);
@@ -20,59 +21,55 @@
+ * \param type type of channel to request
+ * \param data data to pass to the channel requester
+ * \param status status
-+ * Request a channel of a given type, with data as optional information used
++ * Request a channel of a given type, with data as optional information used
+ * by the low level module
+ * \return Returns 0 on success, -1 on failure.
+ */
+int ast_send_message(const char *type, void *data, char *to, char *from, char *message, int ispdu);
-+
++
/*!\brief Register a channel technology (a new channel driver)
* Called by a channel module to register the kind of channels it supports.
* \param tech Structure defining channel technology or "type"
-@@ -905,10 +915,12 @@ int ast_set_write_format(struct ast_chan
- /*! \brief Sends text to a channel
- * Write text to a display on a channel
- * \param chan channel to act upon
+@@ -910,6 +923,16 @@ int ast_set_write_format(struct ast_chan
+ */
+ int ast_sendtext(struct ast_channel *chan, const char *text);
+
++/*! \brief Sends message to a channel
++ * Write text to a display on a channel
++ * \param chan channel to act upon
+ * \param dest destination number/user
- * \param text string of text to send on the channel
++ * \param text string of text to send on the channel
+ * \param ispdu message is in PDU format
- * \return Returns 0 on success, -1 on failure
- */
--int ast_sendtext(struct ast_channel *chan, const char *text);
-+int ast_sendtext(struct ast_channel *chan, const char *dest, const char *text, int ispdu);
-
++ * \return Returns 0 on success, -1 on failure
++ */
++int ast_sendmessage(struct ast_channel *chan, const char *dest, const char *text, int ispdu);
++
/*! \brief Receives a text character from a channel
* \param chan channel to act upon
+ * \param timeout timeout in milliseconds (0 for infinite wait)
--- a/main/channel.c
+++ b/main/channel.c
-@@ -2435,7 +2435,7 @@ char *ast_recvtext(struct ast_channel *c
- return buf;
+@@ -2448,6 +2448,19 @@ int ast_sendtext(struct ast_channel *cha
+ return res;
}
--int ast_sendtext(struct ast_channel *chan, const char *text)
-+int ast_sendtext(struct ast_channel *chan, const char *dest, const char *text, int ispdu)
++int ast_sendmessage(struct ast_channel *chan, const char *dest, const char *text, int ispdu)
++{
++ int res = 0;
++ /* Stop if we're a zombie or need a soft hangup */
++ if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan))
++ return -1;
++ CHECK_BLOCKING(chan);
++ if (chan->tech->send_message)
++ res = chan->tech->send_message(chan, dest, text, ispdu);
++ ast_clear_flag(chan, AST_FLAG_BLOCKING);
++ return res;
++}
++
+ int ast_senddigit_begin(struct ast_channel *chan, char digit)
{
- int res = 0;
- /* Stop if we're a zombie or need a soft hangup */
-@@ -2443,7 +2443,7 @@ int ast_sendtext(struct ast_channel *cha
- return -1;
- CHECK_BLOCKING(chan);
- if (chan->tech->send_text)
-- res = chan->tech->send_text(chan, text);
-+ res = chan->tech->send_text(chan, dest, text, ispdu);
- ast_clear_flag(chan, AST_FLAG_BLOCKING);
- return res;
- }
-@@ -2634,7 +2634,7 @@ int ast_write(struct ast_channel *chan,
- break;
- case AST_FRAME_TEXT:
- res = (chan->tech->send_text == NULL) ? 0 :
-- chan->tech->send_text(chan, (char *) fr->data);
-+ chan->tech->send_text(chan, NULL, (char *) fr->data, 0);
- break;
- case AST_FRAME_HTML:
- res = (chan->tech->send_html == NULL) ? 0 :
-@@ -4487,6 +4487,25 @@ void ast_channel_stop_silence_generator(
+ /* Device does not support DTMF tones, lets fake
+@@ -4487,6 +4500,25 @@ void ast_channel_stop_silence_generator(
}
@@ -86,7 +83,7 @@
+ if (from) {
+ ast_set_callerid(chan, from, from, from);
+ }
-+ res = ast_sendtext(chan, to, message, ispdu);
++ res = ast_sendmessage(chan, to, message, ispdu);
+ /* XXX what about message CDRs ??? XXX */
+ ast_hangup(chan);
+ return res;
@@ -98,172 +95,3 @@
/*! \ brief Convert channel reloadreason (ENUM) to text string for manager event */
const char *channelreloadreason2txt(enum channelreloadreason reason)
{
---- a/apps/app_sendtext.c
-+++ b/apps/app_sendtext.c
-@@ -103,7 +103,7 @@ static int sendtext_exec(struct ast_chan
- }
- status = "FAILURE";
- ast_channel_unlock(chan);
-- res = ast_sendtext(chan, args.text);
-+ res = ast_sendtext(chan, NULL, args.text, 0);
- if (!res)
- status = "SUCCESS";
- pbx_builtin_setvar_helper(chan, "SENDTEXTSTATUS", status);
---- a/res/res_agi.c
-+++ b/res/res_agi.c
-@@ -486,7 +486,7 @@ static int handle_sendtext(struct ast_ch
- would probably be to strip off the trailing newline before
- parsing, then here, add a newline at the end of the string
- before sending it to ast_sendtext --DUDE */
-- res = ast_sendtext(chan, argv[2]);
-+ res = ast_sendtext(chan, NULL, argv[2], 0);
- fdprintf(agi->fd, "200 result=%d\n", res);
- return (res >= 0) ? RESULT_SUCCESS : RESULT_FAILURE;
- }
---- a/channels/chan_agent.c
-+++ b/channels/chan_agent.c
-@@ -249,7 +249,7 @@ static int agent_answer(struct ast_chann
- static struct ast_frame *agent_read(struct ast_channel *ast);
- static int agent_write(struct ast_channel *ast, struct ast_frame *f);
- static int agent_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen);
--static int agent_sendtext(struct ast_channel *ast, const char *text);
-+static int agent_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu);
- static int agent_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen);
- static int agent_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
- static struct ast_channel *agent_bridgedchannel(struct ast_channel *chan, struct ast_channel *bridge);
-@@ -558,13 +558,13 @@ static int agent_sendhtml(struct ast_cha
- return res;
- }
-
--static int agent_sendtext(struct ast_channel *ast, const char *text)
-+static int agent_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu)
- {
- struct agent_pvt *p = ast->tech_pvt;
- int res = -1;
- ast_mutex_lock(&p->lock);
- if (p->chan)
-- res = ast_sendtext(p->chan, text);
-+ res = ast_sendtext(p->chan, dest, text, ispdu);
- ast_mutex_unlock(&p->lock);
- return res;
- }
---- a/channels/chan_alsa.c
-+++ b/channels/chan_alsa.c
-@@ -186,7 +186,7 @@ static int nosound = 0;
- /* ZZ */
- static struct ast_channel *alsa_request(const char *type, int format, void *data, int *cause);
- static int alsa_digit(struct ast_channel *c, char digit, unsigned int duration);
--static int alsa_text(struct ast_channel *c, const char *text);
-+static int alsa_text(struct ast_channel *c, const char *dest, const char *text, int ispdu);
- static int alsa_hangup(struct ast_channel *c);
- static int alsa_answer(struct ast_channel *c);
- static struct ast_frame *alsa_read(struct ast_channel *chan);
-@@ -496,7 +496,7 @@ static int alsa_digit(struct ast_channel
- return 0;
- }
-
--static int alsa_text(struct ast_channel *c, const char *text)
-+static int alsa_text(struct ast_channel *c, const char *dest, const char *text, int ispdu)
- {
- ast_mutex_lock(&alsalock);
- ast_verbose(" << Console Received text %s >> \n", text);
---- a/channels/chan_local.c
-+++ b/channels/chan_local.c
-@@ -77,7 +77,7 @@ static int local_write(struct ast_channe
- static int local_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen);
- static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
- static int local_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen);
--static int local_sendtext(struct ast_channel *ast, const char *text);
-+static int local_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu);
- static int local_devicestate(void *data);
-
- /* PBX interface structure for channel registration */
-@@ -407,7 +407,7 @@ static int local_digit_end(struct ast_ch
- return res;
- }
-
--static int local_sendtext(struct ast_channel *ast, const char *text)
-+static int local_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu)
- {
- struct local_pvt *p = ast->tech_pvt;
- int res = -1;
---- a/channels/chan_oss.c
-+++ b/channels/chan_oss.c
-@@ -405,7 +405,7 @@ static struct ast_channel *oss_request(c
- , int *cause);
- static int oss_digit_begin(struct ast_channel *c, char digit);
- static int oss_digit_end(struct ast_channel *c, char digit, unsigned int duration);
--static int oss_text(struct ast_channel *c, const char *text);
-+static int oss_text(struct ast_channel *c, const char *dest, const char *text, int ispdu);
- static int oss_hangup(struct ast_channel *c);
- static int oss_answer(struct ast_channel *c);
- static struct ast_frame *oss_read(struct ast_channel *chan);
-@@ -773,7 +773,7 @@ static int oss_digit_end(struct ast_chan
- return 0;
- }
-
--static int oss_text(struct ast_channel *c, const char *text)
-+static int oss_text(struct ast_channel *c, const char *dest, const char *text, int ispdu)
- {
- /* print received messages */
- ast_verbose(" << Console Received text %s >> \n", text);
---- a/channels/chan_phone.c
-+++ b/channels/chan_phone.c
-@@ -166,7 +166,7 @@ static int phone_answer(struct ast_chann
- static struct ast_frame *phone_read(struct ast_channel *ast);
- static int phone_write(struct ast_channel *ast, struct ast_frame *frame);
- static struct ast_frame *phone_exception(struct ast_channel *ast);
--static int phone_send_text(struct ast_channel *ast, const char *text);
-+static int phone_send_text(struct ast_channel *ast, const char *dest, const char *text, int ispdu);
- static int phone_fixup(struct ast_channel *old, struct ast_channel *new);
- static int phone_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen);
-
-@@ -643,7 +643,7 @@ static int phone_write_buf(struct phone_
- return len;
- }
-
--static int phone_send_text(struct ast_channel *ast, const char *text)
-+static int phone_send_text(struct ast_channel *ast, const char *dest, const char *text, int ispdu)
- {
- int length = strlen(text);
- return phone_write_buf(ast->tech_pvt, text, length, length, 0) ==
---- a/channels/chan_sip.c
-+++ b/channels/chan_sip.c
-@@ -1219,7 +1219,7 @@ static struct ast_config *notify_types;
- /*--- PBX interface functions */
- static struct ast_channel *sip_request_call(const char *type, int format, void *data, int *cause);
- static int sip_devicestate(void *data);
--static int sip_sendtext(struct ast_channel *ast, const char *text);
-+static int sip_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu);
- static int sip_call(struct ast_channel *ast, char *dest, int timeout);
- static int sip_hangup(struct ast_channel *ast);
- static int sip_answer(struct ast_channel *ast);
-@@ -2371,7 +2371,7 @@ static char *get_in_brackets(char *tmp)
-
- /*! \brief Send SIP MESSAGE text within a call
- Called from PBX core sendtext() application */
--static int sip_sendtext(struct ast_channel *ast, const char *text)
-+static int sip_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu)
- {
- struct sip_pvt *p = ast->tech_pvt;
- int debug = sip_debug_test_pvt(p);
---- a/channels/chan_iax2.c
-+++ b/channels/chan_iax2.c
-@@ -846,7 +846,7 @@ static int iax2_provision(struct sockadd
- static int iax2_send(struct chan_iax2_pvt *pvt, struct ast_frame *f, unsigned int ts, int seqno, int now, int transfer, int final);
- static int iax2_sendhtml(struct ast_channel *c, int subclass, const char *data, int datalen);
- static int iax2_sendimage(struct ast_channel *c, struct ast_frame *img);
--static int iax2_sendtext(struct ast_channel *c, const char *text);
-+static int iax2_sendtext(struct ast_channel *c, const char *dest, const char *text, int ispdu);
- static int iax2_setoption(struct ast_channel *c, int option, void *data, int datalen);
- static int iax2_transfer(struct ast_channel *c, const char *dest);
- static int iax2_write(struct ast_channel *c, struct ast_frame *f);
-@@ -2728,7 +2728,7 @@ static int iax2_digit_end(struct ast_cha
- return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_DTMF_END, digit, 0, NULL, 0, -1);
- }
-
--static int iax2_sendtext(struct ast_channel *c, const char *text)
-+static int iax2_sendtext(struct ast_channel *c, const char *dest, const char *text, int ispdu)
- {
-
- return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_TEXT,
Modified: asterisk/trunk/debian/patches/bristuff/ast-send-message-users
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff/ast-send-message-users?rev=5762&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/bristuff/ast-send-message-users (original)
+++ asterisk/trunk/debian/patches/bristuff/ast-send-message-users Wed May 21 11:07:18 2008
@@ -14,7 +14,7 @@
return 0;
}
-+static char mandescr_message[] =
++static char mandescr_message[] =
+"Description: Send a message\n"
+"Variables: \n"
+" Channel: The destination channel(e.g. SIP/phone1)\n"
@@ -48,7 +48,7 @@
+ } else {
+ res = ast_send_message(tech, (char *)data, (char *)name, (char *)from, (char *)pdu, 1);
+ }
-+
++
+ if (res) {
+ astman_send_error(s, m, "Error sending message");
+ return 0;
Modified: asterisk/trunk/debian/patches/bristuff/uniqueid-30-app-chanspy
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff/uniqueid-30-app-chanspy?rev=5762&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/bristuff/uniqueid-30-app-chanspy (original)
+++ asterisk/trunk/debian/patches/bristuff/uniqueid-30-app-chanspy Wed May 21 11:07:18 2008
@@ -36,17 +36,16 @@
static const char *app_ext = "ExtenSpy";
static const char *desc_ext =
" ExtenSpy(exten[@context][|options]): This application is used to listen to the\n"
-@@ -457,7 +479,8 @@ static struct chanspy_ds *setup_chanspy_
+@@ -457,7 +479,7 @@ static struct chanspy_ds *setup_chanspy_
static struct chanspy_ds *next_channel(struct ast_channel *chan,
const struct ast_channel *last, const char *spec,
- const char *exten, const char *context, struct chanspy_ds *chanspy_ds)
-+ const char *exten, const char *context, struct chanspy_ds *chanspy_ds,
-+ const char *uniqueid)
++ const char *exten, const char *context, struct chanspy_ds *chanspy_ds, const char *uniqueid)
{
struct ast_channel *this;
-@@ -466,6 +489,8 @@ redo:
+@@ -466,6 +488,8 @@ redo:
this = ast_walk_channel_by_name_prefix_locked(last, spec, strlen(spec));
else if (exten)
this = ast_walk_channel_by_exten_locked(last, exten, context);
@@ -55,7 +54,7 @@
else
this = ast_channel_walk_locked(last);
-@@ -486,7 +511,7 @@ redo:
+@@ -486,7 +510,7 @@ redo:
static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
int volfactor, const int fd, const char *mygroup, const char *spec,
@@ -64,7 +63,7 @@
{
char nameprefix[AST_NAME_STRLEN];
char peer_name[AST_NAME_STRLEN + 5];
-@@ -531,11 +556,11 @@ static int common_exec(struct ast_channe
+@@ -531,11 +555,11 @@ static int common_exec(struct ast_channe
waitms = 100;
num_spyed_upon = 0;
@@ -78,7 +77,7 @@
const char *group;
int igrp = !mygroup;
char *groups[25];
-@@ -737,7 +762,7 @@ static int chanspy_exec(struct ast_chann
+@@ -737,7 +761,7 @@ static int chanspy_exec(struct ast_chann
}
}
@@ -87,7 +86,7 @@
if (fd)
close(fd);
-@@ -822,7 +847,92 @@ static int extenspy_exec(struct ast_chan
+@@ -822,7 +846,92 @@ static int extenspy_exec(struct ast_chan
}
}
@@ -181,7 +180,7 @@
if (fd)
close(fd);
-@@ -835,14 +945,15 @@ static int extenspy_exec(struct ast_chan
+@@ -835,14 +944,15 @@ static int extenspy_exec(struct ast_chan
return res;
}
@@ -198,7 +197,7 @@
return res;
}
-@@ -853,6 +964,7 @@ static int load_module(void)
+@@ -853,6 +963,7 @@ static int load_module(void)
res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan);
res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext);
Modified: asterisk/trunk/debian/patches/bristuff/xagi
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff/xagi?rev=5762&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/bristuff/xagi (original)
+++ asterisk/trunk/debian/patches/bristuff/xagi Wed May 21 11:07:18 2008
@@ -1,11 +1,9 @@
--- a/include/asterisk/agi.h
+++ b/include/asterisk/agi.h
-@@ -29,7 +29,8 @@ extern "C" {
-
+@@ -30,6 +30,7 @@ extern "C" {
typedef struct agi_state {
int fd; /* FD for general output */
-- int audio; /* FD for audio output */
-+ int audio_out; /* FD for audio output */
+ int audio; /* FD for audio output */
+ int audio_in; /* FD for audio output */
int ctrl; /* FD for input control */
unsigned int fast:1; /* flag for fast agi or not */
@@ -153,87 +151,6 @@
/* User information */
fdprintf(fd, "agi_accountcode: %s\n", chan->accountcode ? chan->accountcode : "");
-@@ -421,7 +469,7 @@ static int handle_waitfordigit(struct as
- return RESULT_SHOWUSAGE;
- if (sscanf(argv[3], "%d", &to) != 1)
- return RESULT_SHOWUSAGE;
-- res = ast_waitfordigit_full(chan, to, agi->audio, agi->ctrl);
-+ res = ast_waitfordigit_full(chan, to, agi->audio_out, agi->ctrl);
- fdprintf(agi->fd, "200 result=%d\n", res);
- return (res >= 0) ? RESULT_SUCCESS : RESULT_FAILURE;
- }
-@@ -596,7 +644,7 @@ static int handle_streamfile(struct ast_
- if (vfs)
- ast_playstream(vfs);
-
-- res = ast_waitstream_full(chan, argv[3], agi->audio, agi->ctrl);
-+ res = ast_waitstream_full(chan, argv[3], agi->audio_out, agi->ctrl);
- /* this is to check for if ast_waitstream closed the stream, we probably are at
- * the end of the stream, return that amount, else check for the amount */
- sample_offset = (chan->stream) ? ast_tellstream(fs) : max_length;
-@@ -657,7 +705,7 @@ static int handle_getoption(struct ast_c
- if (vfs)
- ast_playstream(vfs);
-
-- res = ast_waitstream_full(chan, argv[3], agi->audio, agi->ctrl);
-+ res = ast_waitstream_full(chan, argv[3], agi->audio_out, agi->ctrl);
- /* this is to check for if ast_waitstream closed the stream, we probably are at
- * the end of the stream, return that amount, else check for the amount */
- sample_offset = (chan->stream)?ast_tellstream(fs):max_length;
-@@ -669,7 +717,7 @@ static int handle_getoption(struct ast_c
-
- /* If the user didnt press a key, wait for digitTimeout*/
- if (res == 0 ) {
-- res = ast_waitfordigit_full(chan, timeout, agi->audio, agi->ctrl);
-+ res = ast_waitfordigit_full(chan, timeout, agi->audio_out, agi->ctrl);
- /* Make sure the new result is in the escape digits of the GET OPTION */
- if ( !strchr(edigits,res) )
- res=0;
-@@ -693,7 +741,7 @@ static int handle_saynumber(struct ast_c
- return RESULT_SHOWUSAGE;
- if (sscanf(argv[2], "%d", &num) != 1)
- return RESULT_SHOWUSAGE;
-- res = ast_say_number_full(chan, num, argv[3], chan->language, (char *) NULL, agi->audio, agi->ctrl);
-+ res = ast_say_number_full(chan, num, argv[3], chan->language, (char *) NULL, agi->audio_out, agi->ctrl);
- if (res == 1)
- return RESULT_SUCCESS;
- fdprintf(agi->fd, "200 result=%d\n", res);
-@@ -710,7 +758,7 @@ static int handle_saydigits(struct ast_c
- if (sscanf(argv[2], "%d", &num) != 1)
- return RESULT_SHOWUSAGE;
-
-- res = ast_say_digit_str_full(chan, argv[2], argv[3], chan->language, agi->audio, agi->ctrl);
-+ res = ast_say_digit_str_full(chan, argv[2], argv[3], chan->language, agi->audio_out, agi->ctrl);
- if (res == 1) /* New command */
- return RESULT_SUCCESS;
- fdprintf(agi->fd, "200 result=%d\n", res);
-@@ -724,7 +772,7 @@ static int handle_sayalpha(struct ast_ch
- if (argc != 4)
- return RESULT_SHOWUSAGE;
-
-- res = ast_say_character_str_full(chan, argv[2], argv[3], chan->language, agi->audio, agi->ctrl);
-+ res = ast_say_character_str_full(chan, argv[2], argv[3], chan->language, agi->audio_out, agi->ctrl);
- if (res == 1) /* New command */
- return RESULT_SUCCESS;
- fdprintf(agi->fd, "200 result=%d\n", res);
-@@ -802,7 +850,7 @@ static int handle_sayphonetic(struct ast
- if (argc != 4)
- return RESULT_SHOWUSAGE;
-
-- res = ast_say_phonetic_str_full(chan, argv[2], argv[3], chan->language, agi->audio, agi->ctrl);
-+ res = ast_say_phonetic_str_full(chan, argv[2], argv[3], chan->language, agi->audio_out, agi->ctrl);
- if (res == 1) /* New command */
- return RESULT_SUCCESS;
- fdprintf(agi->fd, "200 result=%d\n", res);
-@@ -826,7 +874,7 @@ static int handle_getdata(struct ast_cha
- max = atoi(argv[4]);
- else
- max = 1024;
-- res = ast_app_getdata_full(chan, argv[2], data, max, timeout, agi->audio, agi->ctrl);
-+ res = ast_app_getdata_full(chan, argv[2], data, max, timeout, agi->audio_out, agi->ctrl);
- if (res == 2) /* New command */
- return RESULT_SUCCESS;
- else if (res == 1)
@@ -1833,8 +1881,13 @@ static enum agi_result run_agi(struct as
int ms;
enum agi_result returnstatus = AGI_RESULT_SUCCESS;
@@ -253,7 +170,7 @@
}
setlinebuf(readf);
- setup_env(chan, request, agi->fd, (agi->audio > -1));
-+ if (agi->audio_out > -1) {
++ if (agi->audio > -1) {
+ enhanced = 1;
+ }
+ if (agi->audio_in > -1) {
@@ -273,16 +190,7 @@
if (c) {
retry = AGI_NANDFS_RETRY;
/* Idle the channel until we get a command */
-@@ -1862,13 +1927,23 @@ static enum agi_result run_agi(struct as
- break;
- } else {
- /* If it's voice, write it to the audio pipe */
-- if ((agi->audio > -1) && (f->frametype == AST_FRAME_VOICE)) {
-+ if ((agi->audio_out > -1) && (f->frametype == AST_FRAME_VOICE)) {
- /* Write, ignoring errors */
-- write(agi->audio, f->data, f->datalen);
-+ write(agi->audio_out, f->data, f->datalen);
- }
+@@ -1869,6 +1934,16 @@ static enum agi_result run_agi(struct as
ast_frfree(f);
}
} else if (outfd > -1) {
@@ -325,8 +233,7 @@
int status = 0;
agi.fd = fds[1];
agi.ctrl = fds[0];
-- agi.audio = efd;
-+ agi.audio_out = efd;
+ agi.audio = efd;
+ agi.audio_in = efd2;
agi.fast = (res == AGI_RESULT_SUCCESS_FAST) ? 1 : 0;
res = run_agi(chan, argv[0], &agi, pid, &status, dead);
More information about the Pkg-voip-commits
mailing list