Sending Calls Via SIP Trunk From Several Different IP Addresses From Same Asterisk Machine, To The Same Destination IP
Hi!
I would like to reopen a discussion that I saw a couple of years ago, with the subject “Sending Calls via SIP trunk from two different IP addresses from same Asterisk Machine”
The use case is simpe: There are providers that want to see a separate source IP address for each of their customers SIP trunks. Now, if we have an asterisk box with several customers, we have a problem.
Does anyone have experience in this topic? How could we send outgoing calls (to the same destination IP) from different source IPs depending on the caller ID (Based on From: field, sip account, preferred-identity, whatever).
I was thinking about some Kamailio, or SBC that would take the calls from asterisk using a user/pass authentication on a single interface, and initiate calls from a dedicated IP address for each customer. Any better idea?
Thanks
Attila
6 thoughts on - Sending Calls Via SIP Trunk From Several Different IP Addresses From Same Asterisk Machine, To The Same Destination IP
Hi,
Usually, the trunk provider(s) provide a mechanism to support this, and it’s the “Tech Prefix” or just “Prefix”.
So, for Tenant 1, send 12348005551212 and for Tenant 2, send 56788005551212.
They’ll then strip the prefix, and send along to 8005551212
Most trunk providers worth anything will support this type of termination.
Hope this helps,
*Glenn @ VDO*
And if we were the trunk provider in this case – I would probably trunk it to a separate machine, or run a second instance of asterisk on the same machine and bind it to the secondary IP address / sip port combo, peer the two instances and then send it out via the second instance.
Sent from my iPhone
SGksDQoNClVuZm9ydHVuYXRlbHkgdGhpcyBpcyBub3QgdGhlIGNhc2UuDQpGb3Igc29tZSByZWFz b25zIChzZXBhcmF0aW9uLCBmcmF1ZCBkZXRlY3Rpb24pIHRoZXkgc2VwYXJhdGUgdGhlIGN1c3Rv bWVyIHVzaW5nIHRoZWlyIHNvdXJjZSBJUCBhZGRyZXNzLiBTbyBJIGFtIHN0aWxsIGxvb2tpbmcg Zm9yIHNvbWUgc29sdXRpb24uDQoNClRoYW5rcywNCkF0dGlsYQ0KDQpGcm9tOiBhc3Rlcmlzay11
c2Vycy1ib3VuY2VzQGxpc3RzLmRpZ2l1bS5jb20gW21haWx0bzphc3Rlcmlzay11c2Vycy1ib3Vu Y2VzQGxpc3RzLmRpZ2l1bS5jb21dIE9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sIGFuZCBpbml0aWF0ZSBjYWxscyBmcm9tIGEgZGVkaWNhdGVkIElQIGFkZHJlc3Mg Zm9yIGVhY2ggY3VzdG9tZXIuDQpBbnkgYmV0dGVyIGlkZWE/DQoNClRoYW5rcw0KDQpBdHRpbGEN
Cg0KLS0NCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fXw0KLS0gQmFuZHdpZHRoIGFuZCBDb2xvY2F0aW9uIFByb3ZpZGVk IGJ5IGh0dHA6Ly93d3cuYXBpLWRpZ2l0YWwuY29tIC0tDQpOZXcgdG8gQXN0ZXJpc2s/IEpvaW4g dXMgZm9yIGEgbGl2ZSBpbnRyb2R1Y3Rvcnkgd2ViaW5hciBldmVyeSBUaHVyczoNCiAgICAgICAg ICAgICAgIGh0dHA6Ly93d3cuYXN0ZXJpc2sub3JnL2hlbGxvDQoNCmFzdGVyaXNrLXVzZXJzIG1h aWxpbmcgbGlzdA0KVG8gVU5TVUJTQ1JJQkUgb3IgdXBkYXRlIG9wdGlvbnMgdmlzaXQ6DQogICBo dHRwOi8vbGlzdHMuZGlnaXVtLmNvbS9tYWlsbWFuL2xpc3RpbmZvL2FzdGVyaXNrLXVzZXJzDQoN
Cg=
How about running a second asterisk instance on the same box with different IP/Port combo
If I had just two such users, I would be fine. But having 10-20 or even more? It is not a nice, scalable solution…
—–Original Message—
If you are using PJSIP, you should be able to define a different transport for each source IP that you want to use and simply tie the endpoint to your provider to the appropriate transport. Obviously, you’d need to define the IP on the interface as well. You could use the same interface with multiple IPs or, if you need to separate the traffic over unique links (not likely, I imagine), you could always tie them to different interfaces if needed.