This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PBX In A Flash and SIP

Hey Fellas,

Ok so quick question for you.  I recently just setup a killer PBX setup with google voice from here The Incredible PBX.  Ok so now I want to connect a SIP device to my PBXIF box.  I have opened up the SIP port 5060 and forwarded it through DNAT to my PBX box.  I also opened up the other ports 10000-20000 and also sent those where they need to go.  However I cannot for the life of me get sip to work.  I have checked every setting I can think of but no love.  Any help or guidance that you can provide is greatly appreciated and thank you very much for your time.


This thread was automatically locked due to age.
  • Hi,
    rather than the DNAT and all the packet filters try using the VoIP Helper (Network Security -> VoIP). It does all the SIP and other port management for you 

    Ian
  • Ok so I am not sure if I understand exactly the VOiP settings but I did try it out.  However when I removed the DNAT entries it still would not connect, and no matter what combination I did with the VOiP my packet filter logs showed that port 5060 was being blocked.  So just so I understand what I'm doing here in this section.  The SIP Server Networks would be my internal network and the sip server itself because of the fact that its all behind the firewall.  The client networks would be the WAN Network. 

    Ok so like I said I disabled the VOiP for now and put my DNAT rules back into place.  I have attachted screen shots of the firewall configurations.  If you could take a look and make sure that everything here looks kosher.  Thanks.  If this all checks out then it must be something with the FreePBX so I'll have to move onto that after I know that its getting the packets passed back to it.
  • Hi, do you have Masquerading setup for your LAN?

    What are your outgoing packetfilter rules?

    Please post log entries of the dropped traffic.

    Barry
  • Hey Barry,

    Yes my masquerading is setup as it should be.  

    Please find the attached screen shots for my packet filter rules.  I'm able to connect now to my asterisk box using the rules of the attached DNAT screen shot however I do not get any audio at all.
    I would really like to be able to use the VOiP setup as that appears to be quite handy, but I am still unclear on how this should be configured exactly for my setup.

    I don't have anything in my packet filter logs that show the RTP packets dropping.

    The other thing that is going on is that the call connects to wherever but within 60 seconds the call is dropped.  I don't know if that has something to do with my rules or what.  I did follow along with the thread here
    https://community.sophos.com/products/unified-threat-management/astaroorg/f/54/t/40045
    but using that same configuration I am not able to get my clients to connect to the asterisk box. 
    I do have the asterisk box configured for NAT with my dyndns name in the external block. 
    For what its worth I am using the Asterisk FreePBX WebUI to configure my Asterisk box.
    Thank you all for your help with this it is greatly appreciated.  I think that I am close to getting this going.  I do IT work but SIP and RTP and VOiP are all new to me [:)]
  • I don't know if this would make much of a difference or not.  I don't think that it should.  Both of these machines are VM's that are residing on the same physical box.  I have VMWare ESXi server running.  The Astaro is on the same virtual switch for its internal traffic as the rest.  Like I said I don't think that this would cause any issues.  In watching my logs when I set the Astaro DNAT rule to not be full, (which full is the only way that I can get an external SIP device to register) I can see the packets going through the log but Asterisk never registers them.  If I set the DNAT to full then Asterisk will register the device but it treats it like its a local device and not a NAT device.  Thank you for your help with this once again. I know as always in the IT world its usually a stupid setting somewhere that I missed or something.
  • Could someone take a look at the picture of my VOiP helper and tell me if I set that up correctly?  Thanks.
  • I think the sip helper won't work that way.  AFAIK, it thinks the server is outside and client inside.   Is it possible to set up a VPN from the remote site and have your remote IP phone use the internal address?
  • So I got it to work,  I am not sure exactly which item in my trial and error got it to go but its working [:)].  I added my network information to the sip.conf as well as sip_nat.conf.  Oh and I also created another packet filter rule as well.  So hey its working and thats awesome.
  • So I got it to work,  I am not sure exactly which item in my trial and error got it to go but its working [:)].  I added my network information to the sip.conf as well as sip_nat.conf.  Oh and I also created another packet filter rule as well.  So hey its working and thats awesome.


    Could you share your setup?  I'm also attempting to get PBX in a flash to work with astaro security gateway and I'm having zero success.
  • Could you share your setup?  I'm also attempting to get PBX in a flash to work with astaro security gateway and I'm having zero success.


    Ok so first off I followed the setup that Mr. Fuzz did in the link up above.  Found out after the fact that you don't need to modify any of the FreePBX files like sip.conf sip_nat_custom.conf or any of those.  
    You also don't need the VOiP helper either
    Ok so after I got all of that setup I still could not connect to my server, so I started to tail the log files under /var/log/asterisk/full (tail -f /var/log/asterisk/full) Then I started to see stupid errors showing up in the log file where you could see that the device was trying to connect to the extension but it wasn't btw you can also add grep to your tail command tail -f /var/log/astersik/full | grep (your extension number)
    So after seeing this I decided for the time being to disable IPTables and fail2ban 
    /etc/init.d/iptables stop and /etc/init.d/fail2ban
    BTW keep in mind that I am doing all of this on my PBX box not the Astaro box
    After I did that my external sip device authenticated with the server
    Once you can do that and make sure that you can authenticate turn back on iptables and fail2ban
    /etc/init.d/iptables start && /etc/init.d/fail2ban start
    Ok now go back to your FreePBX web page and go to extensions, click on the extension that you want to be able to use remotely
    Scroll down to where the permit and deny section is, change the permit IP to the IP of the remote location if the remote location has a static IP or just change it to 0.0.0.0/0.0.0.0
    Once you are all done with that double check your sip settings under tools > sip and make sure that you are setup for Nat and you have the right IP settings in place.
    All done activate your changes and you should be good to go. If you are not let me know.