dont segfault when placing a call to a line that has no registered device.
authorMichiel van Baak <michiel@vanbaak.info>
Sun, 19 Oct 2008 13:10:50 +0000 (13:10 +0000)
committerMichiel van Baak <michiel@vanbaak.info>
Sun, 19 Oct 2008 13:10:50 +0000 (13:10 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151060 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_skinny.c

index c6ad9cc..3c0c9fb 100644 (file)
@@ -3784,6 +3784,11 @@ static struct ast_channel *skinny_new(struct skinny_line *l, int state)
        struct ast_variable *v = NULL;
        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);
        if (!tmp) {
                ast_log(LOG_WARNING, "Unable to allocate channel structure\n");