[svn-commits] rmudgett: branch rmudgett/display_text r305738 - /team/rmudgett/display_text/...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Feb 1 21:42:49 CST 2011
Author: rmudgett
Date: Tue Feb 1 21:42:45 2011
New Revision: 305738
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=305738
Log:
Forward text and image frames from incoming to outgoing channel during a dial.
* Restructured some code in wait_for_answer() to make it easier to follow
and add more types.
* Blocked AST_CONTROL_REDIRECTING if the dial/queue forked the call.
Modified:
team/rmudgett/display_text/apps/app_dial.c
team/rmudgett/display_text/apps/app_queue.c
Modified: team/rmudgett/display_text/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/display_text/apps/app_dial.c?view=diff&rev=305738&r1=305737&r2=305738
==============================================================================
--- team/rmudgett/display_text/apps/app_dial.c (original)
+++ team/rmudgett/display_text/apps/app_dial.c Tue Feb 1 21:42:45 2011
@@ -1276,7 +1276,7 @@
case AST_CONTROL_REDIRECTING:
if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
ast_verb(3, "Redirecting update to %s prevented.\n", in->name);
- } else {
+ } else if (single) {
ast_verb(3, "%s redirecting info has changed, passing it to %s\n", c->name, in->name);
if (ast_channel_redirecting_macro(c, in, f, 1, 1)) {
ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
@@ -1321,20 +1321,22 @@
}
} else if (single) {
switch (f->frametype) {
- case AST_FRAME_VOICE:
- case AST_FRAME_IMAGE:
- case AST_FRAME_TEXT:
- if (ast_write(in, f)) {
- ast_log(LOG_WARNING, "Unable to write frame\n");
- }
- break;
- case AST_FRAME_HTML:
- if (!ast_test_flag64(outgoing, DIAL_NOFORWARDHTML) && ast_channel_sendhtml(in, f->subclass.integer, f->data.ptr, f->datalen) == -1) {
- ast_log(LOG_WARNING, "Unable to send URL\n");
- }
- break;
- default:
- break;
+ case AST_FRAME_VOICE:
+ case AST_FRAME_IMAGE:
+ case AST_FRAME_TEXT:
+ if (ast_write(in, f)) {
+ ast_log(LOG_WARNING, "Unable to write frametype: %d\n",
+ f->frametype);
+ }
+ break;
+ case AST_FRAME_HTML:
+ if (!ast_test_flag64(outgoing, DIAL_NOFORWARDHTML)
+ && ast_channel_sendhtml(in, f->subclass.integer, f->data.ptr, f->datalen) == -1) {
+ ast_log(LOG_WARNING, "Unable to send URL\n");
+ }
+ break;
+ default:
+ break;
}
}
ast_frfree(f);
@@ -1400,30 +1402,50 @@
}
}
- /* Forward HTML stuff */
- if (single && (f->frametype == AST_FRAME_HTML) && !ast_test_flag64(outgoing, DIAL_NOFORWARDHTML))
- if (ast_channel_sendhtml(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen) == -1)
- ast_log(LOG_WARNING, "Unable to send URL\n");
-
- if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF_BEGIN) || (f->frametype == AST_FRAME_DTMF_END))) {
- if (ast_write(outgoing->chan, f))
- ast_log(LOG_WARNING, "Unable to forward voice or dtmf\n");
- }
- if (single && (f->frametype == AST_FRAME_CONTROL)) {
- if ((f->subclass.integer == AST_CONTROL_HOLD) ||
- (f->subclass.integer == AST_CONTROL_UNHOLD) ||
- (f->subclass.integer == AST_CONTROL_VIDUPDATE) ||
- (f->subclass.integer == AST_CONTROL_SRCUPDATE)) {
- ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass.integer, outgoing->chan->name);
- ast_indicate_data(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen);
- } else if (f->subclass.integer == AST_CONTROL_CONNECTED_LINE) {
- if (ast_channel_connected_line_macro(in, outgoing->chan, f, 0, 1)) {
+ if (single) {
+ switch (f->frametype) {
+ case AST_FRAME_HTML:
+ /* Forward HTML stuff */
+ if (!ast_test_flag64(outgoing, DIAL_NOFORWARDHTML)
+ && ast_channel_sendhtml(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen) == -1) {
+ ast_log(LOG_WARNING, "Unable to send URL\n");
+ }
+ break;
+ case AST_FRAME_VOICE:
+ case AST_FRAME_IMAGE:
+ case AST_FRAME_TEXT:
+ case AST_FRAME_DTMF_BEGIN:
+ case AST_FRAME_DTMF_END:
+ if (ast_write(outgoing->chan, f)) {
+ ast_log(LOG_WARNING, "Unable to forward frametype: %d\n",
+ f->frametype);
+ }
+ break;
+ case AST_FRAME_CONTROL:
+ switch (f->subclass.integer) {
+ case AST_CONTROL_HOLD:
+ case AST_CONTROL_UNHOLD:
+ case AST_CONTROL_VIDUPDATE:
+ case AST_CONTROL_SRCUPDATE:
+ ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass.integer, outgoing->chan->name);
ast_indicate_data(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen);
+ break;
+ case AST_CONTROL_CONNECTED_LINE:
+ if (ast_channel_connected_line_macro(in, outgoing->chan, f, 0, 1)) {
+ ast_indicate_data(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen);
+ }
+ break;
+ case AST_CONTROL_REDIRECTING:
+ if (ast_channel_redirecting_macro(in, outgoing->chan, f, 0, 1)) {
+ ast_indicate_data(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen);
+ }
+ break;
+ default:
+ break;
}
- } else if (f->subclass.integer == AST_CONTROL_REDIRECTING) {
- if (ast_channel_redirecting_macro(in, outgoing->chan, f, 0, 1)) {
- ast_indicate_data(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen);
- }
+ break;
+ default:
+ break;
}
}
ast_frfree(f);
Modified: team/rmudgett/display_text/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/display_text/apps/app_queue.c?view=diff&rev=305738&r1=305737&r2=305738
==============================================================================
--- team/rmudgett/display_text/apps/app_queue.c (original)
+++ team/rmudgett/display_text/apps/app_queue.c Tue Feb 1 21:42:45 2011
@@ -3754,7 +3754,7 @@
case AST_CONTROL_REDIRECTING:
if (!update_connectedline) {
ast_verb(3, "Redirecting update to %s prevented\n", inchan_name);
- } else {
+ } else if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
ast_verb(3, "%s redirecting info has changed, passing it to %s\n", ochan_name, inchan_name);
if (ast_channel_redirecting_macro(o->chan, in, f, 1, 1)) {
ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
More information about the svn-commits
mailing list