Pjsip error with asterisk14.3.1

vps*CLI> module load res_pjsip.so
I used this documentation https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime to configure realtime for pjsip agent/channel but could not get pass this error even after reading several documents. I would appreciate any help that could point me in the right direction toward solving this issue
Unable to load module res_pjsip.so
Command ‘module load res_pjsip.so’ failed.
== Parsing ‘/etc/asterisk/sorcery.conf’: Found
[May 2 13:15:47] WARNING[2582]: sorcery.c:1014 __ast_sorcery_insert_wizard_mapping: Wizard ‘realtime’ failed to open mapping for object type ‘endpoint’ with data: ps_endpoints
[May 2 13:15:47] ERROR[2582]: sorcery.c:787 __ast_sorcery_open: Error attempting to apply configuration res_pjsip to sorcery.
[May 2 13:15:47] ERROR[2582]: res_pjsip/config_system.c:157 ast_sip_initialize_system: Failed to open SIP system sorcery
[May 2 13:15:47] ERROR[2582]: res_pjsip.c:4509 load_module: Failed to initialize SIP ‘system’ configuration section. Aborting load

What are the contents of sorcery.conf and extconfig.conf? Did you restart Asterisk after making changes?

Yes, restarted Asterisk.
below are the content of both sorcery.conf and extconfig.conf respectively:
sorcery.conf
cat /etc/asterisk/sorcery.conf
; Sample configuration file for Sorcery Data Access Layer

;
; Wizards
;
; Wizards are the persistence mechanism for objects. They are loaded as Asterisk modules and register
; themselves with the sorcery core. All implementation specific details of how objects are persisted is isolated
; within wizards.
;

;
; Caching
;
; A wizard can optionally be marked as an object cache by adding “/cache” to the object type within the mapping.
; If an object is returned from a non-object cache it is immediately given to the cache to be created. Multiple
; object caches can be configured for a single object type.
;

;
; Object Type Mappings
;
; To allow configuration of where and how an object is persisted object mappings can be defined within this file
; on a per-module basis. The mapping consists of the object type, options, wizard name, and wizard configuration
; data. This has the following format:
;
; object type [/options] = wizard name, wizard configuration data
;
; For example to configure an in-memory wizard for the ‘bob’ object type:
;
; bob = memory
;
; Or to configure the object type ‘joe’ from a configuration file:
;
; joe = config,joe.conf
;
; Note that an object type can have multiple mappings defined. Each mapping will be consulted in the order in which
; it appears within the configuration file. This means that if you are configuring a wizard as a cache it should
; appear as the first mapping so the cache is consulted before all other mappings.
;

;
; The following object mappings are used by the unit test to test certain functionality of sorcery.
;
[test_sorcery_section]
test=memory

[test_sorcery_cache]
test/cache=test
test=memory

;
; The following object mapping is the default mapping of external MWI mailbox
; objects to give persistence to the message counts.
;
;[res_mwi_external]
;mailboxes=astdb,mwi_external

;
; The following object mappings set PJSIP objects to use realtime database mappings from extconfig
; with the table names used when automatically generating configuration from the alembic script.
;
;[res_pjsip]
;endpoint=realtime,ps_endpoints
;auth=realtime,ps_auths
;aor=realtime,ps_aors
;domain_alias=realtime,ps_domain_aliases
;identify=realtime,ps_endpoint_id_ips
;
[res_pjsip] ; Realtime PJSIP configuration wizard
endpoint/cache=memory_cache,maximum_objects=150,expire_on_reload=yes,object_lifetime_maximum=3600
endpoint=realtime,ps_endpoints
auth=realtime,ps_auths
aor=realtime,ps_aors
domain_alias=realtime,ps_domain_aliases
contact=realtime,ps_contacts
transport=realtime,ps_transports

endpoint=realtime,ps_endpoints
endpoint=config,pjsip.conf,criteria=type=endpoint

