SIP Trunk Setup

I’m setting up a SIP trunk with a local telco / provider. It’s a private network, the installer handed me a cable from their router and said have fun.

I set the FPBX up with the static IP / network they assigned to me. The trunk said it’s available, I had setup in / out routes, but wasn’t able to make calls in or out. Their support, tells me that they send SIP OPTIONS every 10 seconds and if there is no response the trunk becomes locked.

They reset the trunk and I was able to make a call out, inbound was still not working and no indication in the logs on the FPBX that a call was being negotiated. I made some changes but the trunk locked out again and now the trunk says unavailable, reverted the changes and its still not available.

When the trunk was reset I was seeing our server replying with a 200 OK to the incoming OPTIONS. Yet the provider claims they were not seeing a response from our server when this was happening, so the trunk locked out after 30 seconds.

Firewall is off on FPBX and at one point when the trunk was up, we were sending OPTIONS and receiving a 200 OK back. I find it hard to believe they couldn’t see us. I’m a noob that knows enough to be dangerous, and while I’m thinking I have something not right on the FPBX, the lockout setup their end is frustrating. Any advice is welcome.

Are you in the USA ? Do you have to use that provider ? Is the telco provider also the internet provider ? Do you have a separate firewall in front of Free PBX, like pfSense or anything ? or is it exposed to the internet directly ? So, if your system goes down, like a power outage, the telcos system then locks you out till you have them reset it, so if the power comes back online you can not get or make calls again till big brother give you permission ?

zero support plus that setup (if I am understanding that properly) seems it will be REALLY painful moving forward.

I could set you up on Twilio as a SIP Trunk and have you running in like 15 minutes, 30 at most maybe.

I’m in Canada, and no… we don’t necessarily have to use this provider, but I know our company would most likely want to continue to do business with them. Yes, the Telco is also the internet provider where we source our fiber from. This is in the testing phase, it’s a private network with no exposure to the Internet, with no firewall (the firewall is also turned off in FPBX). I expressed my concern that the trunk could go into lockout if we were doing maintenance, and i didn’t want to wait until ‘big brother’ reset it. I have yet to hear from them on that point. Yes it’s been really painful, and I can’t troubleshoot anything as the trunk is in lock state… yet they want to blame my configuration. And possibly I have something wrong, but it’s difficult to know exactly whats going on in this scenario.

If you really want to use them call them and tell them you DO NOT want a SIP hand off you want a POTS handoff. Most likely they are already using a “modem” that has a POTS port on it. Then buy a cheap Grandstream HT813 and plug it’s FXO port into their POTS line and configure FreePBX to connect to the HT813

I know it may seem backwards but this is the entire principle behind the Cisco ISR4321 aka “Cisco CUBE” With a Cube you can either do a sip-to-sip back-to-back gateway or you can stuff the ISR full of FXO cards and do POTS handoff from the Telco. Cisco discovered years ago that so many “SIP Providers” like this ridiculous Telco you are using, view the SIP protocol as a chance to hack some non-standard crap into it so as to push their proprietary phone systems and other bullpucky. The CUBE was developed to keep the “Ciscoized SIP” on one interface and the “Telco-hacked SIP” on the other interface and bridge the two. Cisco developed it because so many people were doing the exact same thing with earlier Cisco 2800 and suchlike routers.

And incidentally I don’t see any point in rewarding this Telco by shielding them by not posting who it is in this forum. They clearly don’t give a rat’s ass about their customers, why on Earth do you want to protect this?

Ok, So this FreePBX has no exposure to the internet, then I am honestly not sure how to set that up, especially with a self sabotaging trunk that shuts down if you get something wrong or your system looses power.

Internal extensions do NOT need internet access or even a sip trunk to work. The only reason for a trunk is to connect outside calls (inbound or outbound) But you can set up 2 - 100+ extensions and get them to call each other without a trunk.

If this is just a proof of concept setup, then that is it, making internal desk to desk calls proves it works. You can even set up extensions on cell phones using GroundWire and the cell phone on your internal LAN WiFi and get and place calls to the cell phones. The LAN WiFi is making the cell phones part of your internal network. So set up a desk phone with x1030 and a cell phone with groundwire as x1031 and they can call each other by using the extension number.

Even if you have a multi site VPN, you can still make calls site to site over the LAN, as long as the VPN and firewall is set up correctly to pass traffic from site to site. So a phone extension at 192.168.30.20 at your 2nd site needs to be able to see the FreePBX server at 192.168.1.20 at your primary site, and the FreePBX server in turn needs to be able to see the remote extension phone sitting at the remote site. then you can call each other.

