I think I’ve got the same problem with an SPA3102. The extension / FXS port is registering fine as a pjsip extension, however, if I try to configure the trunk as pjsip, it works and I can receive incoming calls and make outgoing calls on the trunk, but the extension can no longer register, and freepbx returns 404 not found when the extension tries to register. If I try changing the trunk to chansip, the extension stays registered, but I cannot receive incoming calls on it. Freepbx returns 401 Unauthorised on an incoming call. The SPA3102 responds to the challenge with the username (and I assume) password I have configured on the trunk, but Freepbx replies with 401 Unauthorised again and the incoming call fails. Here’s the asterisk log of the incoming call:
[2017-07-24 07:59:02] NOTICE[24256] res_pjsip/pjsip_distributor.c: Request from ‘“PSTN” sip:[email protected]’ failed for ‘192.168.100.113:5160’ (callid: [email protected]) - No matching endpoint found
[2017-07-24 07:59:02] SECURITY[6664] res_security_log.c: SecurityEvent=“InvalidAccountID”,EventTV=“2017-07-24T07:59:02.002+1000”,Severity=“Error”,Service=“PJSIP”,EventVersion=“1”,AccountID=“1-pstn”,SessionID="[email protected]",LocalAddress=“IPV4/UDP/192.168.100.100/5060”,RemoteAddress=“IPV4/UDP/192.168.100.113/5160”
[2017-07-24 07:59:02] SECURITY[6664] res_security_log.c: SecurityEvent=“ChallengeSent”,EventTV=“2017-07-24T07:59:02.003+1000”,Severity=“Informational”,Service=“PJSIP”,EventVersion=“1”,AccountID="",SessionID="[email protected]",LocalAddress=“IPV4/UDP/192.168.100.100/5060”,RemoteAddress=“IPV4/UDP/192.168.100.113/5160”,Challenge=""
[2017-07-24 07:59:02] NOTICE[24256] res_pjsip/pjsip_distributor.c: Request from ‘“PSTN” sip:[email protected]’ failed for ‘192.168.100.113:5160’ (callid: [email protected]) - No matching endpoint found
[2017-07-24 07:59:02] SECURITY[6664] res_security_log.c: SecurityEvent=“InvalidAccountID”,EventTV=“2017-07-24T07:59:02.013+1000”,Severity=“Error”,Service=“PJSIP”,EventVersion=“1”,AccountID=“1-pstn”,SessionID="[email protected]",LocalAddress=“IPV4/UDP/192.168.100.100/5060”,RemoteAddress=“IPV4/UDP/192.168.100.113/5160”
[2017-07-24 07:59:02] SECURITY[6664] res_security_log.c: SecurityEvent=“ChallengeResponseFailed”,EventTV=“2017-07-24T07:59:02.013+1000”,Severity=“Error”,Service=“PJSIP”,EventVersion=“1”,AccountID="",SessionID="[email protected]",LocalAddress=“IPV4/UDP/192.168.100.100/5060”,RemoteAddress=“IPV4/UDP/192.168.100.113/5160”,Challenge=“1500847142/51218d58c6c5f7efebe1ecc36860feb4”,Response=“b891ec576f2e338e154da8ca85fdaf5b”,ExpectedResponse=""
[2017-07-24 07:59:02] NOTICE[24256] res_pjsip/pjsip_distributor.c: Request from ‘“PSTN” sip:[email protected]’ failed for ‘192.168.100.113:5160’ (callid: [email protected]) - No matching endpoint found
[2017-07-24 07:59:02] SECURITY[6664] res_security_log.c: SecurityEvent=“InvalidAccountID”,EventTV=“2017-07-24T07:59:02.023+1000”,Severity=“Error”,Service=“PJSIP”,EventVersion=“1”,AccountID=“1-pstn”,SessionID="[email protected]",LocalAddress=“IPV4/UDP/192.168.100.100/5060”,RemoteAddress=“IPV4/UDP/192.168.100.113/5160”
[2017-07-24 07:59:02] SECURITY[6664] res_security_log.c: SecurityEvent=“ChallengeResponseFailed”,EventTV=“2017-07-24T07:59:02.023+1000”,Severity=“Error”,Service=“PJSIP”,EventVersion=“1”,AccountID="",SessionID="[email protected]",LocalAddress=“IPV4/UDP/192.168.100.100/5060”,RemoteAddress=“IPV4/UDP/192.168.100.113/5160”,Challenge=“1500847142/51218d58c6c5f7efebe1ecc36860feb4”,Response=“0c236ed952556fbcebf7ce410749eff5”,ExpectedResponse=""
^C
And the trace:
Line 1 (FXS) on the SPA3102 is set for port 5060 and PSTN Line is set for port 5061. Trunk config (chansip) is as follows:
user=1-pstn
secret=*******
canreinvite=no
context=from-pstn
host=192.168.100.113
nat=no
port=5061
type=friend
qualify=yes
Any ideas??