dect
/
asterisk
Archived
13
0
Fork 0

Merged revisions 250394 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r250394 | dvossel | 2010-03-03 12:02:27 -0600 (Wed, 03 Mar 2010) | 16 lines
  
  fixes problem with duplicate TXREQ packets
  
  When Asterisk receives an IAX2 TXREQ packet, try_transfer()
  will call store_by_transfercallno() to link the chan_iax2_pvt
  struct into iax_transfercallno_pvts. If a duplicate TXREQ
  packet is received for the same call, the pvt struct will be
  linked into iax_transfercallno_pvts multiple times.  This patch
  fixes this.  Thanks rain for debugging this and providing a patch!
  
  (closes issue #16904)
  Reported by: rain
  Patches:
        iax2-double-txreq-fix.diff uploaded by rain (license 327)
  Tested by: rain, dvossel
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250395 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
dvossel 2010-03-03 18:03:19 +00:00
parent 3212543aeb
commit d86eba05fd
1 changed files with 8 additions and 3 deletions

View File

@ -8063,9 +8063,14 @@ static int try_transfer(struct chan_iax2_pvt *pvt, struct iax_ies *ies)
memcpy(&pvt->transfer, &new, sizeof(pvt->transfer));
inet_aton(newip, &pvt->transfer.sin_addr);
pvt->transfer.sin_family = AF_INET;
pvt->transferring = TRANSFER_BEGIN;
pvt->transferid = ies->transferid;
store_by_transfercallno(pvt);
/* only store by transfercallno if this is a new transfer,
* just in case we get a duplicate TXREQ */
if (pvt->transferring == TRANSFER_NONE) {
store_by_transfercallno(pvt);
}
pvt->transferring = TRANSFER_BEGIN;
if (ies->transferid)
iax_ie_append_int(&ied, IAX_IE_TRANSFERID, ies->transferid);
send_command_transfer(pvt, AST_FRAME_IAX, IAX_COMMAND_TXCNT, 0, ied.buf, ied.pos);
@ -8159,7 +8164,7 @@ static int complete_transfer(int callno, struct iax_ies *ies)
pvt->voiceformat = 0;
pvt->svideoformat = -1;
pvt->videoformat = 0;
pvt->transfercallno = -1;
pvt->transfercallno = 0;
memset(&pvt->rxcore, 0, sizeof(pvt->rxcore));
memset(&pvt->offset, 0, sizeof(pvt->offset));
/* reset jitterbuffer */