I am trying to establish communication between two Asterisk servers, attempting to simulate the scenario used by the PSTN.
On one side, there is a configuration in sip.conf that represents the PSTN.
On my side, I am configuring pjsip.conf.
The PSTN server has the IP address 172.16.1.31.
The server with PJSIP has the IP address 172.16.1.121.
The configurations on both sides are as follows:
PSTN
[pstn]
type=peer
context=saida-oi
canreinvite=no
dtmfmode=rfc2833
host=172.16.1.121
qualify=yes
nat=force_rport,comedia
disallow=all
allow=alaw,ulaw,g729
My side PJSIP
[pjsip]
type=endpoint
context=interno
disallow=all
allow=ulaw
direct_media=no
transport=transport-udp
aors=pjsip
[pjsip]
type=identify
endpoint=pjsip
match=172.16.1.31
[pjsip]
type=aor
contact=sip:172.16.1.31
qualify_frequency=60
With this configuration, I can make and receive calls without any issues.
I converted the PJSIP settings to realtime in PostgreSQL.
=# select id, transport, aors, context, disallow, allow, direct_media from ps_endpoints where id='pjsip';
id | transport | aors | context | disallow | allow | direct_media
-------+---------------+-------+---------+----------+-------+--------------
pjsip | transport-udp | pjsip | interno | all | ulaw | no
(1 registro)
=# select id, contact, qualify_frequency from ps_aors where id='pjsip';
id | contact | qualify_frequency
-------+-----------------+-------------------
pjsip | sip:172.16.1.31 | 60
(1 registro)
With this configuration, I can make calls from PJSIP to the PSTN. However, I’m unable to receive calls from the PSTN and encountering this error:
[2023-05-24 18:10:28] NOTICE[12748]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"asterisk" <sip:asterisk@172.16.1.31>' failed for '172.16.1.31:5060' (callid: 6c6c162672f7aa8c6bfac36142a7d3f2@172.16.1.31:5060) - No matching endpoint found
I believe the issue is that there is no table available for me to input the identify
information.
[pjsip]
type=identify
endpoint=pjsip
match=172.16.1.31
Even if I add this code snippet to the pjsip.conf
file, the problem remains the same.
When a reload is performed on the PSTN side, this message appears on my PJSIP server:
[2023-05-24 18:12:57] NOTICE[12748]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'OPTIONS' from '"asterisk" <sip:asterisk@172.16.1.31>' failed for '172.16.1.31:5060' (callid: 70227e9e7880528f20d5d2680ec034f6@172.16.1.31:5060) - No matching endpoint found
Where should I put this identify
information, or how should the database settings be made to communicate with the PSTN using realtime?