Capture one object identity and observation timeline
Preserve timestamp and timezone, installed Asterisk branch and package, exact PJSIP object type and ID, owning module, expected source, Sorcery section and mapping order, Realtime family, driver and connection name, redacted schema key, cache name and policy, last database change, reload or restart boundary, module-specific CLI output and final symptom. Include a known-good object from the same intended path.
Classify the symptom as absent mapping, wrong owning section, unavailable driver or connection, missing table or column, absent row, invalid row, duplicate static object, wrong source order, stale cache, incomplete full-set cache, unsupported object type, reload boundary or later PJSIP behavior. Do not edit the row before this evidence is preserved.
Walk from Sorcery type to the exact database owner
Match the object type to the correct Sorcery configuration section; optional PJSIP modules can own mappings outside the base res_pjsip section. Then follow the selected wizard and family into extconfig.conf, the Realtime driver and connection name, res_odbc.conf, the system DSN, driver, database account and target table.
Confirm the required modules are packaged and loaded before interpreting a blank PJSIP listing as a missing row. A connected ODBC resource proves neither the family mapping nor the selected table, and a successful direct SQL query proves neither Asterisk permissions nor Sorcery retrieval.
Separate row existence from object validity and selection
Inspect one redacted row by its exact ID and compare columns with the schema revision for the installed branch. Distinguish missing table or column, null and blank values, type or enumeration validation, truncation, case mismatch, duplicate IDs and related-object references. Preserve database error classes without copying credentials or secret values.
Next compare static and Realtime sources in Sorcery order. A valid row can remain unused when an earlier mapping supplies the same ID, while a later source may be consulted only after the earlier source has no object. Do not delete a static object or reorder all mappings merely to test a hypothesis.
Prove whether cache owns the stale observation
Record whether the object type has a memory cache, its position before the Realtime wizard, configured lifetime, stale time, maximum, reload expiry and full-backend mode. Compare the database modification time, cache observation time and module-specific CLI view. A backend change does not automatically invalidate an indefinitely retained cache entry.
Use a narrowly scoped, approved cache expire, stale or populate action only after the mapping and backend row are known. For object types commonly retrieved as a set, distinguish an incomplete per-object cache from a full-backend cache. A refreshed cache that still shows the wrong object points back to source order, schema or the record itself.
Investigate schema drift and database availability safely
When retrieval errors follow an upgrade, compare the installed branch, Alembic revision, table definition and applicable CHANGES and UPGRADE material. Asterisk warns that cross-series schema migrations can lose data; take a verified backup and use the branch-matched migration path rather than hand-adding one column during an incident.
For intermittent absence, separate connection establishment, pool capacity, authentication, network path, database listener, query latency, lock wait and server failover. Retain an unaffected Realtime object as a control. Do not broaden database access or replace the service account with an administrator credential to make the diagnostic pass.
Correct one owner and verify the intended PJSIP behavior
Correct only the first proved divergence: owning Sorcery section, mapping order, family, connector, DSN, module load order, schema revision, row value, duplicate source or cache policy. Preserve the prior configuration, database backup, rollback trigger and cache impact.
Re-read the object through Sorcery and the PJSIP CLI, then test the behavior it is meant to supply: request identification, authentication, AoR association, contact binding, registration or one bounded call. Keep those results separate and repeat the known-good control. No host, connector, database, row, cache, endpoint, registration, message or live call was inspected or tested for this diagnostic.
Sources & applicability
Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.
- Asterisk Realtime database configuration ↗
- Asterisk setting up PJSIP Realtime ↗
- Asterisk Sorcery overview and mapping ↗
- Asterisk Sorcery caching ↗
- Asterisk Realtime schema management with Alembic ↗
- Asterisk PJSIP troubleshooting guide ↗
- Asterisk extconfig.conf sample ↗
- Asterisk sorcery.conf sample ↗
Examples require adaptation to your topology. No live PBX or hardware testing is claimed.