mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-25 06:00:36 +00:00
deal with no callerid name in all cases. really need to rethink this function
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -963,8 +963,12 @@ int setup_incoming_call(call_details_t cd)
|
|||||||
strncpy(p->context, alias->context, sizeof(p->context)-1);
|
strncpy(p->context, alias->context, sizeof(p->context)-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!strlen(p->cd.call_source_aliases))
|
||||||
|
sprintf(p->callerid, "Unknown Name <%s>", p->cd.call_source_e164);
|
||||||
|
else
|
||||||
sprintf(p->callerid, "%s <%s>", p->cd.call_source_aliases, p->cd.call_source_e164);
|
sprintf(p->callerid, "%s <%s>", p->cd.call_source_aliases, p->cd.call_source_e164);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* Either this call is not from the Gatekeeper
|
/* Either this call is not from the Gatekeeper
|
||||||
or we are not allowing gk routed calls */
|
or we are not allowing gk routed calls */
|
||||||
@@ -972,6 +976,9 @@ int setup_incoming_call(call_details_t cd)
|
|||||||
user = find_user(cd.call_source_aliases);
|
user = find_user(cd.call_source_aliases);
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
if (!strlen(p->cd.call_source_aliases))
|
||||||
|
sprintf(p->callerid, "Unknown Name <%s>", p->cd.call_source_e164);
|
||||||
|
else
|
||||||
sprintf(p->callerid, "%s <%s>", p->cd.call_source_aliases, p->cd.call_source_e164);
|
sprintf(p->callerid, "%s <%s>", p->cd.call_source_aliases, p->cd.call_source_e164);
|
||||||
if (strlen(p->cd.call_dest_e164)) {
|
if (strlen(p->cd.call_dest_e164)) {
|
||||||
strncpy(p->exten, cd.call_dest_e164, sizeof(p->exten)-1);
|
strncpy(p->exten, cd.call_dest_e164, sizeof(p->exten)-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user