]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
If the callerid= option is specified, but empty, clear any previous data.
authorRussell Bryant <russell@russellbryant.com>
Wed, 25 Apr 2007 21:55:23 +0000 (21:55 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 25 Apr 2007 21:55:23 +0000 (21:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@61866 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 8cf91cdd82369d24491ab8afeb1b9e2279e1d351..cd2e183aa5b3c011f84119d1830b82758eb0b727 100644 (file)
@@ -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));