How to setup an SIP proxy server?

I need to set up an SIP proxy server in order to connect to an SIP server in China. My set up is like this:

[pjsip.my.asterisk.server on AWS/Ubuntu outside China] → [my.siproxd.server on Alibaba/Ubuntu in China, running siproxd 0.8.4 with plugin_siptrunk] → [sip.my.service.provider in China]

I had initially tried to set up Asterisk/FreePBX on my.siproxd.server, then configure IAX2 to connect the two servers – it was unreliable, a lot to do with the Great Firewall of China. So I thought perhaps need a light-weight solution to reduce the traffic between the 2 servers, and came upon siproxd server. However, after playing around with all sorts of configurations, I can’t get pjsip.my.asterisk.server to register with sip.my.service.provider – nothing to do with Great Firewall of China, I can see UDP packets flowing, so it must be my configuration. Would any one here have experience setting up an SIP proxy server?

Here’s my setup:
[pjsip.my.asterisk.server on AWS/Ubuntu outside China]
FreePBX Configuration

username:[email protected]
SIP Server Port: 5060
Outbound Proxy: sip:my.siproxd.server

[my.siproxd.server on Alibaba/Ubuntu in China, running siproxd 0.8.4 with plugin_siptrunk]
siprox.conf Configuration

if_inbound = eth0
if_outbound = eth0* (see NOTE below)
host_outbound = sip.my.service.provider
hosts_allow_reg = pjsip.my.asterisk.server
sip_listen_port = 5060
load_plugin=plugin_siptrunk.so # Debian changes to use .so extensions
plugin_siptrunk_name=abcd
Plugin_siptrunk_account=sip:[email protected]
plugin_siptrunk_numbers_regex=^.*$

* NOTE: I did notice that, on Alibaba Cloud, eth0 refers to Private IP, there is no interface for Public IP …

[sip.my.service.provider in China]

I have already confirmed: not firewall issue, not port # issue, not TCP/UDP issue – as mentioned, both servers have correctly seen UDP packets flowing …

I don’t understand how this would make a difference to the level of traffic.

Otherwise, this seems to be almost entirely about the cloud hosting and and the proxy software, not Asterisk/FreePBX.

Although I have no experience of sending anything other than email and web requests to local companies, across the Chinese border, my guess is that you want to use (unencrypted) UDP SIP, with common codecs, direct to the Chinese service provider.

OK I finally got it working. Will close this topic. To share with any future reader who might be interested:
(1) on FreePBX → Connectivity → Trunks → (any of the trunk) → pjsip settings → Advanced → Outbound Proxy … the value has to be in the format of “sip:your.sip.proxy.server”

(2) on your.sip.proxy.server, install siproxd 0.8.3 or later, enable plugin_siptrunk.la … this is the way to make SIP Proxy work on a Trunk …

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.