Answer the question
In order to leave comments, you need to log in
How to specify src address for specific trunk traffic in asterisk?
There is a provider which provides sip telephony. Authorization at the provider occurs by ip address. For each phone number, the provider gives a trunk.
I will clarify what in this case I understand by a trunk: the provider assigns an ipv4 subnet with a long mask of 30 bits (subnets from the 10.0.0.0/8 range) and gives it all in different VLANs using one optic. This subnet contains the interface of the provider's router and the interface of our asterisk. The provider's SIP server itself is located behind the router and has ONE ip address! The last fact is very unfortunate. The diagram is shown in the figure:
Accordingly, depending on which address (our address assigned by asterisk) and through which vlan sip traffic goes, the provider assigns it either to one phone or to another.
How to ensure work in such a configuration?
The solution in the forehead is to put one asterisk on each subnet issued by the provider. But somehow it doesn't look good.
Now, if it were possible to assign different source addresses in packages of different accounts from sip.conf, then the problem could be solved by a simple routing policy by the source address.
The options with double nat are still in my head, but I think the solution is not working due to the fact that sip is not friendly with nat.
Answer the question
In order to leave comments, you need to log in
After googling and talking with people who use asterisk, I came to the conclusion that this scheme cannot be implemented. It remains only to pervert or take something more serious than asterisk.
If the provider substitutes a number for you depending on your IP address or VLAN_ID,
and not on your SIP registration, then any action on your part will not resolve the issue.
Negotiate with the provider.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question