You can still use your Telco company for fiber, but use Twilio as the trunk provider. We have that exact setup in over a dozen clients sites, a couple with multi site VPNs. Think of a Sip Trunk like any other online streaming service, like zoom or teams. The internet service is separate from zoom, Zoom is not anchored to a specific internet provider and only needs an internet connection to work and making sure you are not blocking the ports it uses.

Happy to walk you through setting up a Twilio account and getting it to work, but your FreePBX will need to be able to get traffic forwarded from the internet.

heh, yes it’s been an ‘experience’ and you did hit the nail on the head, they know their systems and you’re left to fend for yourself if you aren’t using what they sell. Thanks for the tip, I’m no stranger to Grandstream’s FXO & FXS boxes and will look into this concept.

How about your own LTE modem? Here in US i pay $10/month for 2Gb of data through Tmobile. It was 30 times cheaper than their local fiber ISP

The FPBX will have access to the internet in it’s final form, just for this setup I wanted it to be super simple and not worry about any routing causing issues. Internal calls are working fine on this test setup, Sangoma S505 on for one ext. and Zoiper as another ext. We have multiple sites with VPN and I have created IAX2 and PJSIP trunks in the past for site to site calling, so I understand what you are saying there. The goal with this PBX is to eliminate 10+ copper analog lines in each site and port them over to SIP. I suppose it’s slightly cheaper to go with a PRI, but seems to me this is more complicated than it needs to be with the current provider.

If you go over to twilio and use their AI help bot (I am not a big fan of AI, but this thing actually works very well) You can get pricing estimates based on the number of DiD numbers, inbound and outbound calls you would make.

I usually have to reload the page 1 time when I first land there for it to show up properly.

This is the question I asked “For Sip Trunking, What would the rough cost be per month, to have 6 Did numbers, 2000 inbound calls at roughly 5 minutes each, and 500 outbound calls at roughly 4 minutes each”

This is the response it gave :

Here’s a rough monthly cost estimate for your SIP trunking scenario in the United States, based on Twilio’s current public pricing:

  1. DID (Local) Numbers

    6 local numbers × $1.15/month = $6.90/month

  2. Inbound Calls (Origination)

    2,000 inbound calls × 5 minutes each = 10,000 minutes
    Inbound rate: $0.0034/minute
    Total inbound cost: 10,000 × $0.0034 = $34.00/month

  3. Outbound Calls (Termination)

    500 outbound calls × 4 minutes each = 2,000 minutes
    Outbound rate: $0.0011/minute
    Total outbound cost: 2,000 × $0.0011 = $2.20/month

Estimated Monthly Total
Item Quantity/Minutes Rate Subtotal
DID Numbers 6 $1.15/number $6.90
Inbound Calls 10,000 minutes $0.0034/min $34.00
Outbound Calls 2,000 minutes $0.0011/min $2.20
Estimated Total $43.10
Notes

Taxes, regulatory fees, and any optional features (like call recording or advanced analytics) are not included.
This estimate assumes all calls are within the US and use standard local numbers.
For international calls or toll-free numbers, rates will differ.

If you need a breakdown for a different country or want to include additional features, let me know!

I’m curious why you’re pushing Twilio so hard. They are a more expensive choice for VoIP minutes than any carrier trunk and many other aggregator providers too. No one in this thread so far is actually trying to help OP with the posted problem, only suggesting alternatives.

I do like Twilio for several reasons but straight SIP trunking is not a strong point for them.

By the way, the AI lied to you. The cost is .0011/minute if you are calling toll-free numbers. Here’s what is posted on their public pricing site:

1 Like

The same reason I push FreePBX so hard and others are tired of hearing me talk about it. When I find a product or service that works, I support it. I LOVE FreePBX as it has made a massive difference for us as a non profit org, and as well the clients we serve. I can get full recorded conversations from FreePBX and transfer calls from land lines to cell phones and back. For many of our clients that are case managers of non profits, that work with people that have “issues”, FreePBX is a game changer tool that allows them to keep in contact without giving out their personal cell phone number, transfer calls to other case managers cell phones and record those conversations entirely in case they get blamed for something - “you said / promised……” - “Well, lets listen to our last conversation together…..” AND we now have statistical data to support their grants in tracking how much time they spend with a particular client on the phone or simple call counts. and it all documented through FreePBX.

