aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-05 21:38:29 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-05 21:38:29 +0000
commit03ad7e8e74040d42b150af0131fa4b21745f1b31 (patch)
tree6a09652fd06464c7a431b346ce66a7f70b922b95
parent73c2195480f1a34d6bd42e78b1bb52ba2c0ac5fb (diff)
Merged revisions 135748 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r135748 | tilghman | 2008-08-05 16:37:35 -0500 (Tue, 05 Aug 2008) | 17 lines Merged revisions 135747 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r135747 | tilghman | 2008-08-05 16:34:46 -0500 (Tue, 05 Aug 2008) | 9 lines In a conversion to use ast_strlen_zero, the meaning of the flag IAX_HASCALLERID was perverted. This change reverts IAX2 to the original meaning, which was, that the callerid set on the client should be overridden on the server, even if that means the resulting callerid is blank. In other words, if you set "callerid=" in the IAX config, then the callerid should be overridden to blank, even if set on the client. Note that there's a distinction, even on realtime, between the field not existing (NULL in databases) and the field existing, but set to blank (override callerid to blank). ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@135749 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_iax2.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 43c00f2c4..6794b2ddc 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -10395,33 +10395,20 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st
if (!ast_strlen_zero(v->value)) {
char name2[80];
char num2[80];
- ast_callerid_split(v->value, name2, 80, num2, 80);
+ ast_callerid_split(v->value, name2, sizeof(name2), num2, sizeof(num2));
ast_string_field_set(peer, cid_name, name2);
ast_string_field_set(peer, cid_num, num2);
- ast_set_flag(peer, IAX_HASCALLERID);
} else {
- ast_clear_flag(peer, IAX_HASCALLERID);
ast_string_field_set(peer, cid_name, "");
ast_string_field_set(peer, cid_num, "");
}
+ ast_set_flag(peer, IAX_HASCALLERID);
} else if (!strcasecmp(v->name, "fullname")) {
- if (!ast_strlen_zero(v->value)) {
- ast_string_field_set(peer, cid_name, v->value);
- ast_set_flag(peer, IAX_HASCALLERID);
- } else {
- ast_string_field_set(peer, cid_name, "");
- if (ast_strlen_zero(peer->cid_num))
- ast_clear_flag(peer, IAX_HASCALLERID);
- }
+ ast_string_field_set(peer, cid_name, S_OR(v->value, ""));
+ ast_set_flag(peer, IAX_HASCALLERID);
} else if (!strcasecmp(v->name, "cid_number")) {
- if (!ast_strlen_zero(v->value)) {
- ast_string_field_set(peer, cid_num, v->value);
- ast_set_flag(peer, IAX_HASCALLERID);
- } else {
- ast_string_field_set(peer, cid_num, "");
- if (ast_strlen_zero(peer->cid_name))
- ast_clear_flag(peer, IAX_HASCALLERID);
- }
+ ast_string_field_set(peer, cid_num, S_OR(v->value, ""));
+ ast_set_flag(peer, IAX_HASCALLERID);
} else if (!strcasecmp(v->name, "sendani")) {
ast_set2_flag(peer, ast_true(v->value), IAX_SENDANI);
} else if (!strcasecmp(v->name, "inkeys")) {