summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2007-08-03 17:02:00 +0000
committerRussell Bryant <russell@russellbryant.com>2007-08-03 17:02:00 +0000
commit661fa0b3744adcd8091952df48f9c975340e1004 (patch)
tree78e4859f901b68e9c13199228b7be0c7ca84ebda /channels
parentbcabfbb89ade46abd186c74a377ba6fab95d2a47 (diff)
Merged revisions 78063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78063 | russell | 2007-08-03 12:01:07 -0500 (Fri, 03 Aug 2007) | 4 lines Only pass through HOLD and UNHOLD control frames when the mohinterpret option is set to "passthrough". This was pointed out by Kevin in the middle of a training session. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 8b21c79b1..5efeac001 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -3478,23 +3478,24 @@ static int iax2_indicate(struct ast_channel *c, int condition, const void *data,
ast_mutex_lock(&iaxsl[callno]);
pvt = iaxs[callno];
- if (!strcasecmp(pvt->mohinterpret, "passthrough")) {
- res = send_command(pvt, AST_FRAME_CONTROL, condition, 0, data, datalen, -1);
- ast_mutex_unlock(&iaxsl[callno]);
- return res;
- }
switch (condition) {
case AST_CONTROL_HOLD:
- ast_moh_start(c, data, pvt->mohinterpret);
+ if (strcasecmp(pvt->mohinterpret, "passthrough")) {
+ ast_moh_start(c, data, pvt->mohinterpret);
+ goto done;
+ }
break;
case AST_CONTROL_UNHOLD:
- ast_moh_stop(c);
- break;
- default:
- res = send_command(pvt, AST_FRAME_CONTROL, condition, 0, data, datalen, -1);
+ if (strcasecmp(pvt->mohinterpret, "passthrough")) {
+ ast_moh_stop(c);
+ goto done;
+ }
}
+ res = send_command(pvt, AST_FRAME_CONTROL, condition, 0, data, datalen, -1);
+
+done:
ast_mutex_unlock(&iaxsl[callno]);
return res;