dont segfault when placing a call to a line that has no registered device.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
235d4159f6
commit
6f860c262d
1 changed files with 5 additions and 0 deletions
|
@ -3784,6 +3784,11 @@ static struct ast_channel *skinny_new(struct skinny_line *l, int state)
|
||||||
struct ast_variable *v = NULL;
|
struct ast_variable *v = NULL;
|
||||||
int fmt;
|
int fmt;
|
||||||
|
|
||||||
|
if (!l->device) {
|
||||||
|
ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
tmp = ast_channel_alloc(1, state, l->cid_num, l->cid_name, l->accountcode, l->exten, l->context, l->amaflags, "Skinny/%s@%s-%d", l->name, d->name, callnums);
|
tmp = ast_channel_alloc(1, state, l->cid_num, l->cid_name, l->accountcode, l->exten, l->context, l->amaflags, "Skinny/%s@%s-%d", l->name, d->name, callnums);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
|
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
|
||||||
|
|
Loading…
Reference in a new issue