diff -NaurbB old/chan_sip.c new/chan_sip.c --- old/chan_sip.c 2009-01-12 11:52:16.000000000 +0000 +++ new/chan_sip.c 2009-01-12 15:05:24.000000000 +0000 @@ -1781,6 +1781,7 @@ AST_STRING_FIELD(tohost); /*!< If not dynamic, IP address */ AST_STRING_FIELD(regexten); /*!< Extension to register (if regcontext is used) */ AST_STRING_FIELD(fromuser); /*!< From: user when calling this peer */ + AST_STRING_FIELD(fromname); /*!< From: display name when calling this peer */ AST_STRING_FIELD(fromdomain); /*!< From: domain when calling this peer */ AST_STRING_FIELD(fullcontact); /*!< Contact registered with us (not in sip.conf) */ AST_STRING_FIELD(cid_num); /*!< Caller ID num */ @@ -4709,6 +4710,8 @@ } if (!ast_strlen_zero(peer->fromuser)) ast_string_field_set(dialog, fromuser, peer->fromuser); + if (!ast_strlen_zero(peer->fromname)) + ast_string_field_set(dialog, fromname, peer->fromname); if (!ast_strlen_zero(peer->language)) ast_string_field_set(dialog, language, peer->language); /* Set timer T1 to RTT for this peer (if known by qualify=) */ @@ -9595,7 +9598,8 @@ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ";privacy=%s;screen=%s", privacy, screen); ast_string_field_set(p, rpid, buf); - ast_string_field_build(p, rpid_from, "\"%s\" ;tag=%s", clin, + ast_string_field_build(p, rpid_from, "\"%s\" ;tag=%s", + S_OR(p->fromname, clin), S_OR(p->fromuser, clid), fromdomain, p->tag); } @@ -9655,7 +9659,7 @@ else /* Save for any further attempts */ ast_string_field_set(p, fromuser, l); - /* Allow user to be overridden */ + /* Allow display name to be overridden */ if (!ast_strlen_zero(p->fromname)) n = p->fromname; else /* Save for any further attempts */ @@ -14061,6 +14065,8 @@ ast_cli(fd, " CallingPres : %s\n", ast_describe_caller_presentation(peer->callingpres)); if (!ast_strlen_zero(peer->fromuser)) ast_cli(fd, " FromUser : %s\n", peer->fromuser); + if (!ast_strlen_zero(peer->fromname)) + ast_cli(fd, " FromName : %s\n", peer->fromname); if (!ast_strlen_zero(peer->fromdomain)) ast_cli(fd, " FromDomain : %s\n", peer->fromdomain); ast_cli(fd, " Callgroup : "); @@ -14170,6 +14176,8 @@ astman_append(s, "CID-CallingPres: %s\r\n", ast_describe_caller_presentation(peer->callingpres)); if (!ast_strlen_zero(peer->fromuser)) astman_append(s, "SIP-FromUser: %s\r\n", peer->fromuser); + if (!ast_strlen_zero(peer->fromname)) + ast_cli(fd, "SIP-FromName: %s\r\n", peer->fromname); if (!ast_strlen_zero(peer->fromdomain)) astman_append(s, "SIP-FromDomain: %s\r\n", peer->fromdomain); astman_append(s, "Callgroup: "); @@ -21970,6 +21978,7 @@ ast_string_field_set(peer, cid_name, ""); ast_string_field_set(peer, fromdomain, ""); ast_string_field_set(peer, fromuser, ""); + ast_string_field_set(peer, fromname, ""); ast_string_field_set(peer, regexten, ""); peer->callgroup = 0; peer->pickupgroup = 0; @@ -22174,6 +22183,8 @@ ast_set2_flag(&peer->flags[0], ast_true(v->value), SIP_USEREQPHONE); } else if (!strcasecmp(v->name, "fromuser")) { ast_string_field_set(peer, fromuser, v->value); + } else if (!strcasecmp(v->name, "fromname")) { + ast_string_field_set(peer, fromname, v->value); } else if (!strcasecmp(v->name, "outboundproxy")) { char *port, *next, *force, *proxyname; int forceopt = FALSE;