Don't crash when parking a non-bridged call.

(closes issue #17680)
Reported by: jmhunter
Patches: 
      chan_skinny-park-v1.txt uploaded by DEA (license 3)
Tested by: jmhunter, DEA


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@287642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.2
Jason Parker 15 years ago
parent 1873dce3fe
commit 3d224c4c11

@ -4894,6 +4894,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
if ((sub && sub->owner) && (sub->owner->_state == AST_STATE_UP)){ if ((sub && sub->owner) && (sub->owner->_state == AST_STATE_UP)){
c = sub->owner; c = sub->owner;
if (ast_bridged_channel(c)) {
if (!ast_masq_park_call(ast_bridged_channel(c), c, 0, &extout)) { if (!ast_masq_park_call(ast_bridged_channel(c), c, 0, &extout)) {
snprintf(message, sizeof(message), "Call Parked at: %d", extout); snprintf(message, sizeof(message), "Call Parked at: %d", extout);
transmit_displaynotify(d, message, 10); transmit_displaynotify(d, message, 10);
@ -4903,8 +4904,11 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
} else { } else {
transmit_displaynotify(d, "Call Park not available", 10); transmit_displaynotify(d, "Call Park not available", 10);
} }
} else {
transmit_displaynotify(d, "Call Park not available", 10);
} }
break; break;
}
case STIMULUS_DND: case STIMULUS_DND:
if (skinnydebug) if (skinnydebug)
ast_verb(1, "Received Stimulus: DND (%d/%d)\n", instance, callreference); ast_verb(1, "Received Stimulus: DND (%d/%d)\n", instance, callreference);
@ -5984,6 +5988,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
if ((sub && sub->owner) && (sub->owner->_state == AST_STATE_UP)){ if ((sub && sub->owner) && (sub->owner->_state == AST_STATE_UP)){
c = sub->owner; c = sub->owner;
if (ast_bridged_channel(c)) {
if (!ast_masq_park_call(ast_bridged_channel(c), c, 0, &extout)) { if (!ast_masq_park_call(ast_bridged_channel(c), c, 0, &extout)) {
snprintf(message, sizeof(message), "Call Parked at: %d", extout); snprintf(message, sizeof(message), "Call Parked at: %d", extout);
transmit_displaynotify(d, message, 10); transmit_displaynotify(d, message, 10);
@ -5993,8 +5998,11 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
} else { } else {
transmit_displaynotify(d, "Call Park not available", 10); transmit_displaynotify(d, "Call Park not available", 10);
} }
} else {
transmit_displaynotify(d, "Call Park not available", 10);
} }
break; break;
}
case SOFTKEY_JOIN: case SOFTKEY_JOIN:
if (skinnydebug) if (skinnydebug)
ast_verb(1, "Received Softkey Event: Join(%d/%d)\n", instance, callreference); ast_verb(1, "Received Softkey Event: Join(%d/%d)\n", instance, callreference);

Loading…
Cancel
Save