If i put these parameter like this :
username=03XXXXXXXX
type=friend
secret=xxxxxxxxxx
host=dynamic
dtmfmode=rfc2833
disallow=all
context=from-trunk
canreinvite=no
allow=ulaw&alaw
fromuser=03XXXXXXXX
The trunk won’t be up, and HT don’t register at all.
OK, so we need to find out why it’s failing to register.
On the FXO page, confirm that you have
Account Active: Yes
Primary SIP Sever: 192.168.2.243:5160
(Replace 192.168.2.243 with the IP address of the PBX and 5160 with the value of Bind Port for chan_sip, if either of these have changed.)
Outbound Proxy: (leave blank)
SIP User ID: 03XXXXXXXX
Authenticate ID: 03XXXXXXXX
Authenticate Password: (match secret for the trunk)
If it still won’t register, use SIP debug to see registration attempts. If you don’t see any, they are possibly being blocked by FreePBX firewall; briefly turn it off as a test. You can use tcpdump to see if any REGISTER packets are coming in.
On a failed registration with 403, HT (by default) waits 20 minutes before trying again. With tcpdump capturing and sip debug also running, reboot the HT and wait for it to come ready. If you still don’t see any registration attempts, please post a screenshot of the FXO page – I’m pretty sure something is in error there.
Your log shows 6+ hours with no activity. That’s very strange if you have pjsip logger and sip debug both on. Note that these commands get canceled when you Apply Config or otherwise reload or restart Asterisk, so you need to give them again. After doing that, reboot the HT so it tries to register.
Please confirm that in Asterisk SIP settings, pjsip Port to Listen On is still 5060 (the default) and sip Bind Port is still 5160 (the default). Also, post a screenshot of the current FXO port settings.