583
583
struct ast_channel *tmp = NULL, *tmp2 = NULL;
584
584
int randnum = ast_random() & 0xffff, fmt = 0;
586
588
/* Allocate two new Asterisk channels */
587
if (!(tmp = ast_channel_alloc(1, state, 0, 0, "", p->exten, p->context, 0, "Local/%s@%s-%04x,1", p->exten, p->context, randnum))
588
|| !(tmp2 = ast_channel_alloc(1, AST_STATE_RING, 0, 0, "", p->exten, p->context, 0, "Local/%s@%s-%04x,2", p->exten, p->context, randnum))) {
589
/* safe accountcode */
590
if (p->owner && p->owner->accountcode)
591
t = p->owner->accountcode;
596
ama = p->owner->amaflags;
599
if (!(tmp = ast_channel_alloc(1, state, 0, 0, t, p->exten, p->context, ama, "Local/%s@%s-%04x,1", p->exten, p->context, randnum))
600
|| !(tmp2 = ast_channel_alloc(1, AST_STATE_RING, 0, 0, t, p->exten, p->context, ama, "Local/%s@%s-%04x,2", p->exten, p->context, randnum))) {
590
602
ast_channel_free(tmp);