diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-20 21:28:32 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-20 21:28:32 +0000 |
commit | 28795d7d71f905c9a18a04520dba0c5a509bc33d (patch) | |
tree | 32ab6d54c470237b1f6f3ac3f7be2d261ca76b46 | |
parent | 19bc699a6534755f3931f7301fc820ac4f41ae64 (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.6.2@287642 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_skinny.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index dd0f7466d..dd3f963ed 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -4894,17 +4894,21 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession if ((sub && sub->owner) && (sub->owner->_state == AST_STATE_UP)){ c = sub->owner; - if (!ast_masq_park_call(ast_bridged_channel(c), c, 0, &extout)) { - snprintf(message, sizeof(message), "Call Parked at: %d", extout); - transmit_displaynotify(d, message, 10); + if (ast_bridged_channel(c)) { + if (!ast_masq_park_call(ast_bridged_channel(c), c, 0, &extout)) { + snprintf(message, sizeof(message), "Call Parked at: %d", extout); + transmit_displaynotify(d, message, 10); + } else { + transmit_displaynotify(d, "Call Park failed", 10); + } } else { - transmit_displaynotify(d, "Call Park failed", 10); + transmit_displaynotify(d, "Call Park not available", 10); } } else { transmit_displaynotify(d, "Call Park not available", 10); } - } break; + } case STIMULUS_DND: if (skinnydebug) ast_verb(1, "Received Stimulus: DND (%d/%d)\n", instance, callreference); @@ -5984,17 +5988,21 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse if ((sub && sub->owner) && (sub->owner->_state == AST_STATE_UP)){ c = sub->owner; - if (!ast_masq_park_call(ast_bridged_channel(c), c, 0, &extout)) { - snprintf(message, sizeof(message), "Call Parked at: %d", extout); - transmit_displaynotify(d, message, 10); + if (ast_bridged_channel(c)) { + if (!ast_masq_park_call(ast_bridged_channel(c), c, 0, &extout)) { + snprintf(message, sizeof(message), "Call Parked at: %d", extout); + transmit_displaynotify(d, message, 10); + } else { + transmit_displaynotify(d, "Call Park failed", 10); + } } else { - transmit_displaynotify(d, "Call Park failed", 10); + transmit_displaynotify(d, "Call Park not available", 10); } } else { transmit_displaynotify(d, "Call Park not available", 10); } - } break; + } case SOFTKEY_JOIN: if (skinnydebug) ast_verb(1, "Received Softkey Event: Join(%d/%d)\n", instance, callreference); |