[Asterisk-cvs] asterisk/res res_features.c,1.34,1.35
markster at lists.digium.com
markster at lists.digium.com
Mon Jan 17 06:34:36 CST 2005
Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv27355/res
Modified Files:
res_features.c
Log Message:
Merge hold patch (bug #1840)
Index: res_features.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_features.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- res_features.c 11 Jan 2005 18:24:27 -0000 1.34
+++ res_features.c 17 Jan 2005 12:37:55 -0000 1.35
@@ -229,8 +229,10 @@
pu->chan = chan;
/* Start music on hold */
- if (chan != peer)
+ if (chan != peer) {
+ ast_indicate(pu->chan, AST_CONTROL_HOLD);
ast_moh_start(pu->chan, NULL);
+ }
gettimeofday(&pu->start, NULL);
pu->parkingnum = x;
if (timeout > 0)
@@ -478,6 +480,7 @@
}
/* Start autoservice on chan while we talk
to the originator */
+ ast_indicate(transferee, AST_CONTROL_HOLD);
ast_autoservice_start(transferee);
ast_moh_start(transferee, NULL);
@@ -488,11 +491,13 @@
if ((res=ast_streamfile(transferer, "pbx-transfer", transferer->language))) {
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
return res;
}
if ((res=ast_waitstream(transferer, AST_DIGIT_ANY)) < 0) {
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
return res;
}
ast_stopstream(transferer);
@@ -507,12 +512,15 @@
if (res < 0) {
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
return res;
}
if (!strcmp(newext, ast_parking_ext())) {
ast_moh_stop(transferee);
- if (ast_autoservice_stop(transferee))
+ res = ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
+ if (res)
res = -1;
else if (!ast_park_call(transferee, transferer, 0, NULL)) {
/* We return non-zero, but tell the PBX not to hang the channel when
@@ -533,6 +541,7 @@
pbx_builtin_setvar_helper(chan, "BLINDTRANSFER", peer->name);
ast_moh_stop(transferee);
res=ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
if (!transferee->pbx) {
/* Doh! Use our handy async_goto functions */
if (option_verbose > 2)
@@ -559,12 +568,14 @@
if (res) {
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
return res;
}
res = ast_waitstream(transferer, AST_DIGIT_ANY);
ast_stopstream(transferer);
ast_moh_stop(transferee);
res = ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
if (res) {
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Hungup during autoservice stop on '%s'\n", transferee->name);
@@ -606,6 +617,7 @@
}
/* Start autoservice on chan while we talk
to the originator */
+ ast_indicate(transferee, AST_CONTROL_HOLD);
ast_autoservice_start(transferee);
ast_moh_start(transferee, NULL);
@@ -613,11 +625,13 @@
if ((res=ast_streamfile(transferer, "pbx-transfer", transferer->language))) {
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
return res;
}
if ((res=ast_waitstream(transferer, AST_DIGIT_ANY)) < 0) {
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
return res;
}
if ((ast_app_dtget(transferer, transferer_real_context, xferto, sizeof(xferto), 100, transferdigittimeout))) {
@@ -649,6 +663,7 @@
}
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
transferer->_softhangup = 0;
return FEATURE_RETURN_SUCCESS;
}
@@ -722,6 +737,7 @@
ast_log(LOG_WARNING, "Unable to create channel Local/%s do you have chan_local?\n",dialstr);
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
if (!ast_strlen_zero(xferfailsound)) {
res = ast_streamfile(transferer, xferfailsound, transferer->language);
if (!res && (ast_waitstream(transferer, "") < 0)) {
@@ -734,6 +750,7 @@
ast_log(LOG_WARNING, "Extension %s does not exist in context %s\n",xferto,transferer_real_context);
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
res = ast_streamfile(transferer, "beeperr", transferer->language);
if (!res && (ast_waitstream(transferer, "") < 0)) {
return -1;
@@ -748,7 +765,7 @@
}
ast_moh_stop(transferee);
ast_autoservice_stop(transferee);
-
+ ast_indicate(transferee, AST_CONTROL_UNHOLD);
return FEATURE_RETURN_SUCCESS;
}
@@ -1098,6 +1115,7 @@
if (tms > pu->parkingtime) {
/* Stop music on hold */
ast_moh_stop(pu->chan);
+ ast_indicate(pu->chan, AST_CONTROL_UNHOLD);
/* Get chan, exten from derived kludge */
if (pu->peername[0]) {
peername = ast_strdupa(pu->peername);
@@ -1299,6 +1317,7 @@
}
ast_moh_stop(peer);
+ ast_indicate(peer, AST_CONTROL_UNHOLD);
res = ast_channel_make_compatible(chan, peer);
if (res < 0) {
ast_log(LOG_WARNING, "Could not make channels %s and %s compatible for bridge\n", chan->name, peer->name);
More information about the svn-commits
mailing list