1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PIONEERS The New Kid: Introducing VitalPBX

Discussion in 'Developers' Corner' started by nerdvittles, Mar 19, 2018.

  1. jrglass

    jrglass Guru

    Joined:
    Oct 18, 2007
    Messages:
    285
    Likes Received:
    19
    Ward,

    I spun a droplet on DO per instruction. I ran the commands listedand got the following
    Retype new password:
    [root@centos-s-2vcpu-4gb-nyc3-01 ~]# cd /root
    [root@centos-s-2vcpu-4gb-nyc3-01 ~]# wget https://raw.githubusercontent.com/wardmundy/VPS/master/vps.sh
    -bash: wget: command not found
    [root@centos-s-2vcpu-4gb-nyc3-01 ~]#

    I used CentOS 7.4 x64

    TIA,

    Jeff



     
  2. tbrummell

    tbrummell Guru

    Joined:
    Jan 8, 2011
    Messages:
    494
    Likes Received:
    30
    yum install wget
     
  3. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    #23 wardmundy, Mar 23, 2018
    Last edited: Mar 23, 2018
  4. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    Here's the reply from the VitalPBX folks to my call forwarding workaround where you set up an extension to be used to call forward to an external number, adding this extension to your ring group.

    *58 is the step to configure the CFI external number for an extension. You can further customize it...

    1. Go to the Extensions Status module, that is located under PBX >> Extensions >> Extensions Status
    [​IMG]
    2. Click in the button located in the actions column, This will launch a modal to configure the different kinds of CF
    [​IMG]
    3. In the modal that appear after to click the button, you will be able to configure the CFI or any other diversion
    [​IMG]



    4. After configure your diversions, click in the save button, and don't forget to apply changes
    [​IMG]
    So, Those are the steps to configure the CFI or any other diversion from the GUI. however, in the next version we will include the possibility to add external numbers to ring-groups.
     
  5. tbrummell

    tbrummell Guru

    Joined:
    Jan 8, 2011
    Messages:
    494
    Likes Received:
    30
    And "Confirm Calls"? :)
     
  6. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    Apparently not, and the other workaround doesn't work either:

     
  7. tbrummell

    tbrummell Guru

    Joined:
    Jan 8, 2011
    Messages:
    494
    Likes Received:
    30
    Well without Confirm Call I can't use this in our current design. I can't have the calls being answered by users personal voicemail while we're waiting for someone live to pick up the call.
    Damn, I had high hopes for this distribution. It is great in everything else it does that I would use, so far at least. I would miss Superfecta notifying my Kodi devices of calls, but not a deal breaker.
     
  8. jrglass

    jrglass Guru

    Joined:
    Oct 18, 2007
    Messages:
    285
    Likes Received:
    19
    Can you ADD FQDN to Vital PBX. If so how?

    TIA
    Jeff
     
  9. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    At the moment, add-fqdn wouldn't do much because all of the services are wide open anyway. Next week's article will walk you through setting up a whitelist firewall with VitalPBX. Then it would make more sense although, unlike IPtables, VitalPBX's firewalld doesn't support FQDNs at all so we'll have to come up with an intermediate lookup source to translate FQDNs into IP addresses that firewalld understands. Not sure whether we'll get this done by next week, but it is on our to-do list.
     
    #30 wardmundy, Mar 26, 2018
    Last edited: Mar 26, 2018
  10. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    @jrglass: We have ported the TM3 utilities including add-fqdn to VitalPBX. Assuming testing goes well, all of it (including the scripts) will be in next week's article.
     
    #31 wardmundy, Mar 27, 2018
    Last edited: Mar 27, 2018
  11. jerrm

    jerrm Guru

    Joined:
    Sep 23, 2015
    Messages:
    332
    Likes Received:
    112
    If it helps - snippets from my equivalent of TM3-like code is below. This is been in production forever, but is not in the form I would usually publish. Quick and dirty code that was always intended to be improved, but has always worked.

    Probably a thousand ways to break it, but it is assumed whoever is editing the config files has some idea of what is going on.

    Reads lists of IPs/CIDRs/FQDNs from a config file, outputs a list of resolved IPs/CIDRs. Full version goes on to update iptables rule chains - I never do an iptables "restart." IPs are added/removed as needed. Assumes IPv4 specific use, could be modified to support IPv6.

    Should be very portable. The functions are written to be compatible on embedded systems with limited busybox builds, so the chosen methods & utilities seem a little odd.

    Code:
    #!/bin/sh
    
    inifile="./pbx.fw.ini"
    inisection1=pbx.trunk
    inisection2=pbx.phone
    
    cleanit() {
      sed 's/^[\t ]*//;s/[\t ]*$//;s/#.*$//;/^$/d'
    }
    
    readini() {
      [ -r "$2" ] && sed -n -e "/^\s*\[$1]\s*$/,/^\s*\[.*]\s*$/{ /^\s*\[$1]\s*$/d; /^\s*\[.*]\s*$/d; p; }" "$2"  || echo "readini[$1]: Bad File $2" 1>&2
    }
    
    lookupips() {
      ipv4='\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b'
    
      echo $1 | grep -E "^$ipv4" || {
        lookup=$(nslookup "$1" | grep -E "$ipv4")
        server=$(echo "$lookup" | grep "^Server. *" | grep -E -o "$ipv4")
        echo "$lookup" | grep -v $server | grep -E -o "$ipv4"
      }
    }
    
    ipsort() {
    sort -u | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
    }
    
    listips() {
      {
      local i=""
      for i in $( echo "$1" | cleanit )
      do
        lookupips "$i"
      done
      } | ipsort
    }
    
    
    newips="$(listips "$(readini $inisection1 $inifile)" )"
    echo "
    $inisection1:
    ------------------
    $newips
    =================="
    
    newips="$(listips "$(readini $inisection2 $inifile)" )"
    echo "
    $inisection2:
    ------------------
    $newips
    =================="
    
    Sample config file:
    Code:
    [pbx.trunk]
    # voip.ms
    atlanta.voip.ms
    atlanta2.voip.ms
    
    # vitelity registered
    inbound33.vitelity.net
    
    # vitelity sbc
    64.2.142.90
    64.2.142.0/24
    66.241.96.0/24
    66.241.97.0/24
    66.241.99.0/24
    66.241.107.0/24
    66.241.109.0/24
    140.239.143.0/24
    207.166.136.0/24
    207.166.137.0/24
    
    
    [pbx.phone]
    www.pbxinaflash.com #home office
    www.cisco.com #my cell phone
    
    
    Sample output:
    Code:
    pbx.trunk:
    ------------------
    64.2.142.0/24
    64.2.142.90
    66.241.96.0/24
    66.241.97.0/24
    66.241.99.0/24
    66.241.99.22
    66.241.107.0/24
    66.241.109.0/24
    72.9.246.170
    75.127.65.130
    140.239.143.0/24
    207.166.136.0/24
    207.166.137.0/24
    ==================
    
    pbx.phone:
    ------------------
    104.112.243.234
    178.32.147.114
    ==================
    
     
    #32 jerrm, Mar 27, 2018
    Last edited: Mar 27, 2018
    wardmundy likes this.
  12. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    Thanks, @jerrm. That's quite similar to TM3. But the problem with VitalPBX is they use firewalld instead of plain old IPtables, and firewalld doesn't support FQDNs at all. So we've reworked the TM3 design for VitalPBX so that Travelin' Man 3 with FQDN support can coexist with VitalPBX's firewalld and Fail2Ban setup. That took more than a little head scratching. I've covered the entire redesign in the upcoming article so I won't repeat it here other than to note that users will get the best of both worlds without throwing out the very creative firewalld implementation that's included in VitalPBX.
     
  13. hawk#1

    hawk#1 Member

    Joined:
    Nov 3, 2015
    Messages:
    39
    Likes Received:
    15
    wardmundy likes this.
  14. Todd Freeman

    Todd Freeman New Member

    Joined:
    Apr 9, 2018
    Messages:
    4
    Likes Received:
    1
    Does anyone know if VitalPBX is compatible with Anveo Direct?
     
    Merlin likes this.

Share This Page