*/
static struct ast_conference *build_conf(const char *confno, const char *pin,
const char *pinadmin, int make, int dynamic, int refcount,
- const struct ast_channel *chan)
+ const struct ast_channel *chan, struct ast_test *test)
{
struct ast_conference *cnf;
struct dahdi_confinfo dahdic = { 0, };
dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
cnf->fd = open("/dev/dahdi/pseudo", O_RDWR);
if (cnf->fd < 0 || ioctl(cnf->fd, DAHDI_SETCONF, &dahdic)) {
+ if (test) {
+ ast_test_status_update(test, "Unable to open pseudo device\n");
+ }
ast_log(LOG_WARNING, "Unable to open pseudo device\n");
if (cnf->fd >= 0)
close(cnf->fd);
dahdic.confno = cnf->dahdiconf;
dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
if (ioctl(cnf->chan->fds[0], DAHDI_SETCONF, &dahdic)) {
+ if (test) {
+ ast_test_status_update(test, "Error setting conference on pseudo channel\n");
+ }
ast_log(LOG_WARNING, "Error setting conference\n");
if (cnf->chan)
ast_hangup(cnf->chan);
ast_variables_destroy(origvar);
- cnf = build_conf(confno, pin ? pin : "", pinadmin ? pinadmin : "", make, dynamic, refcount, chan);
+ cnf = build_conf(confno, pin ? pin : "", pinadmin ? pinadmin : "", make, dynamic, refcount, chan, NULL);
if (cnf) {
cnf->maxusers = maxusers;
if (ast_app_getdata(chan, "conf-getpin", dynamic_pin, pin_buf_len - 1, 0) < 0)
return NULL;
}
- cnf = build_conf(confno, dynamic_pin, "", make, dynamic, refcount, chan);
+ cnf = build_conf(confno, dynamic_pin, "", make, dynamic, refcount, chan, NULL);
} else {
- cnf = build_conf(confno, "", "", make, dynamic, refcount, chan);
+ cnf = build_conf(confno, "", "", make, dynamic, refcount, chan, NULL);
}
} else {
/* Check the config */
cnf = build_conf(args.confno,
S_OR(args.pin, ""),
S_OR(args.pinadmin, ""),
- make, dynamic, refcount, chan);
+ make, dynamic, refcount, chan, NULL);
break;
}
}
ast_set_flag64(&conf_flags,
CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_PASS_DTMF | CONFFLAG_SLA_STATION);
answer_trunk_chan(trunk_ref->chan);
- conf = build_conf(ast_str_buffer(conf_name), "", "", 0, 0, 1, trunk_ref->chan);
+ conf = build_conf(ast_str_buffer(conf_name), "", "", 0, 0, 1, trunk_ref->chan, NULL);
if (conf) {
conf_run(trunk_ref->chan, conf, &conf_flags, NULL);
dispose_conf(conf);
ast_set_flag64(&conf_flags,
CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_MARKEDUSER |
CONFFLAG_PASS_DTMF | CONFFLAG_SLA_TRUNK);
- conf = build_conf(conf_name, "", "", 1, 1, 1, trunk_ref->trunk->chan);
+ conf = build_conf(conf_name, "", "", 1, 1, 1, trunk_ref->trunk->chan, NULL);
ast_mutex_lock(args->cond_lock);
ast_cond_signal(args->cond);
ast_set_flag64(&conf_flags,
CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_PASS_DTMF | CONFFLAG_SLA_STATION);
ast_answer(chan);
- conf = build_conf(conf_name, "", "", 0, 0, 1, chan);
+ conf = build_conf(conf_name, "", "", 0, 0, 1, chan, NULL);
if (conf) {
conf_run(chan, conf, &conf_flags, NULL);
dispose_conf(conf);
}
snprintf(conf_name, sizeof(conf_name), "SLA_%s", args.trunk_name);
- conf = build_conf(conf_name, "", "", 1, 1, 1, chan);
+ conf = build_conf(conf_name, "", "", 1, 1, 1, chan, NULL);
if (!conf) {
pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "FAILURE");
ast_atomic_fetchadd_int((int *) &trunk->ref_count, -1);
return AST_TEST_FAIL;
}
- cnf = build_conf("9898", "", "1234", 1, 1, 1, chan);
+ cnf = build_conf("9898", "", "1234", 1, 1, 1, chan, test);
if (!cnf) {
ast_test_status_update(test, "Build of test conference 9898 failed\n");
ast_hangup(chan);
dispose_conf(cnf);
ast_hangup(chan);
- ast_test_status_update(test, "If this message prints and a failure is still recorded, then something is really wrong with the test framework\n");
return AST_TEST_PASS;
}
#endif