[asterisk-users] Call Identifier Logging

Matthew Jordan mjordan at digium.com
Tue Jul 22 14:41:50 CDT 2014


On Tue, Jul 22, 2014 at 2:29 PM, Steve Edwards
<asterisk.org at sedwards.com> 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



More information about the asterisk-users mailing list