Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 206802) +++ channels/chan_dahdi.c (working copy) @@ -11296,7 +11296,7 @@ if (roundrobin) round_robin[x] = p; #if 0 - ast_verbose("name = %s, %d, %d, %d\n",p->owner ? p->owner->name : "", p->channel, channelmatch, groupmatch); + ast_verbose("name = %s, %d, %d, %llu\n",p->owner ? p->owner->name : "", p->channel, channelmatch, groupmatch); #endif if (p && available(p, channelmatch, groupmatch, &unavailreason, &channelmatched, &groupmatched)) { @@ -11322,12 +11322,6 @@ break; } } - if (p->owner) { - if (alloc_sub(p, SUB_CALLWAIT)) { - p = NULL; - break; - } - } p->outgoing = 1; if (analog_lib_handles(p->sig, p->radio, p->oprmode)) { tmp = analog_request(p->sig_pvt, &callwait, requestor); Index: channels/sig_analog.c =================================================================== --- channels/sig_analog.c (revision 206802) +++ channels/sig_analog.c (working copy) @@ -289,9 +289,13 @@ static int analog_alloc_sub(struct analog_pvt *p, enum analog_sub x) { - p->subs[x].allocd = 1; - if (p->calls->allocate_sub) - return p->calls->allocate_sub(p->chan_pvt, x); + if (p->calls->allocate_sub) { + int res; + res = p->calls->allocate_sub(p->chan_pvt, x); + if (!res) + p->subs[x].allocd = 1; + return res; + } return 0; }