I'm struggling to understand the correct config for a b2bua as authenticated user on both ends.
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 ..
The To header ..
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