--- app_dial.c 2004-08-27 05:16:16.000000000 +0200 +++ app_dial.c.patch_CVS_Tonec_Setember9 2004-09-09 13:08:56.000000000 +0200 @@ -73,6 +73,7 @@ " 'P[(x)]' -- privacy mode, using 'x' as database if provided.\n" " 'g' -- goes on in context if the destination channel hangs up\n" " 'A(x)' -- play an announcement to the called party, using x as file\n" +" 'B(x)' -- play an announcement to the caller party, using x as file\n" " 'S(x)' -- hangup the call after x seconds AFTER called party picked up\n" " 'D([digits])' -- Send DTMF digit string *after* called party has answered\n" " but before the bridge. (w=500ms sec pause)\n" @@ -413,6 +414,7 @@ char info[256], *peers, *timeout, *tech, *number, *rest, *cur; char privdb[256] = "", *s; char announcemsg[256] = "", *ann; + char announcemsgB[256] = "", *annB; struct localuser *outgoing=NULL, *tmp; struct ast_channel *peer; int to; @@ -422,6 +424,7 @@ int allowdisconnect_out=0; int privacy=0; int announce=0; + int announceB=0; int resetcdr=0; char numsubst[AST_MAX_EXTENSION]; char restofit[AST_MAX_EXTENSION]; @@ -610,6 +613,24 @@ announce = 0; } } + /* XXX ANNOUNCE SUPPORT TO CALLER */ + if ((annB = strstr(transfer, "B("))) { + announceB = 1; + strncpy(announcemsgB, annB + 2, sizeof(announcemsgB) - 1); + /* Overwrite with X's what was the announce info */ + while(*annB && (*annB != ')')) + *(annB++) = 'X'; + if (*annB) + *annB = 'X'; + /* Now find the end of the privdb */ + annB = strchr(announcemsgB, ')'); + if (annB) + *annB = '\0'; + else { + ast_log(LOG_WARNING, "Transfer with Announce spec lacking trailing ')'\n"); + announceB = 0; + } + } /* Extract privacy info from transfer */ if ((s = strstr(transfer, "P("))) { privacy = 1; @@ -906,6 +927,24 @@ } else res = 0; + + if (announceB && announcemsgB) { + // Start autoservice on the other chan + res = ast_autoservice_start(peer); + // Now Stream the File + if (!res) + res = ast_streamfile(chan,announcemsgB,peer->language); + if (!res) { + digit = ast_waitstream(chan, AST_DIGIT_ANY); + } + // Ok, done. stop autoservice + res = ast_autoservice_stop(peer); + if (digit > 0 && !res) + res = ast_senddigit(peer, digit); + else + res = digit; + } else + res = 0; if (!res) { if (calldurationlimit > 0) {