From: Russell Bryant Date: Wed, 25 Apr 2007 21:55:23 +0000 (+0000) Subject: If the callerid= option is specified, but empty, clear any previous data. X-Git-Tag: 1.2.19~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc604c9e9a131b6943f5badef0a8c0c854679661;p=thirdparty%2Fasterisk.git If the callerid= option is specified, but empty, clear any previous data. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@61866 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 8cf91cdd82..cd2e183aa5 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -8416,6 +8416,10 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, in ast_callerid_split(v->value, peer->cid_name, sizeof(peer->cid_name), peer->cid_num, sizeof(peer->cid_num)); ast_set_flag(peer, IAX_HASCALLERID); + } else { + ast_clear_flag(peer, IAX_HASCALLERID); + peer->cid_name[0] = '\0'; + peer->cid_num[0] = '\0'; } } else if (!strcasecmp(v->name, "sendani")) { ast_set2_flag(peer, ast_true(v->value), IAX_SENDANI); @@ -8582,6 +8586,10 @@ static struct iax2_user *build_user(const char *name, struct ast_variable *v, in if (!ast_strlen_zero(v->value)) { ast_callerid_split(v->value, user->cid_name, sizeof(user->cid_name), user->cid_num, sizeof(user->cid_num)); ast_set_flag(user, IAX_HASCALLERID); + } else { + ast_clear_flag(user, IAX_HASCALLERID); + user->cid_name[0] = '\0'; + user->cid_num[0] = '\0'; } } else if (!strcasecmp(v->name, "accountcode")) { ast_copy_string(user->accountcode, v->value, sizeof(user->accountcode));