[svn-commits] mvanbaak: trunk r117802 - in /trunk: apps/ channels/ codecs/ formats/ include...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu May 22 11:29:57 CDT 2008
Author: mvanbaak
Date: Thu May 22 11:29:54 2008
New Revision: 117802
URL: http://svn.digium.com/view/asterisk?view=rev&rev=117802
Log:
- 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
Modified:
trunk/apps/app_alarmreceiver.c
trunk/apps/app_chanspy.c
trunk/apps/app_dial.c
trunk/apps/app_disa.c
trunk/apps/app_externalivr.c
trunk/apps/app_festival.c
trunk/apps/app_followme.c
trunk/apps/app_ices.c
trunk/apps/app_meetme.c
trunk/apps/app_milliwatt.c
trunk/apps/app_mp3.c
trunk/apps/app_nbscat.c
trunk/apps/app_queue.c
trunk/apps/app_sms.c
trunk/apps/app_speech_utils.c
trunk/apps/app_test.c
trunk/apps/app_zapbarge.c
trunk/apps/app_zapscan.c
trunk/channels/chan_alsa.c
trunk/channels/chan_console.c
trunk/channels/chan_gtalk.c
trunk/channels/chan_h323.c
trunk/channels/chan_iax2.c
trunk/channels/chan_jingle.c
trunk/channels/chan_local.c
trunk/channels/chan_mgcp.c
trunk/channels/chan_misdn.c
trunk/channels/chan_oss.c
trunk/channels/chan_phone.c
trunk/channels/chan_sip.c
trunk/channels/chan_skinny.c
trunk/channels/chan_unistim.c
trunk/channels/chan_zap.c
trunk/channels/iax2-parser.c
trunk/codecs/codec_a_mu.c
trunk/codecs/codec_adpcm.c
trunk/codecs/codec_alaw.c
trunk/codecs/codec_g722.c
trunk/codecs/codec_g726.c
trunk/codecs/codec_gsm.c
trunk/codecs/codec_lpc10.c
trunk/codecs/codec_resample.c
trunk/codecs/codec_ulaw.c
trunk/codecs/codec_zap.c
trunk/formats/format_g723.c
trunk/formats/format_g726.c
trunk/formats/format_g729.c
trunk/formats/format_gsm.c
trunk/formats/format_h263.c
trunk/formats/format_h264.c
trunk/formats/format_ilbc.c
trunk/formats/format_jpeg.c
trunk/formats/format_pcm.c
trunk/formats/format_sln.c
trunk/formats/format_sln16.c
trunk/formats/format_vox.c
trunk/formats/format_wav.c
trunk/formats/format_wav_gsm.c
trunk/include/asterisk/channel.h
trunk/include/asterisk/frame.h
trunk/main/abstract_jb.c
trunk/main/app.c
trunk/main/audiohook.c
trunk/main/channel.c
trunk/main/dsp.c
trunk/main/features.c
trunk/main/file.c
trunk/main/frame.c
trunk/main/indications.c
trunk/main/rtp.c
trunk/main/slinfactory.c
trunk/main/translate.c
trunk/main/udptl.c
trunk/res/res_adsi.c
trunk/res/res_agi.c
trunk/res/res_musiconhold.c
Modified: trunk/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_alarmreceiver.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_alarmreceiver.c (original)
+++ trunk/apps/app_alarmreceiver.c Thu May 22 11:29:54 2008
@@ -185,7 +185,7 @@
wf.subclass = AST_FORMAT_ULAW;
wf.offset = AST_FRIENDLY_OFFSET;
wf.mallocd = 0;
- wf.data = tone_block.buf;
+ wf.data.ptr = tone_block.buf;
wf.datalen = f->datalen;
wf.samples = wf.datalen;
@@ -252,8 +252,8 @@
/* If they hung up, leave */
if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP)) {
- if (f->seqno) {
- chan->hangupcause = f->seqno;
+ if (f->data.uint32) {
+ chan->hangupcause = f->data.uint32;
}
ast_frfree(f);
res = -1;
Modified: trunk/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Thu May 22 11:29:54 2008
@@ -263,7 +263,7 @@
}
if (csth->fd)
- write(csth->fd, f->data, f->datalen);
+ write(csth->fd, f->data.ptr, f->datalen);
ast_frfree(f);
Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Thu May 22 11:29:54 2008
@@ -765,7 +765,7 @@
}
break;
case AST_FRAME_HTML:
- if (!ast_test_flag64(outgoing, DIAL_NOFORWARDHTML) && ast_channel_sendhtml(in, f->subclass, f->data, f->datalen) == -1) {
+ if (!ast_test_flag64(outgoing, DIAL_NOFORWARDHTML) && ast_channel_sendhtml(in, f->subclass, f->data.ptr, f->datalen) == -1) {
ast_log(LOG_WARNING, "Unable to send URL\n");
}
break;
@@ -789,8 +789,9 @@
strcpy(pa->status, "CANCEL");
ast_cdr_noanswer(in->cdr);
if (f) {
- if (f->seqno)
- in->hangupcause = f->seqno;
+ if (f->data.uint32) {
+ in->hangupcause = f->data.uint32;
+ }
ast_frfree(f);
}
return NULL;
@@ -824,7 +825,7 @@
/* Forward HTML stuff */
if (single && (f->frametype == AST_FRAME_HTML) && !ast_test_flag64(outgoing, DIAL_NOFORWARDHTML))
- if (ast_channel_sendhtml(outgoing->chan, f->subclass, f->data, f->datalen) == -1)
+ if (ast_channel_sendhtml(outgoing->chan, f->subclass, f->data.ptr, f->datalen) == -1)
ast_log(LOG_WARNING, "Unable to send URL\n");
if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF_BEGIN) || (f->frametype == AST_FRAME_DTMF_END))) {
@@ -837,7 +838,7 @@
(f->subclass == AST_CONTROL_VIDUPDATE) ||
(f->subclass == AST_CONTROL_SRCUPDATE))) {
ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
- ast_indicate_data(outgoing->chan, f->subclass, f->data, f->datalen);
+ ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen);
}
ast_frfree(f);
}
Modified: trunk/apps/app_disa.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_disa.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_disa.c (original)
+++ trunk/apps/app_disa.c Thu May 22 11:29:54 2008
@@ -195,8 +195,8 @@
}
if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP)) {
- if (f->seqno)
- chan->hangupcause = f->seqno;
+ if (f->data.uint32)
+ chan->hangupcause = f->data.uint32;
ast_frfree(f);
ast_clear_flag(chan, AST_FLAG_END_DTMF_ONLY);
return -1;
Modified: trunk/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_externalivr.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_externalivr.c (original)
+++ trunk/apps/app_externalivr.c Thu May 22 11:29:54 2008
@@ -630,8 +630,8 @@
} else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP)) {
ast_chan_log(LOG_NOTICE, chan, "Got AST_CONTROL_HANGUP\n");
send_eivr_event(eivr_events, 'H', NULL, chan);
- if (f->seqno) {
- chan->hangupcause = f->seqno;
+ if (f->data.uint32) {
+ chan->hangupcause = f->data.uint32;
}
ast_frfree(f);
res = -1;
Modified: trunk/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_festival.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_festival.c (original)
+++ trunk/apps/app_festival.c Thu May 22 11:29:54 2008
@@ -218,7 +218,7 @@
myf.f.samples = res / 2;
myf.f.offset = AST_FRIENDLY_OFFSET;
myf.f.src = __PRETTY_FUNCTION__;
- myf.f.data = myf.frdata;
+ myf.f.data.ptr = myf.frdata;
if (ast_write(chan, &myf.f) < 0) {
res = -1;
ast_frfree(f);
Modified: trunk/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_followme.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_followme.c (original)
+++ trunk/apps/app_followme.c Thu May 22 11:29:54 2008
@@ -607,8 +607,8 @@
switch(f->subclass) {
case AST_CONTROL_HANGUP:
ast_verb(3, "%s received a hangup frame.\n", winner->name);
- if (f->seqno) {
- winner->hangupcause = f->seqno;
+ if (f->data.uint32) {
+ winner->hangupcause = f->data.uint32;
}
if (dg == 0) {
ast_verb(3, "The calling channel hungup. Need to drop everyone else.\n");
Modified: trunk/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_ices.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_ices.c (original)
+++ trunk/apps/app_ices.c Thu May 22 11:29:54 2008
@@ -157,7 +157,7 @@
break;
}
if (f->frametype == AST_FRAME_VOICE) {
- res = write(fds[1], f->data, f->datalen);
+ res = write(fds[1], f->data.ptr, f->datalen);
if (res < 0) {
if (errno != EAGAIN) {
ast_log(LOG_WARNING, "Write failed to pipe: %s\n", strerror(errno));
Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Thu May 22 11:29:54 2008
@@ -2342,7 +2342,7 @@
to write out all the samples.
*/
if (user->talking)
- careful_write(fd, f->data, f->datalen, 0);
+ careful_write(fd, f->data.ptr, f->datalen, 0);
}
} else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT)) {
char tmp[2];
@@ -2566,7 +2566,7 @@
fr.subclass = AST_FORMAT_SLINEAR;
fr.datalen = res;
fr.samples = res / 2;
- fr.data = buf;
+ fr.data.ptr = buf;
fr.offset = AST_FRIENDLY_OFFSET;
if (!user->listen.actual &&
((confflags & CONFFLAG_MONITOR) ||
Modified: trunk/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_milliwatt.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_milliwatt.c (original)
+++ trunk/apps/app_milliwatt.c Thu May 22 11:29:54 2008
@@ -61,9 +61,9 @@
.frametype = AST_FRAME_VOICE,
.subclass = AST_FORMAT_ULAW,
.offset = AST_FRIENDLY_OFFSET,
- .data = buf + AST_FRIENDLY_OFFSET,
.src = __FUNCTION__,
};
+ wf.data.ptr = buf + AST_FRIENDLY_OFFSET;
/* Instead of len, use samples, because channel.c generator_force
* generate(chan, tmp, 0, 160) ignores len. In any case, len is
Modified: trunk/apps/app_mp3.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_mp3.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_mp3.c (original)
+++ trunk/apps/app_mp3.c Thu May 22 11:29:54 2008
@@ -167,7 +167,7 @@
myf.f.src = __PRETTY_FUNCTION__;
myf.f.delivery.tv_sec = 0;
myf.f.delivery.tv_usec = 0;
- myf.f.data = myf.frdata;
+ myf.f.data.ptr = myf.frdata;
if (ast_write(chan, &myf.f) < 0) {
res = -1;
break;
Modified: trunk/apps/app_nbscat.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_nbscat.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_nbscat.c (original)
+++ trunk/apps/app_nbscat.c Thu May 22 11:29:54 2008
@@ -150,7 +150,7 @@
myf.f.src = __PRETTY_FUNCTION__;
myf.f.delivery.tv_sec = 0;
myf.f.delivery.tv_usec = 0;
- myf.f.data = myf.frdata;
+ myf.f.data.ptr = myf.frdata;
if (ast_write(chan, &myf.f) < 0) {
res = -1;
break;
Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Thu May 22 11:29:54 2008
@@ -2669,8 +2669,9 @@
/* Got hung up */
*to = -1;
if (f) {
- if (f->seqno)
- in->hangupcause = f->seqno;
+ if (f->data.uint32) {
+ in->hangupcause = f->data.uint32;
+ }
ast_frfree(f);
}
return NULL;
Modified: trunk/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_sms.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_sms.c (original)
+++ trunk/apps/app_sms.c Thu May 22 11:29:54 2008
@@ -1501,7 +1501,7 @@
f.datalen = samples * sizeof(*buf);
f.offset = AST_FRIENDLY_OFFSET;
f.mallocd = 0;
- f.data = buf;
+ f.data.ptr = buf;
f.samples = samples;
f.src = "app_sms";
/* create a buffer containing the digital sms pattern */
@@ -1905,7 +1905,7 @@
break;
}
if (f->frametype == AST_FRAME_VOICE) {
- sms_process(&h, f->samples, f->data);
+ sms_process(&h, f->samples, f->data.ptr);
}
ast_frfree(f);
Modified: trunk/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_speech_utils.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_speech_utils.c (original)
+++ trunk/apps/app_speech_utils.c Thu May 22 11:29:54 2008
@@ -647,7 +647,7 @@
}
/* Write audio frame out to speech engine if no DTMF has been received */
if (!strlen(dtmf) && f != NULL && f->frametype == AST_FRAME_VOICE) {
- ast_speech_write(speech, f->data, f->datalen);
+ ast_speech_write(speech, f->data.ptr, f->datalen);
}
break;
case AST_SPEECH_STATE_WAIT:
Modified: trunk/apps/app_test.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_test.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_test.c (original)
+++ trunk/apps/app_test.c Thu May 22 11:29:54 2008
@@ -84,7 +84,7 @@
break;
}
if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) {
- foo = (short *)f->data;
+ foo = (short *)f->data.ptr;
for (x=0;x<f->samples;x++) {
noise += abs(foo[x]);
samples++;
Modified: trunk/apps/app_zapbarge.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_zapbarge.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_zapbarge.c (original)
+++ trunk/apps/app_zapbarge.c Thu May 22 11:29:54 2008
@@ -207,7 +207,7 @@
if (f->frametype == AST_FRAME_VOICE) {
if (f->subclass == AST_FORMAT_ULAW) {
/* Carefully write */
- careful_write(fd, f->data, f->datalen);
+ careful_write(fd, f->data.ptr, f->datalen);
} else
ast_log(LOG_WARNING, "Huh? Got a non-ulaw (%d) frame in the conference\n", f->subclass);
}
@@ -221,7 +221,7 @@
fr.subclass = AST_FORMAT_ULAW;
fr.datalen = res;
fr.samples = res;
- fr.data = buf;
+ fr.data.ptr = buf;
fr.offset = AST_FRIENDLY_OFFSET;
if (ast_write(chan, &fr) < 0) {
ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
Modified: trunk/apps/app_zapscan.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_zapscan.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/apps/app_zapscan.c (original)
+++ trunk/apps/app_zapscan.c Thu May 22 11:29:54 2008
@@ -231,7 +231,7 @@
if (f->frametype == AST_FRAME_VOICE) {
if (f->subclass == AST_FORMAT_ULAW) {
/* Carefully write */
- careful_write(fd, f->data, f->datalen);
+ careful_write(fd, f->data.ptr, f->datalen);
} else {
ast_log(LOG_WARNING, "Huh? Got a non-ulaw (%d) frame in the conference\n", f->subclass);
}
@@ -246,7 +246,7 @@
fr.subclass = AST_FORMAT_ULAW;
fr.datalen = res;
fr.samples = res;
- fr.data = buf;
+ fr.data.ptr = buf;
fr.offset = AST_FRIENDLY_OFFSET;
if (ast_write(chan, &fr) < 0) {
ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
Modified: trunk/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_alsa.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_alsa.c (original)
+++ trunk/channels/chan_alsa.c Thu May 22 11:29:54 2008
@@ -377,7 +377,7 @@
ast_log(LOG_WARNING, "Frame too large\n");
res = -1;
} else {
- memcpy(sizbuf + sizpos, f->data, f->datalen);
+ memcpy(sizbuf + sizpos, f->data.ptr, f->datalen);
len += f->datalen;
pos = 0;
state = snd_pcm_state(alsa.ocard);
@@ -426,7 +426,7 @@
f.subclass = 0;
f.samples = 0;
f.datalen = 0;
- f.data = NULL;
+ f.data.ptr = NULL;
f.offset = 0;
f.src = "Console";
f.mallocd = 0;
@@ -471,7 +471,7 @@
f.subclass = AST_FORMAT_SLINEAR;
f.samples = FRAME_SIZE;
f.datalen = FRAME_SIZE * 2;
- f.data = buf;
+ f.data.ptr = buf;
f.offset = AST_FRIENDLY_OFFSET;
f.src = "Console";
f.mallocd = 0;
@@ -718,14 +718,14 @@
}
text2send[strlen(text2send) - 1] = '\n';
- f.data = text2send;
+ f.data.ptr = text2send;
f.datalen = strlen(text2send) + 1;
grab_owner();
if (alsa.owner) {
ast_queue_frame(alsa.owner, &f);
f.frametype = AST_FRAME_CONTROL;
f.subclass = AST_CONTROL_ANSWER;
- f.data = NULL;
+ f.data.ptr = NULL;
f.datalen = 0;
ast_queue_frame(alsa.owner, &f);
ast_channel_unlock(alsa.owner);
@@ -765,7 +765,7 @@
hookstate = 0;
grab_owner();
if (alsa.owner) {
- ast_queue_hangup(alsa.owner, AST_CAUSE_NORMAL_CLEARING);
+ ast_queue_hangup_with_cause(alsa.owner, AST_CAUSE_NORMAL_CLEARING);
ast_channel_unlock(alsa.owner);
}
}
Modified: trunk/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_console.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_console.c (original)
+++ trunk/channels/chan_console.c Thu May 22 11:29:54 2008
@@ -874,7 +874,7 @@
pvt->hookstate = 0;
if (pvt->owner)
- ast_queue_hangup(pvt->owner, -1);
+ ast_queue_hangup(pvt->owner);
unref_pvt(pvt);
Modified: trunk/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_gtalk.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_gtalk.c (original)
+++ trunk/channels/chan_gtalk.c Thu May 22 11:29:54 2008
@@ -620,7 +620,7 @@
ast_getformatname_multiple(s2, BUFSIZ, tmp->peercapability),
ast_getformatname_multiple(s3, BUFSIZ, tmp->jointcapability));
/* close session if capabilities don't match */
- ast_queue_hangup(tmp->owner, -1);
+ ast_queue_hangup(tmp->owner);
return -1;
@@ -749,7 +749,7 @@
if (tmp) {
tmp->alreadygone = 1;
if (tmp->owner)
- ast_queue_hangup(tmp->owner, -1);
+ ast_queue_hangup(tmp->owner);
} else
ast_log(LOG_NOTICE, "Whoa, didn't find call!\n");
gtalk_response(client, from, pak, NULL, NULL);
Modified: trunk/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_h323.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_h323.c (original)
+++ trunk/channels/chan_h323.c Thu May 22 11:29:54 2008
@@ -342,7 +342,7 @@
ast_debug(1, "Process pending hangup for %s\n", c->name);
c->_softhangup |= AST_SOFTHANGUP_DEV;
c->hangupcause = pvt->hangupcause;
- ast_queue_hangup(c, pvt->hangupcause);
+ ast_queue_hangup_with_cause(c, pvt->hangupcause);
pvt->needhangup = 0;
pvt->newstate = pvt->newcontrol = pvt->newdigit = pvt->DTMFsched = -1;
}
@@ -2379,7 +2379,7 @@
/* Send hangup */
if (pvt->owner) {
pvt->owner->_softhangup |= AST_SOFTHANGUP_DEV;
- ast_queue_hangup(pvt->owner, -1);
+ ast_queue_hangup(pvt->owner);
ast_channel_unlock(pvt->owner);
}
ast_mutex_unlock(&pvt->lock);
@@ -2404,7 +2404,7 @@
if (pvt->owner && !ast_channel_trylock(pvt->owner)) {
pvt->owner->_softhangup |= AST_SOFTHANGUP_DEV;
pvt->owner->hangupcause = pvt->hangupcause = cause;
- ast_queue_hangup(pvt->owner, cause);
+ ast_queue_hangup_with_cause(pvt->owner, cause);
ast_channel_unlock(pvt->owner);
}
else {
Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Thu May 22 11:29:54 2008
@@ -1783,7 +1783,7 @@
usleep(1);
ast_mutex_lock(&iaxsl[callno]);
} else {
- ast_queue_hangup(iaxs[callno]->owner, -1);
+ ast_queue_hangup(iaxs[callno]->owner);
ast_channel_unlock(iaxs[callno]->owner);
break;
}
@@ -2244,7 +2244,7 @@
/* 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, -1);
+ ast_queue_hangup(owner);
}
if (pvt->peercallno) {
@@ -2312,7 +2312,7 @@
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 = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP, .seqno = AST_CAUSE_DESTINATION_OUT_OF_ORDER };
+ struct ast_frame fr = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP, .data.uint32 = AST_CAUSE_DESTINATION_OUT_OF_ORDER };
/* Hangup the fd */
iax2_queue_frame(callno, &fr); /* XXX */
/* Remember, owner could disappear */
@@ -3030,7 +3030,7 @@
static int iax2_sendimage(struct ast_channel *c, struct ast_frame *img)
{
- return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_IMAGE, img->subclass, 0, img->data, img->datalen, -1);
+ return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_IMAGE, img->subclass, 0, img->data.ptr, img->datalen, -1);
}
static int iax2_sendhtml(struct ast_channel *c, int subclass, const char *data, int datalen)
@@ -4418,7 +4418,7 @@
tpeer->trunkdatalen += sizeof(struct ast_iax2_meta_trunk_entry);
}
/* Copy actual trunk data */
- memcpy(ptr, f->data, f->datalen);
+ memcpy(ptr, f->data.ptr, f->datalen);
tpeer->trunkdatalen += f->datalen;
tpeer->calls++;
@@ -4698,7 +4698,7 @@
else
fr->oseqno = pvt->oseqno++;
fr->iseqno = pvt->iseqno;
- fh = (struct ast_iax2_full_hdr *)(fr->af.data - sizeof(struct ast_iax2_full_hdr));
+ fh = (struct ast_iax2_full_hdr *)(fr->af.data.ptr - sizeof(struct ast_iax2_full_hdr));
fh->scallno = htons(fr->callno | IAX_FLAG_FULL);
fh->ts = htonl(fr->ts);
fh->oseqno = fr->oseqno;
@@ -4763,7 +4763,7 @@
/* Video frame have no sequence number */
fr->oseqno = -1;
fr->iseqno = -1;
- vh = (struct ast_iax2_video_hdr *)(fr->af.data - sizeof(struct ast_iax2_video_hdr));
+ vh = (struct ast_iax2_video_hdr *)(fr->af.data.ptr - sizeof(struct ast_iax2_video_hdr));
vh->zeros = 0;
vh->callno = htons(0x8000 | fr->callno);
vh->ts = htons((fr->ts & 0x7FFF) | (fr->af.subclass & 0x1 ? 0x8000 : 0));
@@ -4779,7 +4779,7 @@
fr->oseqno = -1;
fr->iseqno = -1;
/* Mini frame will do */
- mh = (struct ast_iax2_mini_hdr *)(fr->af.data - sizeof(struct ast_iax2_mini_hdr));
+ mh = (struct ast_iax2_mini_hdr *)(fr->af.data.ptr - sizeof(struct ast_iax2_mini_hdr));
mh->callno = htons(fr->callno);
mh->ts = htons(fr->ts & 0xFFFF);
fr->datalen = fr->af.datalen + sizeof(struct ast_iax2_mini_hdr);
@@ -5666,7 +5666,7 @@
f.subclass = command;
f.datalen = datalen;
f.src = __FUNCTION__;
- f.data = (void *) data;
+ f.data.ptr = (void *) data;
return iax2_send(i, &f, ts, seqno, now, transfer, final, media);
}
@@ -7810,9 +7810,9 @@
f.datalen = len;
if (f.datalen >= 0) {
if (f.datalen)
- f.data = ptr;
+ f.data.ptr = ptr;
else
- f.data = NULL;
+ f.data.ptr = NULL;
if (trunked_ts)
fr->ts = (iaxs[fr->callno]->last & 0xFFFF0000L) | (trunked_ts & 0xffff);
else
@@ -8217,15 +8217,15 @@
ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
- f.data = NULL;
+ f.data.ptr = NULL;
f.datalen = 0;
} else
- f.data = thread->buf + sizeof(*fh);
+ f.data.ptr = thread->buf + sizeof(*fh);
} else {
if (f.frametype == AST_FRAME_IAX)
- f.data = NULL;
+ f.data.ptr = NULL;
else
- f.data = empty;
+ f.data.ptr = empty;
memset(&ies, 0, sizeof(ies));
}
@@ -9421,9 +9421,9 @@
}
f.datalen = res - sizeof(*vh);
if (f.datalen)
- f.data = thread->buf + sizeof(*vh);
+ f.data.ptr = thread->buf + sizeof(*vh);
else
- f.data = NULL;
+ f.data.ptr = NULL;
#ifdef IAXTESTS
if (test_resync) {
fr->ts = (iaxs[fr->callno]->last & 0xFFFF8000L) | ((ntohs(vh->ts) + test_resync) & 0x7fff);
@@ -9448,9 +9448,9 @@
return 1;
}
if (f.datalen)
- f.data = thread->buf + sizeof(*mh);
+ f.data.ptr = thread->buf + sizeof(*mh);
else
- f.data = NULL;
+ f.data.ptr = NULL;
#ifdef IAXTESTS
if (test_resync) {
fr->ts = (iaxs[fr->callno]->last & 0xFFFF0000L) | ((ntohs(mh->ts) + test_resync) & 0xffff);
Modified: trunk/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_jingle.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_jingle.c (original)
+++ trunk/channels/chan_jingle.c Thu May 22 11:29:54 2008
@@ -573,7 +573,7 @@
if (tmp) {
tmp->alreadygone = 1;
if (tmp->owner)
- ast_queue_hangup(tmp->owner, -1);
+ ast_queue_hangup(tmp->owner);
} else
ast_log(LOG_NOTICE, "Whoa, didn't find call!\n");
jingle_response(client, pak, NULL, NULL);
Modified: trunk/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_local.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_local.c (original)
+++ trunk/channels/chan_local.c Thu May 22 11:29:54 2008
@@ -396,7 +396,7 @@
ast_mutex_lock(&p->lock);
isoutbound = IS_OUTBOUND(ast, p);
f.subclass = condition;
- f.data = (void*)data;
+ f.data.ptr = (void*)data;
f.datalen = datalen;
if (!(res = local_queue_frame(p, isoutbound, &f, ast, 1)))
ast_mutex_unlock(&p->lock);
@@ -456,7 +456,7 @@
ast_mutex_lock(&p->lock);
isoutbound = IS_OUTBOUND(ast, p);
- f.data = (char *) text;
+ f.data.ptr = (char *) text;
f.datalen = strlen(text) + 1;
if (!(res = local_queue_frame(p, isoutbound, &f, ast, 0)))
ast_mutex_unlock(&p->lock);
@@ -476,7 +476,7 @@
ast_mutex_lock(&p->lock);
isoutbound = IS_OUTBOUND(ast, p);
f.subclass = subclass;
- f.data = (char *)data;
+ f.data.ptr = (char *)data;
f.datalen = datalen;
if (!(res = local_queue_frame(p, isoutbound, &f, ast, 0)))
ast_mutex_unlock(&p->lock);
@@ -537,7 +537,7 @@
{
struct local_pvt *p = ast->tech_pvt;
int isoutbound;
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP, .seqno = ast->hangupcause };
+ struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP, .data.uint32 = ast->hangupcause };
struct ast_channel *ochan = NULL;
int glaredetect = 0, res = 0;
Modified: trunk/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_mgcp.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_mgcp.c (original)
+++ trunk/channels/chan_mgcp.c Thu May 22 11:29:54 2008
@@ -610,7 +610,7 @@
for(;;) {
if (sub->owner) {
if (!ast_channel_trylock(sub->owner)) {
- ast_queue_hangup(sub->owner, -1);
+ ast_queue_hangup(sub->owner);
ast_channel_unlock(sub->owner);
break;
} else {
Modified: trunk/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_misdn.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Thu May 22 11:29:54 2008
@@ -2320,13 +2320,13 @@
if (!p) {
ast_log(LOG_WARNING, " --> Channel not connected ??\n");
- ast_queue_hangup(ast, AST_CAUSE_NETWORK_OUT_OF_ORDER);
+ ast_queue_hangup_with_cause(ast, AST_CAUSE_NETWORK_OUT_OF_ORDER);
}
if (!p->bc) {
chan_misdn_log(1, 0, " --> Got Answer, but theres no bc obj ??\n");
- ast_queue_hangup(ast, AST_CAUSE_PROTOCOL_ERROR);
+ ast_queue_hangup_with_cause(ast, AST_CAUSE_PROTOCOL_ERROR);
}
tmp = pbx_builtin_getvar_helper(p->ast, "CRYPT_KEY");
@@ -3665,7 +3665,7 @@
send_cause2ast(ch->ast, ch->bc, ch);
if (ch->ast)
- ast_queue_hangup(ch->ast, ch->bc->cause);
+ ast_queue_hangup_with_cause(ch->ast, ch->bc->cause);
cb_log(2, port, " --> queue_hangup\n");
} else {
cb_log(1, port, "Cannot hangup chan, no ast\n");
Modified: trunk/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_oss.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_oss.c (original)
+++ trunk/channels/chan_oss.c Thu May 22 11:29:54 2008
@@ -679,13 +679,13 @@
int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
if (f->datalen - src >= l) { /* enough to fill a frame */
- memcpy(o->oss_write_buf + o->oss_write_dst, f->data + src, l);
+ memcpy(o->oss_write_buf + o->oss_write_dst, f->data.ptr + src, l);
soundcard_writeframe(o, (short *) o->oss_write_buf);
src += l;
o->oss_write_dst = 0;
} else { /* copy residue */
l = f->datalen - src;
- memcpy(o->oss_write_buf + o->oss_write_dst, f->data + src, l);
+ memcpy(o->oss_write_buf + o->oss_write_dst, f->data.ptr + src, l);
src += l; /* but really, we are done */
o->oss_write_dst += l;
}
@@ -724,10 +724,10 @@
f->subclass = AST_FORMAT_SLINEAR;
f->samples = FRAME_SIZE;
f->datalen = FRAME_SIZE * 2;
- f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
+ f->data.ptr = o->oss_read_buf + AST_FRIENDLY_OFFSET;
if (o->boost != BOOST_SCALE) { /* scale and clip values */
int i, x;
- int16_t *p = (int16_t *) f->data;
+ int16_t *p = (int16_t *) f->data.ptr;
for (i = 0; i < f->samples; i++) {
x = (p[i] * o->boost) / BOOST_SCALE;
if (x > 32767)
@@ -1012,7 +1012,7 @@
buf[i] = '\n';
f.frametype = AST_FRAME_TEXT;
f.subclass = 0;
- f.data = buf;
+ f.data.ptr = buf;
f.datalen = i + 1;
ast_queue_frame(o->owner, &f);
}
@@ -1040,7 +1040,7 @@
}
o->hookstate = 0;
if (o->owner)
- ast_queue_hangup(o->owner, AST_CAUSE_NORMAL_CLEARING);
+ ast_queue_hangup_with_cause(o->owner, AST_CAUSE_NORMAL_CLEARING);
setformat(o, O_CLOSE);
return CLI_SUCCESS;
}
Modified: trunk/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_phone.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_phone.c (original)
+++ trunk/channels/chan_phone.c Thu May 22 11:29:54 2008
@@ -494,7 +494,7 @@
/* Some nice norms */
p->fr.datalen = 0;
p->fr.samples = 0;
- p->fr.data = NULL;
+ p->fr.data.ptr = NULL;
p->fr.src = "Phone";
p->fr.offset = 0;
p->fr.mallocd=0;
@@ -553,7 +553,7 @@
/* Some nice norms */
p->fr.datalen = 0;
p->fr.samples = 0;
- p->fr.data = NULL;
+ p->fr.data.ptr = NULL;
p->fr.src = "Phone";
p->fr.offset = 0;
p->fr.mallocd=0;
@@ -575,7 +575,7 @@
ast_log(LOG_WARNING, "Error reading: %s\n", strerror(errno));
return NULL;
}
- p->fr.data = p->buf;
+ p->fr.data.ptr = p->buf;
if (p->mode != MODE_FXS)
switch(p->buf[0] & 0x3) {
case '0':
@@ -797,7 +797,7 @@
}
/* If we get here, we have a frame of Appropriate data */
sofar = 0;
- pos = frame->data;
+ pos = frame->data.ptr;
while(sofar < frame->datalen) {
/* Write in no more than maxfr sized frames */
expected = frame->datalen - sofar;
@@ -808,7 +808,7 @@
if (frame->datalen == 4) {
if (p->silencesupression) {
memset(tmpbuf + 4, 0, sizeof(tmpbuf) - 4);
- memcpy(tmpbuf, frame->data, 4);
+ memcpy(tmpbuf, frame->data.ptr, 4);
expected = 24;
res = phone_write_buf(p, tmpbuf, expected, maxfr, 0);
}
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu May 22 11:29:54 2008
@@ -2979,7 +2979,7 @@
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 @@
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 @@
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 @@
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 @@
*/
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 @@
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 @@
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 @@
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 @@
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 @@
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);
Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Thu May 22 11:29:54 2008
@@ -4554,7 +4554,7 @@
if ((res = attempt_transfer(p)) < 0) {
if (sub->next && sub->next->owner) {
sub->next->alreadygone = 1;
- ast_queue_hangup(sub->next->owner, -1);
+ ast_queue_hangup(sub->next->owner);
}
} else if (res) {
ast_log(LOG_WARNING, "Transfer attempt failed\n");
@@ -4566,7 +4566,7 @@
/* If there is another active call, skinny_hangup will ring the phone with the other call */
if (sub->owner) {
sub->alreadygone = 1;
- ast_queue_hangup(sub->owner, -1);
+ ast_queue_hangup(sub->owner);
} else {
ast_log(LOG_WARNING, "Skinny(%s@%s-%d) channel already destroyed\n",
l->name, d->name, sub->callid);
@@ -5263,7 +5263,7 @@
if ((res = attempt_transfer(p)) < 0) {
if (sub->next && sub->next->owner) {
sub->next->alreadygone = 1;
- ast_queue_hangup(sub->next->owner, -1);
+ ast_queue_hangup(sub->next->owner);
}
} else if (res) {
ast_log(LOG_WARNING, "Transfer attempt failed\n");
@@ -5275,7 +5275,7 @@
/* If there is another active call, skinny_hangup will ring the phone with the other call */
if (sub->owner) {
sub->alreadygone = 1;
- ast_queue_hangup(sub->owner, -1);
+ ast_queue_hangup(sub->owner);
} else {
ast_log(LOG_WARNING, "Skinny(%s@%s-%d) channel already destroyed\n",
l->name, d->name, sub->callid);
Modified: trunk/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_unistim.c?view=diff&rev=117802&r1=117801&r2=117802
==============================================================================
--- trunk/channels/chan_unistim.c (original)
+++ trunk/channels/chan_unistim.c Thu May 22 11:29:54 2008
@@ -1125,7 +1125,7 @@
[... 1834 lines stripped ...]
More information about the svn-commits
mailing list