]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
When creating a conference for a unit test, it is not mandatory to open a
authorEliel C. Sardanons <eliels@gmail.com>
Sat, 10 Jul 2010 20:49:30 +0000 (20:49 +0000)
committerEliel C. Sardanons <eliels@gmail.com>
Sat, 10 Jul 2010 20:49:30 +0000 (20:49 +0000)
dahdi pseudo channel, so if we fail doing it, continue creating the conference.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275509 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c

index eb9aabead3905d7a26cb0bee715a0866cb5d8596..a81287079869c3d0f1d67787d81503ac6f292faa 100644 (file)
@@ -1186,14 +1186,18 @@ static struct ast_conference *build_conf(const char *confno, const char *pin,
        cnf->fd = open("/dev/dahdi/pseudo", O_RDWR);
        if (cnf->fd < 0 || ioctl(cnf->fd, DAHDI_SETCONF, &dahdic)) {
                if (test) {
+                       /* if we are creating a conference for a unit test, it is not neccesary
+                        * to open a pseudo channel, so, if we fail continue creating
+                        * the conference. */
                        ast_test_status_update(test, "Unable to open pseudo device\n");
+               } else {
+                       ast_log(LOG_WARNING, "Unable to open pseudo device\n");
+                       if (cnf->fd >= 0)
+                               close(cnf->fd);
+                       ast_free(cnf);
+                       cnf = NULL;
+                       goto cnfout;
                }
-               ast_log(LOG_WARNING, "Unable to open pseudo device\n");
-               if (cnf->fd >= 0)
-                       close(cnf->fd);
-               ast_free(cnf);
-               cnf = NULL;
-               goto cnfout;
        }
 
        cnf->dahdiconf = dahdic.confno;