[asterisk-commits] dvossel: branch dvossel/iax2transfer_1.6.0 r173204 - /team/dvossel/iax2transf...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Feb 3 13:52:42 CST 2009
Author: dvossel
Date: Tue Feb 3 13:52:41 2009
New Revision: 173204
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=173204
Log:
chan_iax2.c added remove_by_transfercallno to destructor
Modified:
team/dvossel/iax2transfer_1.6.0/channels/chan_iax2.c
Modified: team/dvossel/iax2transfer_1.6.0/channels/chan_iax2.c
URL: http://svn.digium.com/svn-view/asterisk/team/dvossel/iax2transfer_1.6.0/channels/chan_iax2.c?view=diff&rev=173204&r1=173203&r2=173204
==============================================================================
--- team/dvossel/iax2transfer_1.6.0/channels/chan_iax2.c (original)
+++ team/dvossel/iax2transfer_1.6.0/channels/chan_iax2.c Tue Feb 3 13:52:41 2009
@@ -1667,41 +1667,40 @@
char host[80];
if (new <= NEW_ALLOW) {
- if (callno) {
- struct chan_iax2_pvt *pvt;
- struct chan_iax2_pvt tmp_pvt = {
- .callno = dcallno,
- .peercallno = callno,
+ if (callno) {
+ struct chan_iax2_pvt *pvt;
+ struct chan_iax2_pvt tmp_pvt = {
+ .callno = dcallno,
+ .peercallno = callno,
.transfercallno = callno,
- /* hack!! */
- .frames_received = check_dcallno,
- };
-
- memcpy(&tmp_pvt.addr, sin, sizeof(tmp_pvt.addr));
+ /* hack!! */
+ .frames_received = check_dcallno,
+ };
+
+ memcpy(&tmp_pvt.addr, sin, sizeof(tmp_pvt.addr));
/* this works for finding normal call numbers not involving transfering */
- if ((pvt = ao2_find(iax_peercallno_pvts, &tmp_pvt, OBJ_POINTER))) {
- if (return_locked) {
- ast_mutex_lock(&iaxsl[pvt->callno]);
- }
- res = pvt->callno;
- ao2_ref(pvt, -1);
- pvt = NULL;
- return res;
- }
+ if ((pvt = ao2_find(iax_peercallno_pvts, &tmp_pvt, OBJ_POINTER))) {
+ if (return_locked) {
+ ast_mutex_lock(&iaxsl[pvt->callno]);
+ }
+ res = pvt->callno;
+ ao2_ref(pvt, -1);
+ pvt = NULL;
+ return res;
+ }
/* this searches for transfer call numbers that might not get caught otherwise */
memset(&tmp_pvt.addr, 0, sizeof(tmp_pvt.addr));
memcpy(&tmp_pvt.transfer, sin, sizeof(tmp_pvt.addr));
if ((pvt = ao2_find(iax_transfercallno_pvts, &tmp_pvt, OBJ_POINTER))) {
- if (return_locked) {
- ast_mutex_lock(&iaxsl[pvt->callno]);
- }
- res = pvt->callno;
- ao2_ref(pvt, -1);
- pvt = NULL;
- return res;
- }
-
- }
+ if (return_locked) {
+ ast_mutex_lock(&iaxsl[pvt->callno]);
+ }
+ res = pvt->callno;
+ ao2_ref(pvt, -1);
+ pvt = NULL;
+ return res;
+ }
+ }
/* This will occur on the first response to a message that we initiated,
* such as a PING. */
if (dcallno) {
@@ -2346,6 +2345,10 @@
if (pvt->peercallno) {
remove_by_peercallno(pvt);
+ }
+
+ if(pvt->transfercallno) {
+ remove_by_transfercallno(pvt);
}
if (!owner) {
@@ -6613,7 +6616,7 @@
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);
- return 0;
+ return 0;
}
static int complete_dpreply(struct chan_iax2_pvt *pvt, struct iax_ies *ies)
@@ -12233,7 +12236,7 @@
/* The frames_received field is used to hold whether we're matching
* against a full frame or not ... */
- return match(&pvt2->transfer, pvt2->transfercallno, pvt2->callno, pvt,
+ return match(&pvt2->transfer, pvt2->transfercallno, pvt2->callno, pvt,
pvt2->frames_received) ? CMP_MATCH | CMP_STOP : 0;
}
/*! \brief Load IAX2 module, load configuraiton ---*/
More information about the asterisk-commits
mailing list