]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
- Fix cause codes
authorOlle Johansson <oej@edvina.net>
Fri, 7 Apr 2006 14:16:41 +0000 (14:16 +0000)
committerOlle Johansson <oej@edvina.net>
Fri, 7 Apr 2006 14:16:41 +0000 (14:16 +0000)
- Add cause code for incompatible formats

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@18260 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 6df70ebfccd9d4d0d6cd246c93f2c5fda1d3ad5c..91ff4ff6b2123fedd9db2e1db9d0e2a247d6c7f8 100644 (file)
@@ -11548,12 +11548,13 @@ static struct ast_channel *sip_request_call(const char *type, int format, void *
        format &= ((AST_FORMAT_MAX_AUDIO << 1) - 1);
        if (!format) {
                ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format %s while capability is %s\n", ast_getformatname(oldformat), ast_getformatname(global_capability));
+               *cause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;   /* Can't find codec to connect to host */
                return NULL;
        }
        p = sip_alloc(NULL, NULL, 0, SIP_INVITE);
        if (!p) {
                ast_log(LOG_ERROR, "Unable to build sip pvt data for '%s' (Out of memory)\n", (char *)data);
-               *cause = AST_CAUSE_CONGESTION;
+               *cause = AST_CAUSE_SWITCH_CONGESTION;
                return NULL;
        }
 
@@ -11561,7 +11562,7 @@ static struct ast_channel *sip_request_call(const char *type, int format, void *
        if (!p->options) {
                sip_destroy(p);
                ast_log(LOG_ERROR, "Unable to build option SIP data structure - Out of memory\n");
-               *cause = AST_CAUSE_CONGESTION;
+               *cause = AST_CAUSE_SWITCH_CONGESTION;
                return NULL;
        }