Only assign line and device in handle_transfer_button when we have a subchannel.

(closes issue #16040)
Reported by: ebroad


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Michiel van Baak 2009-12-04 16:18:57 +00:00
parent 494647fbe7
commit c1dfce9753
1 changed files with 6 additions and 2 deletions

View File

@ -4544,8 +4544,8 @@ static int handle_hold_button(struct skinny_subchannel *sub)
static int handle_transfer_button(struct skinny_subchannel *sub)
{
struct skinny_line *l = sub->parent;
struct skinny_device *d = l->device;
struct skinny_line *l;
struct skinny_device *d;
struct skinny_subchannel *newsub;
struct ast_channel *c;
pthread_t t;
@ -4554,6 +4554,10 @@ static int handle_transfer_button(struct skinny_subchannel *sub)
ast_verbose("Transfer: No subchannel to transfer\n");
return -1;
}
l = sub->parent;
d = l->device;
if (!sub->related) {
/* Another sub has not been created so this must be first XFER press */
if (!sub->onhold) {