Fixes so that fields are initialized in events from #7241. Thanks flefoll!

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@343 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Matthew Fredrickson 2006-06-01 18:00:31 +00:00
parent f316eed834
commit a3ee176154

39
q931.c
View File

@ -2645,9 +2645,11 @@ static void pri_release_finaltimeout(void *data)
pri->schedev = 1;
pri->ev.e = PRI_EVENT_HANGUP_ACK;
pri->ev.hangup.channel = c->channelno;
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.cause = c->cause;
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.call = c;
pri->ev.hangup.aoc_units = c->aoc_units;
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo));
q931_hangup(pri, c, c->cause);
}
@ -3293,9 +3295,9 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
libpri_copy_string(pri->ev.ring.callednum, c->callednum, sizeof(pri->ev.ring.callednum));
libpri_copy_string(pri->ev.ring.origcalledname, c->origcalledname, sizeof(pri->ev.ring.origcalledname));
libpri_copy_string(pri->ev.ring.origcallednum, c->origcallednum, sizeof(pri->ev.ring.origcallednum));
libpri_copy_string(pri->ev.ring.redirectingnum, c->redirectingnum, sizeof(pri->ev.ring.redirectingnum));
libpri_copy_string(pri->ev.ring.redirectingname, c->redirectingname, sizeof(pri->ev.ring.redirectingname));
libpri_copy_string(pri->ev.ring.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
libpri_copy_string(pri->ev.ring.redirectingnum, c->redirectingnum, sizeof(pri->ev.ring.redirectingnum));
libpri_copy_string(pri->ev.ring.redirectingname, c->redirectingname, sizeof(pri->ev.ring.redirectingname));
libpri_copy_string(pri->ev.ring.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
c->useruserinfo[0] = '\0';
pri->ev.ring.redirectingreason = c->redirectingreason;
pri->ev.ring.origredirectingreason = c->origredirectingreason;
@ -3322,7 +3324,7 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
pri->ev.ringing.call = c;
pri->ev.ringing.progress = c->progress;
pri->ev.ringing.progressmask = c->progressmask;
libpri_copy_string(pri->ev.ringing.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
libpri_copy_string(pri->ev.ringing.useruserinfo, c->useruserinfo, sizeof(pri->ev.ringing.useruserinfo));
c->useruserinfo[0] = '\0';
return Q931_RES_HAVEEVENT;
case Q931_CONNECT:
@ -3342,7 +3344,7 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
pri->ev.answer.call = c;
pri->ev.answer.progress = c->progress;
pri->ev.answer.progressmask = c->progressmask;
libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.answer.useruserinfo));
c->useruserinfo[0] = '\0';
q931_connect_acknowledge(pri, c);
if (c->justsignalling) { /* Make sure WE release when we initiatie a signalling only connection */
@ -3428,9 +3430,11 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
/* Workaround for S-12 ver 7.3 - it responds for invalid/non-implemented IEs at SETUP with null call state */
if (!c->sugcallstate && (c->ourcallstate != Q931_CALL_STATE_CALL_INITIATED)) {
pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.cause = c->cause;
pri->ev.hangup.call = c;
pri->ev.hangup.cause = c->cause;
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.call = c;
pri->ev.hangup.aoc_units = c->aoc_units;
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo));
/* Free resources */
c->ourcallstate = Q931_CALL_STATE_NULL;
c->peercallstate = Q931_CALL_STATE_NULL;
@ -3454,10 +3458,11 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
c->ourcallstate = Q931_CALL_STATE_NULL;
c->peercallstate = Q931_CALL_STATE_NULL;
pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.cause = c->cause;
pri->ev.hangup.call = c;
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
pri->ev.hangup.cause = c->cause;
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.call = c;
pri->ev.hangup.aoc_units = c->aoc_units;
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo));
c->useruserinfo[0] = '\0';
/* Free resources */
if (c->alive) {
@ -3488,11 +3493,11 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
c->ourcallstate = Q931_CALL_STATE_NULL;
pri->ev.e = PRI_EVENT_HANGUP;
pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.cause = c->cause;
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.call = c;
pri->ev.hangup.aoc_units = c->aoc_units;
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo));
c->useruserinfo[0] = '\0';
/* Don't send release complete if they send us release
while we sent it, assume a NULL state */
@ -3516,11 +3521,11 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
/* Return such an event */
pri->ev.e = PRI_EVENT_HANGUP_REQ;
pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.cause = c->cause;
pri->ev.hangup.cref = c->cr;
pri->ev.hangup.call = c;
pri->ev.hangup.aoc_units = c->aoc_units;
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo));
c->useruserinfo[0] = '\0';
if (c->alive)
return Q931_RES_HAVEEVENT;