On Tue, Jul 22, 2014 at 2:29 PM, Steve Edwards <[email protected]> wrote: > On Tue, 22 Jul 2014, Steve Edwards wrote: > >> How about something like: >> >> asterisk -rx "core show channel SIP/spa841-00000003"\ >> | awk '/Call Identifer/ {gsub(/[][]/,""); print $3}' > > > Or: > > > asterisk -rx "core show channel SIP/spa841-00000003"\ > | awk -F'[][]' '/Call Identifer/ {print $2}' >
This is one of those features that is embarrassingly simple and yet, unfortunately, was overlooked. Ideally, it'd be in the CHANNEL function. If anyone is curious, the accessor function you want is ast_channel_callid. It returns the callid ref bumped, so you do have to make sure you decrement the ref count using ast_callid_unref. You can print the callid to the CHANNEL function's buffer using ast_callid_strnprint. -- Matthew Jordan Digium, Inc. | Engineering Manager 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: http://digium.com & http://asterisk.org -- _____________________________________________________________________ -- 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