[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips
identity=config,pjsip.conf,criteria=type=identity

[res_pjsip_outbound_registration]
registration=realtime,ps_registration

extconfig.conf

cat /etc/asterisk/extconfig.conf
;
; Static and realtime external configuration
; engine configuration
;
; See https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration
; for basic table formatting information.
;
[settings]
;
; Static configuration files:
;
; file.conf => driver,database[,table[,priority]]
;
; maps a particular configuration file to the given
; database driver, database and table (or uses the
; name of the file as the table if not specified)
;
; Uncomment to load queues.conf via the odbc engine.
;
;queues.conf => odbc,asterisk,ast_config
;extensions.conf => sqlite,asterisk,ast_config
;
; The following files CANNOT be loaded from Realtime storage:
; asterisk.conf
; extconfig.conf (this file)
; logger.conf
;
; Additionally, the following files cannot be loaded from
; Realtime storage unless the storage driver is loaded
; early using ‘preload’ statements in modules.conf:
; manager.conf
; cdr.conf
; rtp.conf
;
; Named ACLs specified in realtime also can not be used
; from manager.conf unless the storage driver is preloaded.
; Attempting to use a realtime stored named ACL before the
; driver is loaded will result in an invalid ACL which
; rejects all addresses.
;
; Realtime configuration engine
;
; maps a particular family of realtime
; configuration to a given database driver,
; database and table (or uses the name of
; the family if the table is not specified
;
;example => odbc,asterisk,alttable,1
;example => mysql,asterisk,alttable,2
;example2 => ldap,“dc=oxymium,dc=net”,example2
;
; Additionally, priorities are now supported for use as failover methods
; for retrieving realtime data. If one connection fails to retrieve any
; information, the next sequential priority will be tried next. This
; especially works well with ODBC connections, since res_odbc now caches
; when connection failures occur and prevents immediately retrying those
; connections until after a specified timeout. Note: priorities must
; start at 1 and be sequential (i.e. if you have only priorities 1, 2,
; and 4, then 4 will be ignored, because there is no 3).
;
;
; Possible driver backends:
;
; “odbc” is shown in the examples below, but is not the only valid realtime
; engine. Here are several of the possible options:
; odbc … res_config_odbc
; sqlite … res_config_sqlite
; sqlite3 … res_config_sqlite3
; pgsql … res_config_pgsql
; curl … res_config_curl
; ldap … res_config_ldap
; mysql … res_config_mysql (available via add-ons in menuselect)
;
; Note: The res_config_pgsql and res_config_sqlite backends configure the
; database used in their respective configuration files and ignore the
; database name configured in this file.
;
;iaxusers => odbc,asterisk
;iaxpeers => odbc,asterisk
;sippeers => odbc,asterisk
;sipregs => odbc,asterisk ; (avoid sipregs if possible, e.g. by using a view)
;ps_endpoints => odbc,asterisk
;ps_auths => odbc,asterisk
;ps_aors => odbc,asterisk
;ps_domain_aliases => odbc,asterisk
;ps_endpoint_id_ips => odbc,asterisk
;voicemail => odbc,asterisk
;extensions => odbc,asterisk
;meetme => mysql,general
;queues => odbc,asterisk
;queue_members => odbc,asterisk
;queue_rules => odbc,asterisk
;acls => odbc,asterisk
;musiconhold => mysql,general
;queue_log => mysql,general
;
;
; While most dynamic realtime engines are automatically used when defined in
; this file, ‘extensions’, distinctively, is not. To activate dynamic realtime
; extensions, you must turn them on in each respective context within
; extensions.conf with a switch statement. The syntax is:
; switch => Realtime/[[db_context@]tablename]/
; The only option available currently is the ‘p’ option, which disallows
; extension pattern queries to the database. If you have no patterns defined
; in a particular context, this will save quite a bit of CPU time. However,
; note that using dynamic realtime extensions is not recommended anymore as a
; best practice; instead, you should consider writing a static dialplan with
; proper data abstraction via a tool like func_odbc.
;
[settings]
ps_endpoints => odbc,asterisk
ps_auths => odbc,asterisk
ps_aors => odbc,asterisk
ps_domain_aliases => odbc,asterisk
ps_endpoint_id_ips => odbc,asterisk
ps_contacts => odbc,asterisk
ps_registrations => odbc,asterisk
ps_transports => odbc,asterisk

You have two “[settings]” categories. One is empty, one is not. I’d suggest removing the empty one.

Thank you jcoip, it’s resolved now by uncommenting the empty “[settings]”.