r/Asterisk•
stompro

telnyx trunk setup examples - bad syntax?

Hello, I was trying to use this example from Telnyx to setup a pjsip trunk, and ran into errors. It seems strange to me that they don't use square brackets for their headings. Is that a valid alternate config syntax?

;/etc/asterisk/pjsip_wizard.conf
trunk_defaults
type = wizard

telnyx
endpoint/transport=0.0.0.0-udp
endpoint/allow = !all,ulaw,alaw,G729,G722
endpoint/rewrite_contact=yes
endpoint/dtmf_mode=rfc4733
endpoint/context = from-pstn
endpoint/force_rport = yes
aor/qualify_frequency = 60
sends_auth = yes
sends_registrations = yes
remote_hosts = sip.telnyx.com:5060
outbound_auth/username = username
outbound_auth/password = password
registration/expiration = 600

https://developers.telnyx.com/docs/v2/sip-trunking/configuration-guides/asterisk

Also, I cannot find an example in the pjsip_wizard that sets a trunk_default type=wizard, and then leaves it out of other sections. Is that also valid?

Posted Jun 17, 2020, 2:12 PM UTC

33
watsonkr•

I had the same question too, and i'm quite sure it needs the brackets. I added them and it works fine.

Below is my working pjsip.conf and pjsip_wizard.conf, however a couple of notes:

  1. I'm using encryption only (tls / srtp)
  2. My asterisk instance is behind my firewall, so it's NATd
  3. In Telnyx, i'm using FQDN for inbound and credentials for outbound.
  4. I only use opus, but telnyx will transcode everything else for me.
; pjsip.conf

[global]
type=global

[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
local_net=192.168.1.0/24
external_media_address=my.external.domain
external_signaling_address=my.external.domain
allow_reload=no
method=tlsv1_2
cert_file=/etc/asterisk/keys/server.crt
priv_key_file=/etc/asterisk/keys/server.pem
verify_client=no
verify_server=no

;
; pjsip_wizard.conf

[telnyx]
type = wizard
endpoint/transport=transport-tls
endpoint/media_encryption = sdes
endpoint/allow = !all,opus
endpoint/rewrite_contact=yes
endpoint/dtmf_mode=rfc4733
endpoint/context = from-pstn
endpoint/force_rport = yes
aor/qualify_frequency = 60
sends_auth = yes
sends_registrations = yes
remote_hosts = sip.telnyx.com:5061
outbound_auth/username = USERNAME
outbound_auth/password = PASSWORD
registration/expiration = 600

[user-defaults](!)
type = wizard
endpoint/context = internal
accepts_registrations = yes
sends_registrations = no
accepts_auth = yes
sends_auth = no
endpoint/allow = !all,opus
endpoint/media_encryption = sdes
endpoint/dtmf_mode = rfc4733
endpoint/rewrite_contact = yes
endpoint/force_rport = yes
aor/max_contacts = 1
aor/remove_existing = yes
aor/minimum_expiration = 30
1
LinkifyBot•

I found links in your comment that were not hyperlinked:

I did the honors for you.


^delete ^| ^information ^| ^<3

1
TheLightingGuy•

Bad bot.

1