From 8ae7ae6c0b017cd0829aeba578c9e23ba61bb916 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Thu, 1 Apr 2010 08:15:01 +0200 Subject: [PATCH] chan_dect: set cause on error in dect_request_call() Signed-off-by: Patrick McHardy --- channels/chan_dect.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/channels/chan_dect.c b/channels/chan_dect.c index 1ae8ef047..c4a559d2f 100644 --- a/channels/chan_dect.c +++ b/channels/chan_dect.c @@ -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; }