On Tue, 22 Jul 2014, Steven Wheeler wrote:

Try this:

CDR(userfield) = "${SHELL(asterisk -rx "core show channel ${CHANNEL}" | grep "Call 
Identifer" | cut -d: -f2 | cut -d[ -f2 | cut -d] -f1 | cut -d\n -f1):0:-1}";

Not really interested in this topic, but invoking 6 processes seems a bit excessive :)

How about something like:

        asterisk -rx "core show channel SIP/spa841-00000003"\
                | awk '/Call Identifer/ {gsub(/[][]/,""); print $3}'

Of course, a dialplan function would be best.

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       [email protected]      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to