diff options
author | Michiel van Baak <michiel@vanbaak.info> | 2008-05-22 16:29:54 +0000 |
---|---|---|
committer | Michiel van Baak <michiel@vanbaak.info> | 2008-05-22 16:29:54 +0000 |
commit | f1e9371da8b502999b9aec1db7f68635395a7b6a (patch) | |
tree | bcbbf4eda53cdb8257bbc7add4616e01e31b1ae2 /channels/chan_sip.c | |
parent | 2c7760e6262c97afc19037890242299421d62157 (diff) |
- revert change to ast_queue_hangup and create ast_queue_hangup_with_cause
- make data member of the ast_frame struct a named union instead of a void
Recently the ast_queue_hangup function got a new parameter, the hangupcause
Feedback came in that this is no good and that instead a new function should be created.
This I did.
The hangupcause was stored in the seqno member of the ast_frame struct. This is not very
elegant, and since there's already a data member that one should be used.
Problem is, this member was a void *.
Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone
wants to store another type in there in the future.
This commit is so massive, because all ast_frame.data uses have to be
altered to ast_frame.data.data
Thanks russellb and kpfleming for the feedback.
(closes issue #12674)
Reported by: mvanbaak
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 8001e2510..82b25c8ae 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2979,7 +2979,7 @@ static int retrans_pkt(const void *data) if (pkt->owner->owner) { sip_alreadygone(pkt->owner); ast_log(LOG_WARNING, "Hanging up call %s - no reply to our critical packet.\n", pkt->owner->callid); - ast_queue_hangup(pkt->owner->owner, AST_CAUSE_PROTOCOL_ERROR); + ast_queue_hangup_with_cause(pkt->owner->owner, AST_CAUSE_PROTOCOL_ERROR); ast_channel_unlock(pkt->owner->owner); } else { /* If no channel owner, destroy now */ @@ -3121,7 +3121,7 @@ static int __sip_autodestruct(const void *data) if (p->owner) { ast_log(LOG_WARNING, "Autodestruct on dialog '%s' with owner in place (Method: %s)\n", p->callid, sip_methods[p->method].text); - ast_queue_hangup(p->owner, AST_CAUSE_PROTOCOL_ERROR); + ast_queue_hangup_with_cause(p->owner, AST_CAUSE_PROTOCOL_ERROR); } else if (p->refer) { ast_debug(3, "Finally hanging up channel after transfer: %s\n", p->callid); transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, 1); @@ -5832,7 +5832,7 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p f = ast_rtp_read(p->trtp); /* RTP Text */ if (sipdebug_text) { int i; - unsigned char* arr = f->data; + unsigned char* arr = f->data.ptr; for (i=0; i < f->datalen; i++) ast_verbose("%c", (arr[i] > ' ' && arr[i] < '}') ? arr[i] : '.'); ast_verbose(" -> "); @@ -12056,7 +12056,7 @@ static void receive_message(struct sip_pvt *p, struct sip_request *req) f.frametype = AST_FRAME_TEXT; f.subclass = 0; f.offset = 0; - f.data = buf; + f.data.ptr = buf; f.datalen = strlen(buf); ast_queue_frame(p->owner, &f); transmit_response(p, "202 Accepted", req); /* We respond 202 accepted, since we relay the message */ @@ -15829,7 +15829,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru */ xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE); if (p->owner && !req->ignore) { - ast_queue_hangup(p->owner, AST_CAUSE_NORMAL_CLEARING); + ast_queue_hangup_with_cause(p->owner, AST_CAUSE_NORMAL_CLEARING); append_history(p, "Hangup", "Got 487 on CANCEL request from us. Queued AST hangup request"); } else if (!req->ignore) { update_call_counter(p, DEC_CALL_LIMIT); @@ -15910,7 +15910,7 @@ static void handle_response_notify(struct sip_pvt *p, int resp, char *rest, stru if (p->owner) { if (!p->refer) { ast_log(LOG_WARNING, "Notify answer on an owned channel? - %s\n", p->owner->name); - ast_queue_hangup(p->owner, AST_CAUSE_NORMAL_UNSPECIFIED); + ast_queue_hangup_with_cause(p->owner, AST_CAUSE_NORMAL_UNSPECIFIED); } else { ast_debug(4, "Got OK on REFER Notify message\n"); } @@ -16470,7 +16470,7 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_ default: /* Send hangup */ if (owner && sipmethod != SIP_MESSAGE && sipmethod != SIP_INFO && sipmethod != SIP_BYE) - ast_queue_hangup(p->owner, AST_CAUSE_PROTOCOL_ERROR); + ast_queue_hangup_with_cause(p->owner, AST_CAUSE_PROTOCOL_ERROR); break; } /* ACK on invite */ @@ -16524,7 +16524,7 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_ ast_debug(1, "Got 200 OK on NOTIFY for transfer\n"); } else ast_log(LOG_WARNING, "Notify answer on an owned channel?\n"); - /* ast_queue_hangup(p->owner, -1); Disabled */ + /* ast_queue_hangup(p->owner); Disabled */ } else { if (!p->subscribed && !p->refer) p->needdestroy = 1; @@ -18374,7 +18374,7 @@ static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req) stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */ if (p->owner) - ast_queue_hangup(p->owner, -1); + ast_queue_hangup(p->owner); else sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); if (p->initreq.len > 0) { @@ -18533,15 +18533,15 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req) ast_queue_control(c, AST_CONTROL_UNHOLD); ast_async_goto(bridged_to, p->context, p->refer->refer_to, 1); } else - ast_queue_hangup(p->owner, -1); + ast_queue_hangup(p->owner); } } else { ast_log(LOG_WARNING, "Invalid transfer information from '%s'\n", ast_inet_ntoa(p->recv.sin_addr)); if (p->owner) - ast_queue_hangup(p->owner, AST_CAUSE_PROTOCOL_ERROR); + ast_queue_hangup_with_cause(p->owner, AST_CAUSE_PROTOCOL_ERROR); } } else if (p->owner) { - ast_queue_hangup(p->owner, -1); + ast_queue_hangup(p->owner); ast_debug(3, "Received bye, issuing owner hangup\n"); } else { sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); |