diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-25 21:55:23 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-25 21:55:23 +0000 |
commit | 5c0d8c8559331452eaab2fe3d2dcef19bcbcb294 (patch) | |
tree | 88de3a6a86b0639e267444dcd4fc8d7d4cd95126 | |
parent | 02c3fe1f1d007d5c54f94e7752f591eeab340424 (diff) |
If the callerid= option is specified, but empty, clear any previous data.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@61866 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_iax2.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 8cf91cdd8..cd2e183aa 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)); |