aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authormvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-24 22:16:48 +0000
committermvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-24 22:16:48 +0000
commit94979a8bde5da5087e67261a4ff435aaff6188e4 (patch)
tree2c247ba7f500b9bdc0fa9867d833b6af194d7139 /channels/chan_iax2.c
parente8d5948d534e44d389e8ceab04c6e1b007b8fd6d (diff)
Pass the hangup cause all the way to the calling app/channel.
(closes issue #11328) Reported by: rain Patches: 20071207__pass_cause_in_hangup_control_frame.diff.txt uploaded by Corydon76 (license 14) brought up-to-date to trunk by me git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114637 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index ab13d2611..2d5320537 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1662,7 +1662,7 @@ static int iax2_queue_hangup(int callno)
usleep(1);
ast_mutex_lock(&iaxsl[callno]);
} else {
- ast_queue_hangup(iaxs[callno]->owner);
+ ast_queue_hangup(iaxs[callno]->owner, -1);
ast_channel_unlock(iaxs[callno]->owner);
break;
}
@@ -2146,7 +2146,7 @@ retry:
/* If there's an owner, prod it to give up */
/* It is ok to use ast_queue_hangup() here instead of iax2_queue_hangup()
* because we already hold the owner channel lock. */
- ast_queue_hangup(owner);
+ ast_queue_hangup(owner, -1);
}
AST_LIST_LOCK(&frame_queue);
@@ -2220,10 +2220,8 @@ static void __attempt_transmit(const void *data)
ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %d, subclass = %d, ts=%d, seqno=%d)\n", ast_inet_ntoa(iaxs[f->callno]->addr.sin_addr),iaxs[f->callno]->owner->name , f->af.frametype, f->af.subclass, f->ts, f->oseqno);
iaxs[callno]->error = ETIMEDOUT;
if (iaxs[callno]->owner) {
- struct ast_frame fr = { 0, };
+ struct ast_frame fr = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP, .seqno = AST_CAUSE_DESTINATION_OUT_OF_ORDER };
/* Hangup the fd */
- fr.frametype = AST_FRAME_CONTROL;
- fr.subclass = AST_CONTROL_HANGUP;
iax2_queue_frame(callno, &fr); /* XXX */
/* Remember, owner could disappear */
if (iaxs[callno] && iaxs[callno]->owner)