Creation two sip trunk

Hi,
We have to create two SIP trunk in one Asterisk box,but SIP provider has forced us peer each SIP trunk via specific source address at Asterisk side.
Our provider has offered two separated IP address and subnetmask for these SIP trunks.We can ping provider side IP address and do SIP peering separately,but we want to have two SIP trunk peering with our provider simultaneously with source IP/Mask address consideration at Asterisk box.
Our networking and routing is OK we can ping provider IP from each ip/mask simultaneously at Asterisk box.
How can we do this with SIP or PJSIP?
please help .

Hi.

Asterisk is behind nat, having for example one firewall in front of it, or is directly connected to the internet? Another’s question: the two IP address that you have, are from the same internet provider?

chan_pjsip allows you to have multiple transports, which can be bound to different local addresses.

As well as not providing for this, chan_sip is deprecated, and will be removed in Asterisk 21.

Thanks for your attention,
there isn’t any firewall and any nat and we have directly connected to our SIP provider.We have got IP addresses from one provider and unfortunately the provider can provider only one SBC at his side…

Thank you for your hints, but please help how to do this via chan-pjsip in Asterisk 16.How different transport created and how it bind separated SIP trunks.

There isn’t such a think as a SIP trunk in Asterisk. You would bind chan_pjsip to separate interfaces, which might be virtual interfaces, and associate the endpoint for the provider with the transport with an interface on their network.

Creating virtual interfaces is a Linux question, not an Asterisk one, and one you would have to address if you want to present multiple addresses, regardless of the driver. Defining a transport to bind to an interface should be obvious from the documentation, and associating a transport with an endpoint should also be obvious.

I don’t understand the relevance of the SBC.

also our SIP trunk provider doesn’t have any authentication checking mechanism for SIP trunk peering.It only forceed send each SIP trunk with specific source Ip address at Asterisk side.

Thank you very much for your time and attention.Could you please send the link of document about “Defining a transport bind to an interface”.Sorry, I searched about it but, I coudn’t find proper document.
this is my connection schematic to SIP provider
Asterisk(if #1 IP:10.10.10.1) ----------- IP colud ----------- > (30.30.30.30:5070) SIP Provider IP
Asterisk(if #2 IP:20.20.20.1) ----------- IP colud ----------- > (30.30.30.30:5080) SIP Provider IP
with respect the above how should I configure SIP trunk parameters in PJSIP at Asterisk side that each interface send its over source IPs(10.10.10.1 , 20.20.20.1) and consider provider udp port numbers (5070,5080) and IP (30.30.30.30)
there isn’t any authentication mechanism for SIP trunking between Asterisk and provider.

https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Sections+and+Relationships

subheading TRANSPORT

I created the SIP trunks to provider but simultaneously only one of them is in establish(ok) state and other stay in unreachable state.I can do trunking one by one in in this case I have Ok state by in simultaneously case I have only one of them in OK state.
Thanks