aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authormvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-22 16:29:54 +0000
committermvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-22 16:29:54 +0000
commitc1210321e7aeb274076b14fc2f622edf442246fa (patch)
treebcbbf4eda53cdb8257bbc7add4616e01e31b1ae2 /channels/chan_zap.c
parent2d9ba021dd38039616c82a4e317f652abe246ba3 (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: http://svn.digium.com/svn/asterisk/trunk@117802 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index a7c62f5ef..a5ce2b32a 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -4306,7 +4306,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
p->subs[index].f.mallocd = 0;
p->subs[index].f.offset = 0;
p->subs[index].f.src = "zt_handle_event";
- p->subs[index].f.data = NULL;
+ p->subs[index].f.data.ptr = NULL;
f = &p->subs[index].f;
if (index < 0)
@@ -4523,7 +4523,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
/* It hasn't been long enough since the last flashook. This is probably a bounce on
hanging up. Hangup both channels now */
if (p->subs[SUB_THREEWAY].owner)
- ast_queue_hangup(p->subs[SUB_THREEWAY].owner, AST_CAUSE_NO_ANSWER);
+ ast_queue_hangup_with_cause(p->subs[SUB_THREEWAY].owner, AST_CAUSE_NO_ANSWER);
p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
ast_debug(1, "Looks like a bounced flash, hanging up both calls on %d\n", p->channel);
ast_channel_unlock(p->subs[SUB_THREEWAY].owner);
@@ -5123,7 +5123,7 @@ static struct ast_frame *__zt_exception(struct ast_channel *ast)
p->subs[index].f.subclass = 0;
p->subs[index].f.delivery = ast_tv(0,0);
p->subs[index].f.src = "zt_exception";
- p->subs[index].f.data = NULL;
+ p->subs[index].f.data.ptr = NULL;
if ((!p->owner) && (!(p->radio || (p->oprmode < 0)))) {
@@ -5250,7 +5250,7 @@ static struct ast_frame *zt_read(struct ast_channel *ast)
p->subs[index].f.subclass = 0;
p->subs[index].f.delivery = ast_tv(0,0);
p->subs[index].f.src = "zt_read";
- p->subs[index].f.data = NULL;
+ p->subs[index].f.data.ptr = NULL;
/* make sure it sends initial key state as first frame */
if ((p->radio || (p->oprmode < 0)) && (!p->firstradio))
@@ -5416,9 +5416,9 @@ static struct ast_frame *zt_read(struct ast_channel *ast)
p->subs[index].f.frametype = AST_FRAME_TEXT;
p->subs[index].f.mallocd = 0;
p->subs[index].f.offset = AST_FRIENDLY_OFFSET;
- p->subs[index].f.data = p->subs[index].buffer + AST_FRIENDLY_OFFSET;
+ p->subs[index].f.data.ptr = p->subs[index].buffer + AST_FRIENDLY_OFFSET;
p->subs[index].f.datalen = 1;
- *((char *) p->subs[index].f.data) = c;
+ *((char *) p->subs[index].f.data.ptr) = c;
ast_mutex_unlock(&p->lock);
return &p->subs[index].f;
}
@@ -5452,7 +5452,7 @@ static struct ast_frame *zt_read(struct ast_channel *ast)
p->subs[index].f.samples = READ_SIZE;
p->subs[index].f.mallocd = 0;
p->subs[index].f.offset = AST_FRIENDLY_OFFSET;
- p->subs[index].f.data = p->subs[index].buffer + AST_FRIENDLY_OFFSET / sizeof(p->subs[index].buffer[0]);
+ p->subs[index].f.data.ptr = p->subs[index].buffer + AST_FRIENDLY_OFFSET / sizeof(p->subs[index].buffer[0]);
#if 0
ast_debug(1, "Read %d of voice on %s\n", p->subs[index].f.datalen, ast->name);
#endif
@@ -5467,7 +5467,7 @@ static struct ast_frame *zt_read(struct ast_channel *ast)
p->subs[index].f.samples = 0;
p->subs[index].f.mallocd = 0;
p->subs[index].f.offset = 0;
- p->subs[index].f.data = NULL;
+ p->subs[index].f.data.ptr = NULL;
p->subs[index].f.datalen= 0;
}
if (p->dsp && (!p->ignoredtmf || p->callwaitcas || p->busydetect || p->callprogress) && !index) {
@@ -5592,7 +5592,7 @@ static int zt_write(struct ast_channel *ast, struct ast_frame *frame)
return 0;
}
/* Return if it's not valid data */
- if (!frame->data || !frame->datalen)
+ if (!frame->data.ptr || !frame->datalen)
return 0;
if (frame->subclass == AST_FORMAT_SLINEAR) {
@@ -5602,7 +5602,7 @@ static int zt_write(struct ast_channel *ast, struct ast_frame *frame)
if (res)
ast_log(LOG_WARNING, "Unable to set linear mode on channel %d\n", p->channel);
}
- res = my_zt_write(p, (unsigned char *)frame->data, frame->datalen, index, 1);
+ res = my_zt_write(p, (unsigned char *)frame->data.ptr, frame->datalen, index, 1);
} else {
/* x-law already */
if (p->subs[index].linear) {
@@ -5611,7 +5611,7 @@ static int zt_write(struct ast_channel *ast, struct ast_frame *frame)
if (res)
ast_log(LOG_WARNING, "Unable to set companded mode on channel %d\n", p->channel);
}
- res = my_zt_write(p, (unsigned char *)frame->data, frame->datalen, index, 0);
+ res = my_zt_write(p, (unsigned char *)frame->data.ptr, frame->datalen, index, 0);
}
if (res < 0) {
ast_log(LOG_WARNING, "write failed: %s\n", strerror(errno));
@@ -10133,7 +10133,7 @@ static int pri_hangup_all(struct zt_pvt *p, struct zt_pri *pri)
ast_mutex_lock(&p->lock);
}
if (p->subs[x].owner) {
- ast_queue_hangup(p->subs[x].owner, AST_CAUSE_PRE_EMPTED);
+ ast_queue_hangup_with_cause(p->subs[x].owner, AST_CAUSE_PRE_EMPTED);
ast_channel_unlock(p->subs[x].owner);
}
}