b2bua as authenticated trunks

55 views
Skip to first unread message

Matt Keys

unread,
Nov 28, 2023, 1:07:53 PM11/28/23
to baresip
I'm struggling to understand the correct config for a b2bua as authenticated user on both ends.

I have already reviewed the instructions at https://github.com/baresip/baresip/wiki/b2bua-module 

The example scenario is as follows:

Two (sip trunk) registrations -- one PSTN facing, the other internal PBX facing, both different SIP domains. Ideally baresip is in the middle doing transport (tcp to udp) and media conversion ( * to pcmu/pcma). In baresip accounts .. 

# pstn sip trunk
<sip:pstn...@pstn.domain;transport=udp>;regint=3600;auth_user=pstnuser;auth_pass=authpass;audio_codecs=pcmu,pcma;b2bua=outbound

# local pbx registration
<sip:2...@localpbx.domain;transport=tcp>;regint=3600;auth_user=205;auth_pass=authpass;audio_codecs=pcmu,pcma;b2bua=inbound

Both registrations are successful.

Local PBX then sends (unauthenticated) INVITE to a PSTN number -- ie 4235551212. INVITE is received by baresip as request uri .. 

INVITE sip:4235551212@baresip:5080

The To header ..

To: <sip:4235551212@localpbx.domain>

The From header includes the pstn domain user as the user part, and the local PBX as the SIP domain. I'm using the DID that would be in use on the PSTN domain side as the outbound caller ID value. 

From: "display name"<sip:pstn...@localpbx.domain

When a localpbx.domain user dials a PSTN number, baresip then accepts the INVITE and creates a new INVITE to localpbx.domain instead of out pstn.domain.

I have tried various other configurations as well but can't seem to work around this. For example, a total of 4 accounts defined -- the two above (without b2bua=) and two new ones ..

# localhost b2bua inbound
#<sip:pstnuser@baresip;transport=tcp>;regint=0;audio_codecs=pcmu,pcma;b2bua=inbound

# localhost b2bua outbound
#<sip:pstnuser@baresip;transport=udp>;regint=0;audio_codecs=pcmu,pcma;b2bua=outbound

... and even tried specifying outbound="sip:pstn.domain" in the b2bua=outbound line above doesn't seem to make any difference.

Thanks,
Matt

Reply all
Reply to author
Forward
0 new messages