Skip to content

Commit

Permalink
cleanup transferChannels.transfer* during the hangup process, add som…
Browse files Browse the repository at this point in the history
…e remarks

git-svn-id: https://svn.code.sf.net/p/chan-sccp-b/code/trunk@4191 43c1dc8c-776e-4df2-8ef1-6e829299be21
  • Loading branch information
marcelloceschia committed Feb 5, 2013
1 parent f0dac52 commit 078de0a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/sccp_pbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ int sccp_pbx_hangup(sccp_channel_t * c)
/* done - end callforwards */

/* remove call from transferee, transferer */

/** \todo we should discuse to use a helper variable in channel, e.g. channel->transferDevice.transferer / channel->transferDevice.transferee */
// void (*removeTransferedDevice)(void) =
// ({
// void __fn__ (void)
Expand All @@ -422,13 +422,18 @@ int sccp_pbx_hangup(sccp_channel_t * c)
if ((tmpDevice = sccp_device_retain(linedevice->device))) {
if(tmpDevice->transferChannels.transferer == c){
tmpDevice->transferChannels.transferer = sccp_channel_release(tmpDevice->transferChannels.transferer);
break;
}
if(tmpDevice->transferChannels.transferee == c){
if(tmpDevice->transferChannels.transferee == c) {
tmpDevice->transferChannels.transferee = sccp_channel_release(tmpDevice->transferChannels.transferee);

/* also remove transferer */
tmpDevice->transferChannels.transferer = tmpDevice->transferChannels.transferer ? sccp_channel_release(tmpDevice->transferChannels.transferer) : NULL;
break;
}
tmpDevice = sccp_device_release(tmpDevice);
}
}
tmpDevice = tmpDevice ? sccp_device_release(tmpDevice) : NULL;
SCCP_LIST_UNLOCK(&l->devices);
}
// __fn__;
Expand Down

0 comments on commit 078de0a

Please sign in to comment.