Search CallerID field with data using command core show channels verbose

Hello

please suggest command to search field CallerID with its associated data like numbers.
I have tried few commands but no result yet.
asterisk -rx “core show channels verbose” | grep ‘CallerID:’ | awk -F 'CallerID: ’ ‘{print $2}’

I recommend that you take a look at AMI interface as it is much more scripted friendly

  1. Please use pre-formatted text tags so the forum doesn’t mung your quotes.
  2. ‘-r’ is redundant.
  3. core show channels concise may be easier to parse.
  4. grep is redundant. Awk can filter input.
  5. In a quick test, I only saw ‘CallerID’ in the header and never with a colon.
  6. IIRC, -F defines FS – the ‘field separators’ – a string of characters to separate fields, not a character string to separate fields. The distinction is important.

Thanks,
I can fetch data with
asterisk -rx “core show channels concise” | awk -F ‘!’ ‘{print substr($8, 4)}’
But it is not my requirement.
My final need is get CallerID data from
asterisk -rx “confbridge list listname”
This is related to periodical attandance of conference users.

Are you sure :slight_smile:

  1. Please use pre-formatted text tags so the forum doesn’t mung your quotes.
  2. ‘-r’ is redundant.

What are you getting versus what are you expecting?

Thanks
Following is getting.
[root@localhost ~]# asterisk -rx “core show channels concise” | awk -F ‘!’ ‘{print substr($8, 4)}’
Giving me output
1234567810
1234567811

My expectation is , I need callerid from following command.
asterisk -rx “confbridge list 6”
1234567810
1234567811
Hope you understood.
thanks

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