diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-01-31 22:59:34 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-01-31 22:59:34 +0000 |
commit | 12027faac4320a94e05e00a2237f4e3bce17d27c (patch) | |
tree | 0307513c239810317fd4ad1ffb854aa2c7ce15fb /channels | |
parent | c93bf5796d1446e6781379cf1a2565ba503e9777 (diff) |
Merged revisions 305252 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r305252 | qwell | 2011-01-31 16:56:54 -0600 (Mon, 31 Jan 2011) | 10 lines
Prevent a crash when dialing a technology with no destination (ex: Dial(SIP/))
chan_iax2 and other channel drivers already had code to prevent this. The
attempt that app_dial was making to prevent it was not correct, so I fixed that.
(closes issue #18371)
Reported by: gbour
Patches:
18371.patch uploaded by gbour (license 1162)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@305253 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index dce6f5ba5..03b021ae4 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -23611,6 +23611,12 @@ static struct ast_channel *sip_request_call(const char *type, int format, void * } ast_debug(1, "Asked to create a SIP channel with formats: %s\n", ast_getformatname_multiple(tmp, sizeof(tmp), oldformat)); + if (ast_strlen_zero(dest)) { + ast_log(LOG_ERROR, "Unable to create channel with empty destination.\n"); + *cause = AST_CAUSE_CHANNEL_UNACCEPTABLE; + return NULL; + } + if (!(p = sip_alloc(NULL, NULL, 0, SIP_INVITE, NULL))) { ast_log(LOG_ERROR, "Unable to build sip pvt data for '%s' (Out of memory or socket error)\n", dest); *cause = AST_CAUSE_SWITCH_CONGESTION; |