dect
/
asterisk
Archived
13
0
Fork 0

chan_dect: set cause on error in dect_request_call()

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2010-04-01 08:15:01 +02:00
parent 6b6447bdb4
commit 8ae7ae6c0b
1 changed files with 7 additions and 2 deletions

View File

@ -426,19 +426,24 @@ static struct ast_channel *dect_request_call(const char *type, format_t format,
pt = dect_pt_get_by_name(name);
if (pt == NULL) {
ast_log(LOG_NOTICE, "Call to unknown PT '%s' requested\n", name);
*cause = AST_CAUSE_UNALLOCATED;
return NULL;
}
call = dect_call_alloc(dh);
if (call == NULL)
if (call == NULL) {
*cause = AST_CAUSE_SWITCH_CONGESTION;
return NULL;
}
pvt = dect_call_priv(call);
ast_log(LOG_NOTICE, "Outgoing call to %s\n", pt->name);
pvt->pt = pt;
pvt->call = call;
if (dect_init_call(pvt, AST_STATE_RESERVED, NULL) < 0)
if (dect_init_call(pvt, AST_STATE_RESERVED, NULL) < 0) {
*cause = AST_CAUSE_SWITCH_CONGESTION;
return NULL;
}
return pvt->chan;
}