Specify multiple valid IPs for incoming trunk?

Tags: #<Tag:0x00007f4f4017ae08> #<Tag:0x00007f4f4017aca0>

(Sholinaty) #1

I have a trunk set up with a provider, that does NOT support a sip Register.

incoming calls from them can come from one of 4 IP addresses.

is there a way to specify on my trunk what the allowed IP addresses are for that trunk?
right now, I have to use allow anonymous sip invite, and I would much rather set the source IPs on the trunk.

if I do not allow anonymous invite, the invite is Rejected as the IP is not known.

(Lorne Gaetz) #2

With a PJSIP trunk, locate the Match Permit field in the trunk settings and populate with list of IPs separated by commas. There is no corresponding setting in chan_sip.

(Sholinaty) #3

thanks @lgaetz
Oddly… it doesnt seem to be working for me?
I have my pjsip trunk set up and working both inbound and outbound if I allow anonymous invites.

my trunk has:
match (Permit):,

if I dial my inbound DID (that worked 30 seconds earlier with Allow Anonymous)
i receive a “that number is not in service” announcement from Freepbx

checking SNGREP for a sip trace, the invite is from, which is indeed in that match pattern.

Checking /var/log/asterisk/full, I see:
"WARNING,“Rejecting unknown SIP connection from"”) in new stack

(Sholinaty) #4

strange update. adding the HOSTNAME into the match(permit) section seems to have resolved this.
even though that hostname’s resolvable IP Addresses are already in my list.


Just guessing here: Though Twilio indeed recommends specifying, pjsip may be interpreting that pedantically as is the ‘network’ address, is the ‘broadcast’ address and only and are valid host addresses. I bet that if you list the four addresses explicitly, it will work.

(system) closed #6

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