Configurating Asterisk with SIP trunk via proxy (sip.conf) [resolved]

Hi,

I’ve got truble while configurating Asterisk.
I had to replace my S0 to a SIP trunk today.
My Provider mailed me my new user data with my user id, passwor, registry and proxy.
I added the following configuration so my sip.conf:

[vsenet]
type=peer
host=sip.vsenet.de
outboundproxy=10.199.27.21
port=5060
username=MY_USER
fromuser=MY_USER
fromdomain=sip . vsenet . de
secret=MY_PASSWORD
dtmfmode=rfc2833
insecure=port,invite
canreinvite=no
registertimeout=600
disallow=all
allow=alaw
allow=ulaw
context=public

and

register => MY_USER:MY_PASSWORD@vsenet/MY_USER

But I only got the following error:

Probably a DNS error for registration to MY_USER@vsenet, trying REGISTER again (after 20 seconds)
[Feb 12 21:54:17] NOTICE[1375]: chan_sip.c:15967 sip_reg_timeout:
– Registration for ‘MY_USER@vsenet’ timed out, trying again (Attempt #74)

To check my user data I tried them on the same machine with X-Lite:

User ID: MY_USER
Domain: sip . vsenet . de
Password: MY_PASSWORD
Display name: VSE
Authorization name: MY_USER
Domain Proxy:
Checked „Register with domain and receive calls“
Send outbound via: Proxy
Address: 10.199.27.21

Dial plan: #1\a\a.T;match=1;prestrip=2;

X-Lite works with incoming and outgoing calls.

Asterisk Version: 15.2.0

Thanks for help

Marc

I believe you need to fully qualify your register string.

Do you mean this: register => [peer?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry]?

Which part do you think I missed?

Or do you mean a FQDN? If I replace it with: register => MY_USER:MY_PASSWORD@sip.vsenet.de/MY_USER

I got:

[Feb 12 22:36:29] NOTICE[1375]: chan_sip.c:15967 sip_reg_timeout: – Registration for ‘MY_USER@sip.vsenet.de’ timed out, trying again (Attempt #5)
[Feb 12 22:37:49] ERROR[1375]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo(“sip.vsenet.de”, “(null)”, …): Name or service not known

Thanks

Marc

That looks better.

Do you have working DNS on your asterisk box?

Can you resolve that host from your systems shell?

DNS is working. X-Lite on the same machine works.
But the Record for sip . vsenet . de is not public.

ping sip.vsenet.de
ping: cannot resolve sip.vsenet.de: Unknown host

It’s only available through the proxy 10.199.27.21

I don’t know if it’s possible to specify a proxy for a registrar string.

Instead I’d suggest adding a callbackexten option to your peer and seeing if that works to make it register outbound.

I’m not sure what you mean.
Could you give me a litte example?

Thanks
Marc

[vsenet]
type=peer

callbackexten=MY_USER

Ok, Thanks.
Resolved the Problem a few minutes ago:

I had to add sip . vsenet . de to my local DNS (or /etc/hosts) with IP of the Proxy.
Now it works.

Thanks a lot for your help

1 Like