mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
SIP display-name needed to be empty for Avaya IP500
In order to address a compatability issue with certain features on certain devices which rely on display name content to change behavior, initreqprep in chan_sip.c has been changed to no longer substitute cid_number into the display name when cid_name isn't present. Instead, it will send no display name in that case. (closes issue ASTERISK-16198) Reported by: Walter Doekes Review: https://reviewboard.asterisk.org/r/1341/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
11
CHANGES
11
CHANGES
@@ -8,6 +8,17 @@
|
|||||||
===
|
===
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
--- Functionality changes from Asterisk 10 to Asterisk 11 --------------------
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
SIP Changes
|
||||||
|
-----------
|
||||||
|
* Asterisk will no longer substitute CID number for CID name into display
|
||||||
|
name field if CID number exists without a CID name. This change improves
|
||||||
|
compatibility with certain device features such as Avaya IP500's directory
|
||||||
|
lookup service.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
--- Functionality changes from Asterisk 1.8 to Asterisk 10 -------------------
|
--- Functionality changes from Asterisk 1.8 to Asterisk 10 -------------------
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -11792,6 +11792,8 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
|
|||||||
const char *d = NULL; /* domain in from header */
|
const char *d = NULL; /* domain in from header */
|
||||||
const char *urioptions = "";
|
const char *urioptions = "";
|
||||||
int ourport;
|
int ourport;
|
||||||
|
int cid_has_name = 1;
|
||||||
|
int cid_has_num = 1;
|
||||||
|
|
||||||
if (ast_test_flag(&p->flags[0], SIP_USEREQPHONE)) {
|
if (ast_test_flag(&p->flags[0], SIP_USEREQPHONE)) {
|
||||||
const char *s = p->username; /* being a string field, cannot be NULL */
|
const char *s = p->username; /* being a string field, cannot be NULL */
|
||||||
@@ -11838,10 +11840,15 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
|
|||||||
l = p->mwi_from;
|
l = p->mwi_from;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ast_strlen_zero(l))
|
if (ast_strlen_zero(l)) {
|
||||||
|
cid_has_num = 0;
|
||||||
l = default_callerid;
|
l = default_callerid;
|
||||||
if (ast_strlen_zero(n))
|
}
|
||||||
|
if (ast_strlen_zero(n)) {
|
||||||
|
cid_has_name = 0;
|
||||||
n = l;
|
n = l;
|
||||||
|
}
|
||||||
|
|
||||||
/* Allow user to be overridden */
|
/* Allow user to be overridden */
|
||||||
if (!ast_strlen_zero(p->fromuser))
|
if (!ast_strlen_zero(p->fromuser))
|
||||||
l = p->fromuser;
|
l = p->fromuser;
|
||||||
@@ -11862,10 +11869,20 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
|
|||||||
}
|
}
|
||||||
|
|
||||||
ourport = (p->fromdomainport) ? p->fromdomainport : ast_sockaddr_port(&p->ourip);
|
ourport = (p->fromdomainport) ? p->fromdomainport : ast_sockaddr_port(&p->ourip);
|
||||||
if (!sip_standard_port(p->socket.type, ourport)) {
|
|
||||||
snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s:%d>;tag=%s", n, l, d, ourport, p->tag);
|
/* If a caller id name was specified, add a display name. */
|
||||||
|
if (cid_has_name || !cid_has_num) {
|
||||||
|
snprintf(from, sizeof(from), "\"%s\" ", n);
|
||||||
} else {
|
} else {
|
||||||
snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s>;tag=%s", n, l, d, p->tag);
|
from[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sip_standard_port(p->socket.type, ourport)) {
|
||||||
|
size_t offset = strlen(from);
|
||||||
|
snprintf(&from[offset], sizeof(from) - offset, "<sip:%s@%s:%d>;tag=%s", l, d, ourport, p->tag);
|
||||||
|
} else {
|
||||||
|
size_t offset = strlen(from);
|
||||||
|
snprintf(&from[offset], sizeof(from) - offset, "<sip:%s@%s>;tag=%s", l, d, p->tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ast_strlen_zero(explicit_uri)) {
|
if (!ast_strlen_zero(explicit_uri)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user