So yea, I push FreePBX even harder than Twilio

But, since you brought it up, the why - we used SipStation for about 7 years. The last 18 months to 2 years we have been having all kinds of issues. It worked PERFECTLY for like 5 years, then about 18 months ago, they changed something someplace and it was all downhill from there.. I have personally spent over 200 hours trying to resolve the issue, plus also paid $180 an hour for Sangoma tech support to spend HOURS trying to resolve it too, remote logins, taking over the machine, packet tracing. NO LOVE. We lost our 3 largest clients because of the problem. It scared them so much, they went back to POTS lines !! “The Problem” (and I even posted here in the forums about this) about 50% of the calls to T-Mobile phones, one party cant hear the other. Some calls work, some do not. Sangoma did packet traces and had me send them packet captures, etc. No exaggeration, 200+ hours on this, maybe 10 more from Sangoma.

Over Christmas, I got so irritated (and another client threatening to leave us) I stated a full new setup from scratch, full stack all new hardware : new router, new firewall, new desktop pc for FreePBX, new network switch, new network cables, and a new internet connection and IP Address. Same SipsStation service…. SAME problem. calls to T Mobile cant process.

We had a Twilio account for something completely unrelated for about a year, and I remembered they offer Sip Trunking. I created a Sip trunk and in less than a day I had it fully functional and all calls to T Mobile worked. I switched our trunk back to SipStation, and the same calls failed. switched back to Twilio Trunk and the calls go through. Back to SipStation, calls fail. No other changes made. I have no idea why, but after wasting 200+ hours on this and fixing it in less than 10 with a new provider…. pretty compelling.

Also, a HUGE advantage to Twilio I see is the fact that twilio has full error trapping and error logging, and email alerts. Plus, if our FreePBX drops offline for any reason and it is not reachable by Twilio, I can still retrieve a full report of attempted inbound calls that failed to connect to us.

Which this was exactly what we needed yesterday when we ported a rather important clients phone numbers over to Twilio from the local phone company/ISP on Tuesday, and the local ISP accidentally killed off their internet account completely once the phone numbers disappeared from their account. Apparently the local ISP billing structure for internet service is anchored to the phone numbers on the account. So for 3 days the Consulate had no internet service while the local phone company scrambled to reestablished their internet service and IP address.

I was able to log into our Twilio account and still retrieve the list of all of the people that tried to call them. That would have been impossible with SipStation.

I honestly dont know if Twilio is the least expensive or not, I know it is less than SipStation for our needs. But to us, that is irrelevant in light of the error logging and other tools that SipStation does not have. Honestly, I don’t care about the price when I realize I can troubleshoot almost anything on my own in minutes (and have) and this makes it less likely we are loosing any more clients over “mystery issues.”

So, yes, I am a huge Twilio fanboy now…. hehehe

And Now that I have it working, I can get a new client up and running on it in about 10 minutes If I am doing it myself, Or I can walk someone though the process in about 30 minutes. It takes longer to create the Twilio account than it does to set up the Trunk and get it working.

AND - To answer and address your statement of

YES. Alternatives, Because I can see him facing up to the EXACT same type of upcoming problems of dozens of wasted hours with his ISP trying to resolve issues of them deliberately crippled his trunk and lock him out if something goes wrong, and he has to go back and get big brother to unlock it again. I can easily think of 5-10 really basic issues that would trigger that (a 10 second window), all will result in him loosing the ability to get phone calls from the outside. Power outage, rat chewing a cable, having to reboot the server or the firewall, and more. Yes, those would cause any normal system to not get outside calls, but no where else I ever heard of do I have to contact the ISP again afterwards and get them to reactive the circuit. What if he is on vacation ? Its a predictable outcome of inviting problems to happen. THAT is why I am suggesting alternatives.

have you ever tried Voip.ms? I thimk they are better than twilio

I’m in Ottawa. I’ve used voip.ms in 3 different companies, and never had a peep of an issue with them. And they’re a heckuva lot cheaper, and more responsive, and have much much much better tech support than any of first-line support from the big Canadian Telcos. I’m happy to use the telcos for their Internet connectivity - but its a BIG no for their SIP products.

My first suspicion is your modem. Different brands don’t handle the SIP protocol correctly.

My second suspicion is your firewall on the FPBX server. Even when it is supposedly turned off, it may or may not be meddling with your connection. In particular, check the Intrusion Detection, and make sure it hasn’t added any IP addresses to the “banned” list.. And put your SIP provider’s IP address in the Whitelist.