aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-03 17:01:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-03 17:01:07 +0000
commit3c9926564876068a02dc155b6f06e225cd88fe70 (patch)
tree39355d5760d4e9501d5c4a3ccd852cf6ffbc3ce2 /channels/chan_iax2.c
parent52c47ccd84918a2435e402b3de187f268d0cea49 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@78063 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-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 d44fb0420..14f44cebc 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -3277,23 +3277,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;