Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. dahdi extensions upgrate for autoconfig-buttons-freepbx.sh

dahdi extensions upgrate for autoconfig-buttons-freepbx.sh

Scheduled Pinned Locked Moved Support
4 Posts 3 Posters 104 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    G
    g00d
    wrote on last edited by
    #1

    dahdi extensions upgrate for autoconfig-buttons-freepbx.sh

    add before "# SIP EXTENSIONS"

    # DAHDI EXTENSIONS
    mysql -ENB -u $DBUSER -p$DBPASS -h $DBHOST $DBNAME -e "select s3.data as channel,extension,name as label,s1.data as mailbox,s2.data as context,concat('*',s1.data) as extenvoicemail from users as u left join zap as s1 on u.extension=s1.id and s1.keyword='mailbox' left join zap as s3 on u.extension=s3.id and s3.keyword='dial' left join zap as s2 on u.extension=s2.id where s2.keyword='context' order by extension" | sed '/\*\*/d' | sed 's/: /=/g' | while read LINEA
    do
    echo $LINEA | sed 's/channel=\(.*\)/\n[\1]\ntype=extension/g'
    done
    
    1 Reply Last reply
    0
    • N
      N
      nicolas
      wrote on last edited by
      #2

      Thanks! May I add this snippet to the default script ?

      Best regards,

      1 Reply Last reply
      0
      • G
        G
        g00d
        wrote on last edited by
        #3

        Thanks! May I add this snippet to the default script ?

        Best regards,

        Yes, of course, for this I posted 😉

        and dahdi trunks from "Zap Channel DIDs"
        trunk label = Zap Channel Description

        # DAHDI TRUNKS
        mysql -ENB -u $DBUSER -p$DBPASS -h $DBHOST $DBNAME -e "SELECT concat('DAHDI/',channel) as trunk, description as label, did as did FROM zapchandids ORDER BY zapchandids.channel ASC" | sed '/\*\*/d' | sed 's/: /=/g' | while read LINEA
        do
        echo $LINEA | sed 's/trunk=\(.*\)/\n[\1]\ntype=trunk\nlabel=\1/g'
        done
        
        1 Reply Last reply
        0
        • J
          J
          jmituzas
          wrote on last edited by
          #4

          I have tried this, and upon running it, I get this output:

          Usage: sed [OPTION]... {script-only-if-no-other-script} [i]...

          -n, --quiet, --silent
          suppress automatic printing of pattern space
          -e script, --expression=script
          add the script to the commands to be executed
          -f script-file, --file=script-file
          add the contents of script-file to the commands to be executed
          -i[SUFFIX], --in-place[=SUFFIX]
          edit files in place (makes backup if extension supplied)
          -c, --copy
          use copy instead of rename when shuffling files in -i mode
          (avoids change of input file ownership)
          -l N, --line-length=N
          specify the desired line-wrap length for the `l' command
          --posix
          disable all GNU extensions.
          -r, --regexp-extended
          use extended regular expressions in the script.
          -s, --separate
          consider files as separate rather than as a single continuous
          long stream.
          -u, --unbuffered
          load minimal amounts of data from the input files and flush
          the output buffers more often
          --help display this help and exit
          --version output version information and exit

          If no -e, --expression, -f, or --file option is given, then the first
          non-option argument is taken as the sed script to interpret. All
          remaining arguments are names of input files; if no input files are
          specified, then the standard input is read.

          E-mail bug reports to: <!-- e --><a href="mailto:bonzini@gnu.org">bonzini@gnu.org</a><!-- e --> .
          Be sure to include the word sed'' somewhere in the Subject:'' field.
          ERROR 2005 (HY000): Unknown MySQL server host '-e' (1)
          autoconfig-dahdi-trunks-freepbx.sh: line 3: /**/d: No such file or directory

          What am I doing wrong?

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups