EdgeMarc 2900e PoE and Twilio with FreePBX

I wanted to follow up to a previous post I made requesting help setting up an Edgemarc (EM) 2900e PoE:


Link to the device:

I finally have FreePBX, Twilio, and the EM working together. In order to make this happen I did have to call Ribbon for support. The EM was having some issues working with Twilio. Apparently, Twilio does not support SRV lookups and that was causing some issues with the EM. Arthur at Ribbon was very helpful in diagnosing the issue and getting everything up and running.

I have a 50/50 fiber connection going into a ISP owned router. The EM sits behind the ISP router and I have a Cisco SF300-24PP-K9-NA switch behind that along with a Ubiquiti wireless AP. I’m running Sangoma phones. FreePBX is hosted on a Virtual Box VM on an Ubuntu physical server on the LAN.

Couple of notes with the EM. You can’t really turn off the ALG. You can, but you also have to turn off the firewall in order for it to function properly. I didn’t realize this when I purchased it. As it happens, I kind of like the ALG functionality. I don’t have to put FreePBX in a DMZ and I also don’t have to port forward. The ALG also provides Qos and traffic shaping. The ALG seems to be working fine with FreePBX. Also, the EM has a lot of features and options, but the documentation is a bit lacking. The user guide documents all the options, but doesn’t do a good job explaining what those options do necessarily. Even though I am an end user I don’t think Ribbon intends for this particular device to be sold to directly to end users, rather through a partner or service provider. That being said, I did manage to get everything setup properly.

I used the following guides to get everything up and running:

Twilio FreePBX configuration:

EdgeMarc VOS User Guide (search the support portal for the latest version):

EdgeMarc IP-PBX Configuration Doc (on the support portal):
“How to configure an EdgeMarc for SIP trunking with an IP-PBX.”

Follow the Twilio config doc as is, except in FreePBX→Trunks→pjsip Settings→Sip Server. This should be set to the LAN IP of the EM instead of the Twilio SIP Server FQDN. This is because the EM proxies traffic through the ALG. If don’t, you’ll see messages like this from Asterisk SIP debug since the invites are now coming from the EM (

[2019-05-21 13:20:24] NOTICE[9403]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request ‘INVITE’ from ‘“XXXXXXXX” sip:[email protected]’ failed for ‘’ (callid: [email protected]) - No matching endpoint found

Follow the EdgeMarc IP-PBX config doc for “Scenario A” to setup the ALG. “Allowed SIP Servers” are where you whitelist the SIP signaling servers. As it was explained to me by Ribbon, you don’t need to whitelist SIP media servers because the EM dynamically puts holes in the firewall during SIP setup. Twilio has an EM guide that uses B2BUA on the EM, but using the pass through ALG is simpler and cleaner as you don’t need to manipulate the SIP headers.

Finally, on the EM under VoIP→Survivability set “Time (s) between DNS lookups:” to 3600 and make sure “Enable SIP server redundancy:” and “Enable SRV Lookup:” are both unchecked. That solves the issue with Twilio not supporting SRV lookups and lengthens the time between DNS A Name lookups.

The following command were useful:

On FreePBX:

asterisk -vvvvr

sip set debug on/off

On the EM CLI:

To turn on SIP tracing

mandctl log 0x19

To turn off SIP tracing

mandctl log 0

“mand” is the ALG process

System messages are written out to /var/log/messages as the EM is linux based.

I can no longer find the KB article that details how to take a tcpdump from the EM, but the KB article# was 96589. I think support is working to migrate these to their new support portal.

Please don’t hesitate to contact me with any questions or comments.

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