SIP Phone Wrong Time and Caller Name: Fleet-Wide Fixes
A sip phone wrong time and caller name problem is fixed in two places: NTP, time zone, DST and format in the provisioning template, and a name that the PBX sends in the From or P-Asserted-Identity header and the phone can display.
- Fix time in three parts: a reachable NTP server on UDP 123, an offset plus DST rule, and a separate date/time format setting.
- If the hour is wrong only part of the year, the DST rule is missing or wrong, not the offset.
- Read the INVITE with pjsip set logger on to see which name the PBX sent before you blame the phone.
- Carrier CNAM is a US/Canada database dip, not a SIP feature, so a missing external name is often not a PBX fault.
- Directory matches fail mostly on number format, so store numbers exactly as the trunk delivers them.
Where does a SIP phone wrong time and caller name problem come from?
A SIP phone wrong time and caller name problem looks like a phone fault, but each symptom has a chain of hops. The fault sits in the phone, the provisioning template, the PBX or the carrier, and checking in that order wastes time. Start at the hop closest to the symptom's source.
For time, the chain is NTP server, network (DHCP and firewall), phone time zone and DST rule, then display format. For names it is carrier, trunk, inbound route, extension, SIP headers, then the phone's own display rules and directory.
| Symptom | Most likely hop | First check |
|---|---|---|
| Time off by whole hours | Time zone offset or NTP unreachable | Phone status page: NTP server state and zone |
| Hour off only part of the year | DST rule | Summer time setting (auto vs off) |
| Time right, date format odd | Format setting | Date format and 12h/24h keys |
| Numbers on internal calls | Extension Display Name empty | pjsip show endpoint, then the INVITE From line |
| Numbers on external calls | Carrier or trunk | From and P-Asserted-Identity in the trace |
| Name in directory, not on ring screen | Number format mismatch | Compare trunk number to stored number |
How do I fix NTP so the phone gets the right time?
Phones with a bad clock usually never reached an NTP server. Voice VLANs often have DHCP scopes with no option 42, or an option 42 pointing to a server that is unreachable from that VLAN. Outbound UDP 123 must also be allowed by the firewall.
The robust fix is to set the server explicitly in provisioning (for example pool.ntp.org or an internal chrony server) and not depend on DHCP. An internal NTP server also removes the internet dependency and gives every phone the same source.
- From a host on the voice VLAN, test reachability, for example: ntpdate -q ntp.example.local or chronyc -h on the server side.
- Allow UDP 123 from the voice VLAN to the NTP server.
- Set DHCP option 42 on the voice scope, and also set the server in the provisioning template so a bad scope cannot break it.
- Reboot one phone and confirm on its status page that NTP synchronised.
# Yealink common template (y000000000000.cfg)
local_time.ntp_server1 = ntp.example.local
local_time.ntp_server2 = pool.ntp.org
local_time.interval = 1000
# Polycom (in a common config file)
tcpIpApp.sntp.address="ntp.example.local"
tcpIpApp.sntp.address.overrideDHCP="1"
# Grandstream (P-values)
P30 = ntp.example.localWhy is the hour wrong only in summer or winter?
Time zone has two parts: a base offset from UTC and a rule for daylight saving. A phone with the right offset but no DST rule is correct for half the year, then off by one hour after the clock change. A fixed offset in seconds, such as DHCP option 2, has no DST concept at all.
DHCP option 100 (POSIX TZ string) and option 101 (TZ database name) can carry full rules, but support across phone vendors is patchy and cannot be assumed. Treat them as a bonus and set zone and DST in the template, which every vendor honours.
| Vendor | Offset | DST | Date / time format |
|---|---|---|---|
| Yealink | local_time.time_zone (hours, e.g. -6) | local_time.summer_time (0 off, 1 on, 2 automatic) | local_time.date_format, local_time.time_format (0 = 12h, 1 = 24h) |
| Polycom | tcpIpApp.sntp.gmtOffset (seconds, e.g. -21600) | tcpIpApp.sntp.daylightSavings.* (start/stop month, week, day) | lcl.datetime.date.format, lcl.datetime.time.24HourClock |
| Grandstream | P64 (time zone string) | DST option in the Date/Time settings | Date display format in the same section |
| Fanvil | Time Zone in Time & Date | Enable DST and rule fields | Date and time format in the same page |
# Yealink: US Central with automatic DST
local_time.time_zone = -6
local_time.time_zone_name = United States-Central Time
local_time.summer_time = 2
local_time.date_format = 2
local_time.time_format = 1
# Polycom: US Central, 24h clock
tcpIpApp.sntp.gmtOffset="-21600"
tcpIpApp.sntp.daylightSavings.enable="1"
lcl.datetime.time.24HourClock="1"How do I push the settings to every phone and make them apply?
Put these keys in the common file, such as y000000000000.cfg for Yealink or the shared config for Polycom, not in per-MAC files. Per-MAC files override the common file, so one old per-MAC entry keeps a single phone wrong. A setting entered by hand on the phone's web UI can also override provisioning, depending on the vendor's override mode, so factory reset or clear the local override on the odd phone.
Phones read provisioning at boot, at a timed interval or when they receive a check-sync NOTIFY. Without a trigger, a template change reaches nobody until the next reboot.
- Edit the common template and confirm the file is served over HTTP(S) or TFTP.
- Define a notify option for your vendor if it is not in the sample file (pjsip_notify.conf on Asterisk, pjsip_notify_custom.conf on FreePBX).
- Send the NOTIFY to one phone, then to all of them.
- Confirm on the phone's status page that the values changed.
# pjsip_notify custom entry
[yealink-check-sync]
Event=>check-sync
Content-Length=>0
# reload and send to one endpoint
asterisk -rx "module reload res_pjsip_notify.so"
asterisk -rx "pjsip send notify yealink-check-sync endpoint 1001"
# all endpoints (loop)
for e in $(asterisk -rx 'pjsip list endpoints' | awk '/Endpoint:/ && $2 != "<Endpoint/" {print $2}' | cut -d/ -f1); do
asterisk -rx "pjsip send notify yealink-check-sync endpoint $e"
doneIs the PBX clock part of the problem?
Yes, in two ways. The PBX time zone governs CDR timestamps and time conditions, so a wrong server zone makes day/night routing switch at the wrong hour even when every phone is correct. Some phones can also take time from the SIP Date header or from the server, so a wrong PBX can leak into the desk phones.
Check the operating system first, then FreePBX, which keeps its own PHP time zone setting.
date
timedatectl
sudo timedatectl set-timezone America/Chicago
chronyc sources -v
chronyc tracking
# FreePBX: Settings > Advanced Settings > PHP Timezone
# then restart so Asterisk and PHP agree
fwconsole restartHow does the caller name reach the phone, and why does it show a number?
Inbound, the carrier sends a SIP INVITE. The phone shows a name from the From display name, or from P-Asserted-Identity or Remote-Party-ID if the PBX forwards them, and each phone model picks among them by its own rules. If the display name is empty, the phone falls back to the user part, which is the number.
A common mistake is the carrier putting the number in the name field, so the From line reads "15551234567" <sip:15551234567@carrier>. The phone shows exactly what it was given. For internal calls, an empty Display Name in the extension is the usual reason for numbers. Check Display Name, Outbound CID and Description separately: Display Name is what internal callers see, Outbound CID is what the trunk sends out.
- Run pjsip set logger on and place a call.
- Read the INVITE sent to the phone: From, P-Asserted-Identity and Remote-Party-ID lines.
- If the name is absent there, fix the PBX. If it is present and the phone shows a number, fix the phone's source preference.
- Fill the extension's Display Name and set the inbound route's CID name prefix if wanted.
; pjsip trunk (FreePBX: trunk advanced options Send/Trust RPID/PAI)
[carrier]
type=endpoint
send_pai=yes
trust_id_inbound=yes
trust_id_outbound=yes
; dialplan: force a name
exten => _X.,1,Set(CALLERID(name)=Sales Line)
; name path to check, in order
; carrier -> trunk -> inbound route -> extension -> INVITE to phone -> phone display rulesWhat does the carrier deliver as a name, and what can I look up?
Most SIP trunks do not carry a CNAM. In US and Canada, the terminating carrier does a CNAM database dip, and you often only see a name if you pay for the lookup, as an optional per-call or per-DID fee. Outbound, the name field is limited to about 15 characters in US CNAM, and the carrier usually overrides what the PBX sends. Many countries have no CNAM at all, so a number-only display there is normal and not a PBX fault.
When the carrier sends no name, FreePBX can look one up under Connectivity > CallerID Lookup Sources: OpenCNAM, a MySQL source or the internal address book (Contact Manager). Each lookup delays ringing, so a slow external source adds latency before the phone rings. Paid services charge per query, so prefer the local address book first and use caching where the source supports it.
How do I set up a shared directory so numbers show as names?
For a small static list, use a remote XML phonebook. For a large central directory that changes, use LDAP. In FreePBX, keep entries in Contact Manager and export in the vendor's phonebook format, or use an XML phonebook generator module. The phone must reach the server and, for LDAPS, trust its certificate.
The top reason for a failed match is number format. The trunk may deliver +15551234567 or 15551234567 while the directory holds 5551234567. Normalise on the trunk with dial plan rules, or store the numbers in the same form the trunk delivers. A phone matching incoming numbers against the phonebook only does an exact comparison, so one stray digit breaks it.
# Yealink remote phonebook
features.remote_phonebook.enable = 1
remote_phonebook.data.1.url = http://pbx.example.local/pb/yealink.xml
remote_phonebook.data.1.name = Company
# Yealink XML
<YealinkIPPhoneDirectory>
<DirectoryEntry>
<Name>Alice Smith</Name>
<Telephone>15551234567</Telephone>
</DirectoryEntry>
</YealinkIPPhoneDirectory>
# Grandstream phonebook.xml
<AddressBook>
<Contact>
<LastName>Smith</LastName><FirstName>Alice</FirstName>
<Phone><phonenumber>15551234567</phonenumber><accountindex>1</accountindex></Phone>
</Contact>
</AddressBook>
# Yealink LDAP
ldap.host = ldap.example.local
ldap.port = 636
ldap.tls_mode = 2
ldap.base = ou=people,dc=example,dc=local
ldap.user = cn=phonebook,dc=example,dc=local
ldap.password = secret
ldap.name_filter = (|(cn=%)(sn=%))
ldap.number_filter = (|(telephoneNumber=%)(mobile=%))
ldap.name_attr = cn sn
ldap.numb_attr = telephoneNumber mobile
ldap.display_name = %cn
ldap.incoming_call_special_search.enable = 1Common questions
Why does my phone show the right time but the wrong date format?
Time zone and display format are separate settings. Set the date format and 12h/24h keys in the common template, for example Yealink local_time.date_format and time_format or Polycom lcl.datetime.date.format.
Do all phones honour DHCP options 100 and 101 for the time zone?
No, support varies by vendor and firmware, and option 2 is a fixed offset with no DST. A provisioned zone and DST rule works on every phone and is the dependable choice.
Why is the caller name missing only on external calls?
The carrier probably sent no name, or only the number in the name field. Check the INVITE with pjsip set logger on, and remember CNAM is a paid database lookup in the US and Canada and unavailable in many countries.
Why does the directory show the name but the ring screen shows a number?
The incoming number does not match the stored one, most often due to a +1 or 1 prefix difference. Store numbers as the trunk delivers them, or normalise on the trunk, and enable incoming call lookup in the phone.
Can I change the name I send out on outbound calls?
You can set it in the PBX, but US CNAM is limited to about 15 characters and the carrier usually replaces it with its own database entry. Ask the carrier to register the name for your DIDs.