Two external ip address for asterisk

i have asterisk 11.25 version system behind firewall, and there are two external IP ,one is pulic ,one is vpn set in firewall, and the two IP had done NAT to the asterisk’s 5060 port.
my question is i can set only one external_ip ,when i set public ip in system, the vpn users make phone and can not hear voice. is there any thing i can do to handle the problem?

If you are using an obsolete Asterisk, you are probably using an obsolete channel driver. The current channel driver can cope with multiple NATted intefaces, by defining a transport for each. Otherwise, you can only have one NATted interface,

Given those constrains, setting directmedia (direct_media) to no, should help.


yes,it can copy with multiple interfaces,but the 183 always send the really ip address,not the outside(public or vpn ip address)…

how can change the media address(172.x.x.x) to public(140.x.x.x) or vpn address?

you need a router with SIP ALG function

i want to do with this :slight_smile:

yes,there are two envirment, one with SIP ALG is running good, the other one don’t know weather have this function,i’ll check it out.

Asterisk can’t set multiple public IP.

So buy many router which have SIP ALG, and you can NAT sip traffic to different IP address for each network.

the cloud server provider don’t allow add SIP ALG on the router,is there any other way?

so asterisk 18 don’t have this problem, give me some advise…thanks

the cloud server provider don’t allow add SIP ALG on the router,is there any other way?

you can install cloud router

install cloud router in every server? let me see see… i’ll googl how to use it…thanks ,

seams it’s a google privide server… my cloud server not privide this function

SIP ALG is generally strongly discouraged, with Asterisk. I’d fall back to using multiple instances of Asterisk before doing that.

The media address is one of the parameters for PJSIP transports.

It’s more a case that no-one remembers or cares what problems your version of Asterisk has.

Hasn’t been true for many years. Whilst it is possible that it is buggy, chan_pjsip, the only currently supported driver for SIP, allows different addresses for each transport.

so i can use chan_pjsip for each extension? or in another way, like for vpn user it use 1001, with transport 10.x.x.x for it’s external_IP; and 1002 for public user, with 202.x.x.x for ti’s external_IP? each extension can have it’s own;
Or i need build each extension a sip trunk?

Neither Asterisk nor SIP have a concept of a trunk. What many call an extension, in Asterisk terms is an endpoint that directly represents a telephone.

On Thursday 16 May 2024 at 17:55:20, sinoee via Asterisk Community wrote:

so i can use chan_pjsip for each extension? or in another way, like for vpn
user it use 1001, with transport 10.x.x.x for it’s external_IP; and 1002
for public user, with 202.x.x.x for ti’s external_IP? each extension can
have it’s own; Or i need build each extension a sip trunk?

The word “trunk” means nothing in Asterisk-speak.

It is a very common word used by SIP connectivity providers, and therefore
also plenty of Asterisk users, and in some documentation, but “trunk” is just
“a SIP connection” as far as Asterisk is concerned.

The most common difference between what some people call a trunk and what they
call a telephone is that the telephone authenticates with username and
password whereas a trunk is authenticated purely by IP address.

Antony.


“Have you been drinking brake fluid again? I think you’re addicted to the
stuff.”

“No, no, it’s alright - I can stop any time I want to.”

                                               Please reply to the list;
                                                     please *don't* CC me.

Or if by user and password, it is done outbound, rather than inbound. There is actually no technical reason why phones couldn’t be authenticated purely by IP address; it’s just administratively easier to use dynamic addresses.

The other common difference is that “trunks” actually make use of the user part of the SIP URI they receive, although there may be multi-line phones that also do that.

stil don’t know what to do with this problem,give some advice?