"sed" and "awk" gurus - some help with parsing...

Discussion in 'General' started by torontob, May 30, 2010.

  1. torontob

    May 18, 2008
    Likes Received:
    Hi Guys,

    I have a trunk that I want to place calls through it with only 1 or 2 channels at certain times. So, I have a smart context which checks for time but since the calls are placed through A2Billing, I can't use GROUP and GROUP_COUNT functions (or at least I don't know how to put them to use; if someone can guide me on those for my purpose it would be amazing).

    So, I am looking into sed and awk to see how many channels are up. Something along this line:

    gawk -F: '{ print $1 $2 }' | asterisk -rx "sip show channels"

    But above really doesn't work. Hence, I need help from awk and sed gurus to fix above so that the output would be something like this:

    Peer User/ANR Call ID Format Hold Last Message (None) 1494f1886210ef1 0x0 (g729) No Rx: REGISTER (None) 354739ec53a364b 0x0 (ulaw) No Rx: REGISTER

    So, using awk I should output: g729 ulaw

    But that doesn't happen.

    Anyone can guide please?


Share This Page