Flowroute Autopatch With Node Behind NAT Working

It appears I have autopatch working with Flowroute SIP trunk. It was close yesterday, call would dial and I could answer, but there was no sound, like vox wasn’t working. I was going to update the issue on github and began another test, and of course it’s now working and I don’t know why it wasn’t yesterday. Hopefully it will continue to work. The instructions here work great but the Flowroute SIP part can be difficult to get going. Here’s config examples using IP auth:

rpt.conf node section:
context = autopatch
callerid = “KG5DRT” <15552031499>

rpt.conf functions section:
61 = autopatchup,noct = 1,farenddisconnect = 1,dialtime = 20000,context = autopatch,quiet =1,voxalways=1 ; Autopatch up
62 = autopatchdn ; Autopatch down

extensions.conf, replace 12345678 with your auth user:
[autopatch]
exten => _1NXXNXXXXXX,1,Dial(PJSIP/flowroute-trunk/sip:12345678*${EXTEN}@us-west-or.sip.flowroute.com)

Follow the instructions on setting up SIP phones to load the modules in modules.conf:

This is my pjsip.conf with privates changed below. My node is behind NAT. Make sure to update local_net for your network and leave the loopback entry below it as is, change 555.555.555.555 to your internet IP/hostname, change all instances of 12345678 to your auth username at Flowroute. That is enough to get IP auth working.

pjsip.conf:

;===============TRANSPORT

[sip-trans]
type=transport
protocol=udp
bind=0.0.0.0
local_net=192.168.1.0/24
local_net=127.0.0.1/32
external_media_address=555.555.555.555
external_signaling_address=555.555.555.555

;===============TRUNK

[flowroute-trunk]
type=registration
;outbound_auth=flowroute-trunk
server_uri=sip:us-west-or.sip.flowroute.com
client_uri=sip:12345678@us-west-or.sip.flowroute.com
retry_interval=60

[flowroute-trunk]
type=auth
auth_type=userpass
password=mypassword
username=12345678

[flowroute-trunk]
type=aor
contact=sip:555.555.555.555:5060

[flowroute-trunk]
type=endpoint
context=from-external
disallow=all
allow=ulaw
outbound_auth=flowroute-trunk
aors=flowroute-trunk
direct_media=no
from_domain=555.555.555.555

[flowroute-trunk]
type=identify
endpoint=flowroute-trunk
match=us-west-or.sip.flowroute.com
; The End

If one needs to use user/pass auth with flowroute, uncomment the outbound_auth line in the registration above, update the username and password in the auth section, and change the line in extensions.conf to remove the auth name:

exten => _1NXXNXXXXXX,1,Dial(PJSIP/flowroute-trunk/sip:*${EXTEN}@us-west-or.sip.flowroute.com)

That should be it. I didn’t know anything about pjsip a few days ago. This works, but there are likely better ways to do some of these things.

root@pi4allstar:~# asl-show-version
dpkg-query: no packages found matching cockpit*
********** AllStarLink [ASL] Version Info **********

OS : Debian GNU/Linux 12 (bookworm)
OS Kernel : 6.6.51+rpt-rpi-v8

Asterisk : 20.9.3+asl3-3.0.6-1.deb12
ASL [app_rpt] : 3.0.6

Installed ASL packages :

Package Version
============================== ==============================
allmon3 1.3.4-1.deb12
asl3 3.5.0-1.deb
asl3-asterisk 2:20.9.3+asl3-3.0.6-1.deb12
asl3-asterisk-config 2:20.9.3+asl3-3.0.6-1.deb12
asl3-asterisk-modules 2:20.9.3+asl3-3.0.6-1.deb12
asl3-menu 1.9-1.deb12
dahdi 1:3.1.0-2
dahdi-dkms 1:3.4.0-4+asl
dahdi-linux 1:3.4.0-4+asl