aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-21 03:33:57 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-21 03:33:57 +0000
commitc434fd1965e3669c66ba18c5a89238fb7a2f29e4 (patch)
tree8e243f5fa928bd1c142d90941fabe6ff14f1e915 /channels
parent9f7efa1bc5f6780abaefca54561aafb013315133 (diff)
Minor tweak. Only queue up an unhold control frame if we are actually on hold. This would have shown itself when a call was initially being setup and the SDP data was being parsed in.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@59083 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c43
1 files changed, 18 insertions, 25 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 758d28248..07e509954 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5644,11 +5644,22 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
ast_set_write_format(p->owner, p->owner->writeformat);
}
- if (sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
+ if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
/* Activate a re-invite */
ast_queue_frame(p->owner, &ast_null_frame);
- } else if (!sin.sin_addr.s_addr || sendonly) {
+ /* Queue Manager Unhold event */
+ append_history(p, "Unhold", "%s", req->data);
+ if (global_callevents)
+ manager_event(EVENT_FLAG_CALL, "Unhold",
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n",
+ p->owner->name,
+ p->owner->uniqueid);
+ if (global_notifyhold)
+ sip_peer_hold(p, FALSE);
+ ast_clear_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD); /* Clear both flags */
+ } else if (!sin.sin_addr.s_addr || (sendonly && sendonly != -1)) {
ast_queue_control_data(p->owner, AST_CONTROL_HOLD,
S_OR(p->mohsuggest, NULL),
!ast_strlen_zero(p->mohsuggest) ? strlen(p->mohsuggest) + 1 : 0);
@@ -5657,32 +5668,14 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
/* RTCP needs to go ahead, even if we're on hold!!! */
/* Activate a re-invite */
ast_queue_frame(p->owner, &ast_null_frame);
- }
-
- /* Manager Hold and Unhold events must be generated, if necessary */
- if (sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD)) {
- append_history(p, "Unhold", "%s", req->data);
- if (global_callevents)
- manager_event(EVENT_FLAG_CALL, "Unhold",
- "Channel: %s\r\n"
- "Uniqueid: %s\r\n",
- p->owner->name,
- p->owner->uniqueid);
- if (global_notifyhold)
- sip_peer_hold(p, FALSE);
- }
- ast_clear_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD); /* Clear both flags */
- } else if (!sin.sin_addr.s_addr || sendonly ) {
- /* No address for RTP, we're on hold */
+ /* Queue Manager Hold event */
append_history(p, "Hold", "%s", req->data);
-
if (global_callevents && !ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD)) {
manager_event(EVENT_FLAG_CALL, "Hold",
- "Channel: %s\r\n"
- "Uniqueid: %s\r\n",
- p->owner->name,
- p->owner->uniqueid);
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n",
+ p->owner->name,
+ p->owner->uniqueid);
}
if (sendonly == 1) /* One directional hold (sendonly/recvonly) */
ast_set_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_ONEDIR);