FreePBX | Register | Issues | Wiki | Portal | Support

Anonymous SIP calls

siptrunk
asterisk
Tags: #<Tag:0x00007fb907a04b38> #<Tag:0x00007fb907a046d8>

#1

Hi, I am a newbie here so if I posted this in the wrong forum my apologies.

My question relates to the following issue…

I have defined a SIP trunk to my VSP who has 5 servers within a class-C subnetwork. No problems with setting up the trunk but when I call one of my in dial numbers, I noted that that SIP call is sent from a different server in the same subnetwork as the one which is used to set up the trunk. That is, if the registration is with x.x.x.1 the actual SIP call comes from x.x.x.5, for example.

In this case, once the call hits my Asterisk server, it logs it as “Received incoming SIP connection from unknown peer to XXXXXXX” and since I have gone with the default Reject Anonymous SIP calls in the Asterisk setting the call gets rejected. The only way I can get this call through, of course, is by changing the Asterisk SIP settings to accept anonymous SIP calls.

In the incoming SIP on the trunk, I have specified to accept calls from the VSP sub-network - ie. permit=x.x.x.0/255.255.255.0 which I thought would tell Asterisk that the call is coming from a known SIP peer.

I am sure there must be a way to fix this problem without opening up Asterisk to anonymous calls and would appreciate any suggestions. (running FreePBX 14.0.1.20 RasPBX)

Thanks again.


#2

Two idea that come to mind are:

  1. A trunk for each IP

  2. Can you use a domain name for the host rather than specific IPs?


(Dave Burgess) #3

This is the recommended course.

You can, but because of the way DNS works, this is not likely to work the way you want it to.


#4

If using pjsip, just list the 5 addresses in PJSIP Settings -> Advanced -> Match. With chan_sip, I agree with cynjut that setting up five trunks is best.


#5

@cynjut, @comtech, Thanks so much for the responses. As already pointed out using the dns name points to 5 addresses and hence the issue. Setting up peer connections to each does fix my issue.

Many thanks.


#6

@Stewart1 - thanks for the suggestion - will change the sip driver and give it a go.


#7

It appears the better option is to use pjsip which automatically picks up all the hosts from dns lookup and adds them as permitted hosts - a more elegant solution.

Thanks all.