summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-05-31 15:34:20 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-05-31 15:34:20 +0000
commitccc8cc5346f7f68f38b1749755777a33cd897f07 (patch)
tree994ae78a31cd77542073af477e3111795a3740b9 /main/channel.c
parenta1494300c935864074b000dc33590010c70e749b (diff)
Fixup hold/unhold with attended and blind transfers.
* DTMF attended and blind transfers have hold/unhold behavior restored. * External attended and blind transfers unhold the transfered party when the transfer is initiated. * Made prohibit blind transferring a bridge marked as masquerade only. (ConfBridge bridges) * Made running an application or playing a file inside a bridge post the hold/unhold messages if MOH is requested. Review: https://reviewboard.asterisk.org/r/2574/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/main/channel.c b/main/channel.c
index 6549131bf..190271321 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1348,21 +1348,6 @@ int ast_queue_frame_head(struct ast_channel *chan, struct ast_frame *fin)
return __ast_queue_frame(chan, fin, 1, NULL);
}
-/*! \internal \brief Publish a channel blob message */
-static void publish_channel_blob(struct ast_channel *chan,
- struct stasis_message_type *type, struct ast_json *blob)
-{
- RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
- if (!blob) {
- blob = ast_json_null();
- }
-
- message = ast_channel_blob_create(chan, type, blob);
- if (message) {
- stasis_publish(ast_channel_topic(chan), message);
- }
-}
-
/*! \brief Queue a hangup frame for channel */
int ast_queue_hangup(struct ast_channel *chan)
{
@@ -1372,7 +1357,7 @@ int ast_queue_hangup(struct ast_channel *chan)
/* Yeah, let's not change a lock-critical value without locking */
ast_channel_lock(chan);
ast_channel_softhangup_internal_flag_add(chan, AST_SOFTHANGUP_DEV);
- publish_channel_blob(chan, ast_channel_hangup_request_type(), NULL);
+ ast_channel_publish_blob(chan, ast_channel_hangup_request_type(), NULL);
res = ast_queue_frame(chan, &f);
ast_channel_unlock(chan);
@@ -1398,7 +1383,7 @@ int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
}
blob = ast_json_pack("{s: i}",
"cause", cause);
- publish_channel_blob(chan, ast_channel_hangup_request_type(), blob);
+ ast_channel_publish_blob(chan, ast_channel_hangup_request_type(), blob);
res = ast_queue_frame(chan, &f);
ast_channel_unlock(chan);
@@ -1419,7 +1404,7 @@ int ast_queue_hold(struct ast_channel *chan, const char *musicclass)
"musicclass", musicclass);
}
- publish_channel_blob(chan, ast_channel_hold_type(), blob);
+ ast_channel_publish_blob(chan, ast_channel_hold_type(), blob);
res = ast_queue_frame(chan, &f);
return res;
@@ -1430,7 +1415,7 @@ int ast_queue_unhold(struct ast_channel *chan)
struct ast_frame f = { AST_FRAME_CONTROL, .subclass.integer = AST_CONTROL_UNHOLD };
int res;
- publish_channel_blob(chan, ast_channel_unhold_type(), NULL);
+ ast_channel_publish_blob(chan, ast_channel_unhold_type(), NULL);
res = ast_queue_frame(chan, &f);
return res;
@@ -2741,7 +2726,7 @@ int ast_softhangup(struct ast_channel *chan, int cause)
blob = ast_json_pack("{s: i, s: b}",
"cause", cause,
"soft", 1);
- publish_channel_blob(chan, ast_channel_hangup_request_type(), blob);
+ ast_channel_publish_blob(chan, ast_channel_hangup_request_type(), blob);
ast_channel_unlock(chan);
return res;
@@ -3755,7 +3740,7 @@ static void send_dtmf_begin_event(struct ast_channel *chan,
return;
}
- publish_channel_blob(chan, ast_channel_dtmf_begin_type(), blob);
+ ast_channel_publish_blob(chan, ast_channel_dtmf_begin_type(), blob);
}
static void send_dtmf_end_event(struct ast_channel *chan,
@@ -3772,7 +3757,7 @@ static void send_dtmf_end_event(struct ast_channel *chan,
return;
}
- publish_channel_blob(chan, ast_channel_dtmf_end_type(), blob);
+ ast_channel_publish_blob(chan, ast_channel_dtmf_end_type(), blob);
}
static void ast_read_generator_actions(struct ast_channel *chan, struct ast_frame *f)