Registration always shows "no objects found" with or without realtime odbc

Hi.

I have been having this issue for days and searched all over the internet but can’t seem to find any solution for it, so we have a asterisk running with odbc realtime and i already have “endpoint”, “auth” and “aor” in realtime and they are working perfectly fine but for some reasons registration never works, whenever i run this command pjsip show registrations i always get this message no objects found.

Here is my contents of /etc/asterisk/sorcery.conf

[test_sorcery_section]
test=memory

[test_sorcery_cache]
test/cache=test
test=memory

[res_pjsip]
endpoint=realtime,ps_endpoints
auth=realtime,ps_auths
aor=realtime,ps_aors

[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips

[res_pjsip_outbound_registration]
registration=realtime,ps_registrations

here is my contents of /etc/asterisk/extconfig.conf

[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

This is the command i ran to create registration on PostgreSQL.

insert into ps_registrations (
    id, outbound_auth, server_uri, client_uri
) values ('telnyx', 'telnyx', 'sip:sip.telnyx.com', 'sip:username123@sip.telnyx.com');

I can’t see any error messages or logs related to registration not working, I’m pretty new to asterisk so not sure if I’m doing something wrong in the configurations.

Asterisk version: 20.1.0
Running on docker debian with odbc and postgres

Your help would be highly appreciated.
Thank you.

You can find this problem even using configuration files, it happens to me using the configuration file procedure, If there is misconfiguration it won’t create the object. My advice that first create the PJSIP registration using static configuration file, once you got it working move that same configuration to the database, making sure your DB table schema is correct.

Thank you for your quick response, but i tried it with static configuration file and it still doesn’t work, i don’t know if sorcery.conf is not letting asterisk read from file or something, here’s what i have tried.

added this in pjsip.conf

[telnyx]
type=registration
outbound_auth=telnyx
server_uri=sip:sip.telnyx.com:5061
client_uri=sip:username123@sip.telnyx.com:5061

and removed this section from sorcery.conf

[res_pjsip_outbound_registration]
registration=realtime,ps_registrations

and also removed this line from extconfig.conf

ps_registrations => odbc,asterisk

As for maybe configuration of registration being wrong, i can’t see any logs that says anything related to registration, and i followed this registration section from documentation.

Is the res_pjsip_outbound_registration module loaded?

Hi jcolp

Thanks for the reply.

Yes, the module is loaded.
I ran this command module show like res_pjsip_outbound_registration and got this output:

Module                         Description                              Use Count  Status      Support Level
res_pjsip_outbound_registration.so PJSIP Outbound Registration Support      1          Running              core
1 modules loaded

Okay, did you restart Asterisk after changing sorcery configuration? Is there anything regarding outbound registrations when Asterisk starts in the log or console?

Yes, i did restart it by running this command core restart now.

After restart here are the logs of asterisk.

[Mar  9 10:14:12] WARNING[7]: loader.c:2398 load_modules: Some non-required modules failed to load.
[Mar  9 10:14:12] WARNING[7]: loader.c:2492 load_modules: Module 'res_monitor' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 21. Its replacement is 'app_mixmonitor'.
[Mar  9 10:14:12] WARNING[7]: loader.c:2492 load_modules: Module 'chan_skinny' has been loaded but was deprecated in Asterisk version 19 and will be removed in Asterisk version 21.
[Mar  9 10:14:12] WARNING[7]: loader.c:2492 load_modules: Module 'chan_mgcp' has been loaded but was deprecated in Asterisk version 19 and will be removed in Asterisk version 21.
[Mar  9 10:14:12] WARNING[7]: loader.c:2492 load_modules: Module 'res_adsi' has been loaded but may be removed in a future release.
[Mar  9 10:14:12] WARNING[7]: loader.c:2492 load_modules: Module 'app_adsiprog' has been loaded but may be removed in a future release.
[Mar  9 10:14:12] WARNING[7]: loader.c:2492 load_modules: Module 'app_macro' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 21. Its replacement is 'app_stack (GoSub)'.
[Mar  9 10:14:12] WARNING[7]: loader.c:2492 load_modules: Module 'app_osplookup' has been loaded but was deprecated in Asterisk version 19 and will be removed in Asterisk version 21.
[Mar  9 10:14:12] WARNING[7]: loader.c:2492 load_modules: Module 'app_getcpeid' has been loaded but may be removed in a future release.
[Mar  9 10:14:12] ERROR[7]: loader.c:2513 load_modules: res_pjsip_dialog_info_digium_body_supplement declined to load.
[Mar  9 10:14:12] ERROR[7]: loader.c:2513 load_modules: chan_mobile declined to load.
[Mar  9 10:14:12] ERROR[7]: loader.c:2513 load_modules: cel_tds declined to load.
[Mar  9 10:14:12] ERROR[7]: loader.c:2513 load_modules: cdr_tds declined to load.
[Mar  9 10:14:12] ERROR[7]: loader.c:2513 load_modules: res_corosync declined to load.

Also after a restart in a minute i always get this log as well.

[Mar  9 10:14:41] NOTICE[310]: res_pjsip/pjsip_transport_events.c:179 verify_log_result: Transport 'transport-tls' to remote 'sip.telnyx.com' - The certificate is untrusted
  == Endpoint telnyx is now Reachable
    -- Contact telnyx/sip:sip.telnyx.com:5061 is now Reachable.  RTT: 856.028 msec

But i suppose it’s not related to registration, i think aor.

The round trip time is excessive. If that happened to RTP, alll you users would be complaining.

Thank you for your reply David.

but I’m not sure i understand what you are referring to? are you talking about “RTT” time in the last log?

As i have said I’m pretty new to asterisk so don’t really know, what the purpose of it and what should be the ideal time and what will it effect? can you please share me resource or something where i can look at it? and fix the issue if i can.

Yes. RTT is round trip time.

Is it maybe because I’m running it behind docker by any chance?

I’ve no experience of docker, although I know that people think docker Asterisk is a bad candidate for docker, although I think that is for other reasons. I also know that a lot of people are using Asterisk on docker, although that may be biased towards people having problems.

I see, i have already planned to shift away asterisk from docker, when we are at certain stage where our trunk and peers and dialplans are working, currently our peer to peer communication and communication to outside world is working but i want to receive calls from my sip trunk, that’s why i have setup the registration but for some reason it’s not working and I’m stuck at this for days, as soon as it is resolved then i will have a full trunk working with all the configuration files, then i can build asterisk on plane ubuntu by using those working configuration files.

Hello @all

So i did few experiments, i deleted these 3 files “res_odbc.conf”, “res_pgsql.conf”, “sorcery.conf” basically removing odbc and modified pjsip file with this content (copying what was in database to this file).

[telnyx]
type=endpoint
aors=telnyx
outbound_auth=telnyx
context=from-pstn
allow=ulaw,alaw,G729,G722
disallow=all
direct_media=no
transport=transport-udp
dtmf_mode=rfc4733
rewrite_contact=yes
force_rport=yes
rtp_symmetric=yes

[telnyx]
type=auth
auth_type=userpass
username=
password=

[telnyx]
type=aor
contact=sip:sip.telnyx.com:5060
qualify_frequency=60

[telnyx]
type=identity
endpoint=telnyx
match=sip.telnyx.com:5060

[telnyx]
type=registration
outbound_auth=telnyx
server_uri=sip:sip.telnyx.com:5060
client_uri=sip:username123@sip.telnyx.com:5060

and now when i do pjsip show registrations it shows me the registration, but it’s not working whenever i use realtime so then i decided for registration i can use pjsip.conf file and for the ones that were working (endpoint, auth, aor) i can use database, but for some reasons whenever i use odbc and sorcery it never picks up my registration from pjsip.conf nor from database.

I think there might be something wrong with odbc or sorcery configuration, it isn’t picking up the registration from pjsip nor when i use database.

Any clues why it’s not working when i use odbc connector?

You can use the below link, step by step from Vital PBX for configuring asterisk realtime

There should not be any issues when running asterisk in a docker ensure that asterisk is configured properly

Hi

Thank you all for your time and help, I’m glad to say that the error is fixed now.

Here’s what i did and it fixed the issue.

First i moved from docker to beremetal and installed asterisk on ubuntu, but i highly doubt that it had any effect on fix.

When i moved to baremetal i didn’t installed odbc or database stuff just default asterisk and configuration files, and when i added my registration configuration in pjsip.conf it still wasn’t working here’s my registration config at that time:

[telnyx]
type=registration
outbound_auth=telnyx
server_uri=sip:sip.telnyx.com:5061
client_uri=sip:username123@sip.telnyx.com:5061

and i changed it to this and it started to work:

[telnyx]
type=registration
transport=transport-tls
outbound_auth=telnyx
server_uri=sip:sip.telnyx.com:5061
client_uri=sip:username123@sip.telnyx.com:5061
retry_interval=60
forbidden_retry_interval=10
expiration=3600

basically in new config i just added these new 4 lines.

transport=transport-tls
retry_interval=60
forbidden_retry_interval=10
expiration=3600

I don’t know if any of these 4 fields are required or not, but it started to work.

i followed this guide when i was working on configuring my sip trunk.
https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Wizard

and in there this was the example code of registration as well:

[my-itsp-reg]
type = registration
outbound_auth = my-itsp-auth
server_uri = sip:sip.my-itsp.net
client_uri = sip:my_username@sip.my-itsp.net

maybe this doesn’t work with new version of asterisk or documentation needs some updating, whatever again it might be only not working for me.

And when i configured odbc and realtime, i just changed my insert query from this:

insert into ps_registrations (
id, outbound_auth, server_uri, client_uri
) values (
'telnyx', 'telnyx', 'sip:sip.telnyx.com:5061', 'sip:username123@sip.telnyx.com:5061'
);

To this:

insert into ps_registrations (
    id, transport, outbound_auth, server_uri, client_uri, retry_interval, forbidden_retry_interval, expiration
) values (
    'telnyx', 'transport-tls', 'telnyx', 'sip:sip.telnyx.com:5061', 'sip:uesername123@sip.telnyx.com:5061', 60, 10, 3600
);

Basically just adding those new 4 lines.

Again, Thank you so much for your time and efforts.

Hi David

Just wanted to let you know, after i moved from docker to bare metal my RTT time is 164.896 msec compared to before it was 856.028 msec

Is it now normal or still too much?