Configure Asterisk as SIP outbound proxy (as a SIP server relay)

5.7k views Asked by At

I just installed an Asterisk and i would like to configure Asterisk as a SIP server relay.

I already have a SIP server but this one doesn't accept directly Web Sockets (wss) connections.

enter image description here

The purpose is to have a web client which use SIPJS library : (http://sipjs.com/guides/user-agent-construction/) and which will be able to make a register on sipserver A.

How do I configure sip.js and extension.conf file on asterisk to do that ?

1

There are 1 answers

1
dougBTV On

This likely isn't the answer that you want, but, Asterisk is not a SIP proxy. It's technically a B2BUA (back-to-back user agent).

In short, that means Asterisk is always a kind-of end-point on the call.

You might try using Kamailio which can be used as a stateless relay to act as a SIP proxy, and it's rather good at it.

However, you may be able to B2BUA the call if you can both:

A: Create a trunk from Asterisk to "SIP Server A"

B: Create a client connection from SIP.js to Asterisk. Documentation available for SIP.js specifically for this.

In which case, once the call comes inbound to Asterisk from the SIP.js client, you can bridge calls using the Dial application in Asterisk to make a call to "sip server a"

For example, sip.conf:

[sipjs]
context=inbound_sipjs
; ...and the rest from sip.js documentation

[sipservera]
context=inbound_sipserver
; rest as required with your sip server

Then, in your extensions.conf, assuming an inbound call from SIP.js client:

[inbound_sipjs]

exten => _X.,1,Noop(Call from SIP.js)
same =>      n,Dial(SIP/sipservera/${EXTEN})
same =>      n,Hangup()