Ht503 voip to pstn

hi everyone, i’m having a problem with the configuration between a grandstream ht503 and Asterisk, the current state is this:

PSTN to VOIP works correctly, when HT detects an incoming call, the call is redirected to an ip phone
VOIP to PSTN doesn’t work seems to me that the number is not dialled, but if i set the ht to forward any call to a specified number it works fine.

here the asterisk sip and extensions conf
sip:

[general]
port = 5060
binaddr = 0.0.0.0
context = others

[2000]
type=friend
context=my-phones
secret=1234
host=dynamic

[2001]
type=friend
context=my-phones
secret=1234
host=dynamic

[ht503fxo]
type=peer
username=ht503fxo
secret=something
canreinvite=no
insecure=very
host=dynamic
nat=no
port=5062
disallow=all
allow=alaw
allow=ulaw
dtmf=rfc2833
qualify=yes
context=my-phones

[ht503fxs]
type=friend
username=ht503fxs
secret=something
host=dynamic
insecure=very
nat=no
dtmf=rfc2833
port=5060
canreinvite=no
disallow=all
allow=alaw,ulaw
qualify=yes
context=my-phones

extensions

[others]

[my-phones]
exten => 2000,1,Dial(SIP/2000,20)
exten => 2001,1,Dial(SIP/2001,20)
exten => _XXXXX.,1,Dial(SIP/ht503fxo,60,D(w${EXTEN}))
exten => _XXXXX.,n,Hangup()

any help would be really appreciated 'cause it’s almost 2 weeks that i’m on it

You are using deprecated/obsolete/unsafe options, and you appear to be using friend for not good reason. I’d suggest starting over from first principles, rather than using a decade old example designed to avoid support calls at the expense of other things. However, none of that seem relevant here.

What does seem odd is explicitly sending the DTMF, rather than using the gateway like you would an ITSP. If the gateway actually handles answer supervision, the DTMF will never be sent, because the call will never be answered.

Is the HT503 registering the line with Asterisk?
Also, the latest example for sip show insecure=port, invite for both and doesn’t mention very.

Also just noticed that you have binaddr - should be bindaddr - in the general section. Not sure if that would matter.

And what most people actually want is insecure=invite, alone, although, the newer remotesecret, instead of secret, is, in my view, a clearer way of doing the same thing.

Also canreinvite was renamed directmedia, many years ago.

Together, these suggest you are copying examples from the web, without understanding them.

I fined it very difficult to keep up with the changes in naming of options with such a large subject as Asterisk. It can also get very difficult to find up to date examples for older technologies, such as the HT503. It took me long time to find out how to configure HT503 in North America to capture the caller-id.