Proxy freepbx trafic for sip trunk

Hello, i hope that all of you are fine !

i have a working freepbx server hosted on aws with some sip trunk provider, but one of this trunk can’t connect
log say : res_pjsip_outbound_registration.c: No response received from 'sip:xxx.xxx.xxx.xxx:5060

i think that the sip provider restrict access to local country ip only

how to bypass this ! if proxy traffic from freepbx to a local proxy server on this country how ?
i don’t want to build another freepbx on this country & link the 2 freepbx together.

Thank you for reading my thread

It depends, some locales filter by port and protocol . UDP/5060 being sip voip, but most do it by ‘deep packet inspection’. i.e. the content is examined byte by byte,

You could try voip over IAX2 or TLS which are less inspected, but without an effective proxy inside the ‘protected’ place you will not find it easy as once inside the ‘protected’ location, extensions need to use a protocol NOT being inspected.

1 Like

thank you for your reply,

When i give account to a person who live on this country, the sip trunk work & register success.

on my server : ‘No response received from ‘sip:xxx.xxx.xxx.xxx:5060’’

then actually i need to root internet traffic from freepbx to a proxy addresse from this country, but how to do it on freepbx ?

What was he using (FreePBX, a softphone, IP phone, etc.)? Did you try entering the same credentials into the same type of device at your location? Possibly, the provider uses fail2ban or similar and a previous use of invalid credentials caused your AWS IP address to be banned. Have you tested from another location in your country?

Will be using this provider for incoming, outgoing or both? Possibly, the provider offers IP authentication (instead of registration), which may work in your situation.

Possibly, a commercial VPN service has a server in the destination country, which you could use instead of a proxy.

That seems very strange. If they are doing that to reduce fraud, you may be able to convince them that you are a legitimate customer and get them to whitelist your AWS IP address. If regulations in their country allow them to provide service to domestic customers only, you may be breaking the law by attempting to circumvent the restrictions. You can likely find a trunking provider elsewhere with good rates to the country involved.

1 Like

Hello,
thank you for your reply i appreciaite your help,

yes we have same configuration ( freepbx server )! same setttings on aws server not working,
on local country server working.

with aws im using eslastic ip then i have changed server ip the same problem.

we prefer to use the sip trunk for both, but we have teste all configuration with no result !

how we can setup freepbx to work with a vpn if we found a vpn service in this country please ?

Not sure what you missed from Stewart’s post.

If you are a legitimate customer, then reach out to their support. If they don’t support it, why should we?

Reached provider, they say that only local ip country are authorized !.

any solutions !

Use a provider that you won’t have to break their terms…

1 Like

let’s start with ‘what country are we talking about?’ or it’s just guessing from us.

1 Like

Hello, thank you for you reply dicko, i resolved connexion to sip line throug a vpn server based on this country, but actually am facing a new problem after vpn connexion:

no voice on local extension call, for inbound call with the sip trunk we can listen but no voice go to the caller.
am hosting my freepbx on aws & on aws firewall i have port opened for 5060 / 5061 / 7000-20000.
same when i autorise all traffic

i have no firewall on freepbx, & linux firewall disabled !

You could better describe your ‘VPN’ and its topology

1 Like

Did you add the the VPN local network in Settings >> Asterisk SIP Settings >> NAT Settings?

1 Like

thank you all for your reply, i finally resolved the problem! thank you for your reply & help

Share the solution for the next person.

2 Likes

Hello sorry for the late reply,

it was a problem between chan_sip & chan_pjsip, ( when i talked to provider & said that i added trunk pjsip they said it will not work, told me to setup as sip ) my extension work on chan_pjsip, i have set all things correctly but like asterisk not handling the setting on backend ( fwconsole reload, fwconsole restart, rebooting server nothing seems to resolve the problem !

So i made fresh install with bot channel enabled
UBUNTU: 20.04
Asterisk: 18.14.0
FreePBX 16.0.21.18

after installation done.

things i have made are
1 installing OpenVPN Client & connected to the server ( Edited Client Config to only route to the vpn the specific ip of trunk provider )
2 Asterisk SIP Settings >> Detect Network Settings ( i got automaticaly all my network interface )
3 Added the true Public IP of my aws server on External IP Address on Chan_pjsip & Port Also
4 i added trunk first with test worked, then i added extension worked also
5 i installed UFW & Fail2Ban & made config
& now my server are working fine.

Sorry for my bad English & im new on this things of pbx or sip or voip, i started to watch the first video on how it work & how to install one week ago, & i have read many thread & reply here on the forum before i signed in. & thank you all for all your reply & help on this community.

NEXT STEP: Chan_dongle huawei on local Raspberry Pi & connecting 2 PBX one local & other hosted on aws

Unless the trunk provider uses Asterisk, they cannot be using chan_sip. Whilst small providers might use it, even if they do so, with sensible settings, chan_sip should interwork well with chan_pjsip, as they are both part of Asterisk, so will have been tested against each other.

If you mean that there was some specific incompatibility between their implementation of SIP and chan_pjsip’s, it is important to be specific about that, as chan_sip is being removed from Asterisk and it is important to know if there are any incompatibility’s with providers’s implementation of SIP. Both chan_sip and chan_pjsip attempt to implement the same, SIP, protocol.

chan_dongle has rather limited support, and is not an official part of Asterisk, not even as community supported. You would probably be better off using a dedicated SIP based mobile terminal. Also note that you should not expect DTMF to work over an inbound mobile connection.

Thank you for your reply,
sorry maybe i have not well formated my text i will edit the my reply,

when i talked to Trunk provider i said that i added a the trunk pjsip & not working, they tell me that it will work only on sip &
" they really restrict the use of their service. "

& the problem i got are that first i enabled only chan_pjsip on my freepbx, after i changed to both & got the trunk to work, bit not my extension i don’t really know how & why, because when i reinstalled fresh server with both enabled & i made the same settings & but with the step i posted on my reply & now all things are working (trunk) & extension…

For chan_dongle i know, i have already setup a VM working with chan_dongle module, im waiting for the huawei dongle i will receive it maybe in next 48 or 72h & i will try it. my need are only inbound & outbound call

PJSIP is SIP, period. It doesnt matter so they are wrong.