SIP Trunk Over Proxy (matching Ip Of Outbound Proxy In Incomming Calls)

Home » Asterisk Users » SIP Trunk Over Proxy (matching Ip Of Outbound Proxy In Incomming Calls)
Asterisk Users 2 Comments

Hello List

I work at an SIP Provider and we have added and SBC in front of our Voice Switch to protect it.

This requires all our SIP Trunk customers to register via a ‘proxy’.

I struggle with Asterisk to work over a proxy.

This is what I have done so far.

register => username@sip.example.com:password@sbc.example.com

This works fine, asterisk is sending registrations via the SBC to the voice switch defined by URI.

[username]
type=peer secret=password host=sip.example.com outboundproxy=sbc.example.com context=from-ISP-X

From the Dialplan that string is dialed:

Dial(SIP/username/${EXTEN})

This works fine, asterisk sends the call to the outboundproxy defined in the sip.conf section of [username].

Before adding outboundproxy setting, incomming calls were matched because they originated from the host and passed to the correct context.

I have set allowguest=no to challenge all those sip attackers in
[default] who occasionaly managed to call internal extensions defined there.

Now incomming calls do not originate from the ip of sip.example.com anymore, but from the ip of sbc.example.com and are not set to the context [from-ISP-X] but probably to [default] and challenged.

Of course, I could allow guests, but that would bring back the problem of having unwanted calls from sip scanners.

So how do I tell the asterisk to also match calls from the ip of the outbound proxy?

-Benoît Panizzon-

I m p r o W a r e A G – Leiter Commerce Kunden

2 thoughts on - SIP Trunk Over Proxy (matching Ip Of Outbound Proxy In Incomming Calls)

  • Not sure maybe there’s a better solution but I thought about using another peer with type=user for incoming connections.

  • That’s what I’ve done for my connection to the service provider I use (Vitelity), as they have different inbound and outbound hosts/proxies. This works fine.