[asterisk-users] Call Identifier Logging

2014-07-21 Thread Steven Wheeler
Hello,
I am working on upgrading from Asterisk 1.8 to Asterisk 11.6. One of the 
features we are excited for is Call Identifier 
Logging. 
However, it doesn't appear that this new Call ID is accessible from the dial 
plan. Ideally we would like to store this Call ID in the CDR. Does anyone know 
if this is possible?

I could do something like this, but it seems like a terrible hack:
same => n,Set(CALLID=${SHELL(asterisk -rx "core show channel ${CHANNEL}" | grep 
' Call Identifer' | egrep -o 'C-[0-9a-f]+')})

Also as a side note, in the core show channel output ' Identifier' is misspelt 
as ' Identifer'
Steven Wheeler


-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Rafael dos Santos Saraiva
Hi
I tried this in ael:
_000. => {
Proceeding();
callident = "${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}";
NoOp(${callident}});
Dial(Motif/google/+${EXTEN:3}@voice.google.com,,r);
hangup;
}

And worked perfectly.

It would be interesting, the developer team add a variable to channel with
this data.




Att,
*Rafael dos Santos Saraiva*



2014-07-21 18:59 GMT-03:00 Steven Wheeler :

>  Hello,
>
> I am working on upgrading from Asterisk 1.8 to Asterisk 11.6. One of the
> features we are excited for is Call Identifier Logging
> .
> However, it doesn't appear that this new Call ID is accessible from the
> dial plan. Ideally we would like to store this Call ID in the CDR. Does
> anyone know if this is possible?
>
>
>
> I could do something like this, but it seems like a terrible hack:
>
> same => n,Set(CALLID=${SHELL(asterisk -rx "core show channel ${CHANNEL}" |
> grep ' Call Identifer' | egrep -o 'C-[0-9a-f]+')})
>
>
>
> Also as a side note, in the core show channel output ' Identifier' is
> misspelt as ' Identifer'
>
> *Steven Wheeler*
>
>
>
> --
> _
> -- 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
>
-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Eric Wieling
Making LinkedID available in the dialplan would also be useful.

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Rafael dos Santos 
Saraiva
Sent: Tuesday, July 22, 2014 1:44 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Call Identifier Logging

Hi
I tried this in ael:
_000. => {
Proceeding();
callident = "${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}";
NoOp(${callident}});

Dial(Motif/google/+${EXTEN:3}@voice.google.com<mailto:exten%3a3...@voice.google.com>,,r);
hangup;
}

And worked perfectly.

It would be interesting, the developer team add a variable to channel with this 
data.




Att,
Rafael dos Santos Saraiva
[http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15_pt_BR.png]<http://br.linkedin.com/pub/rafael-saraiva/52/aab/230>

2014-07-21 18:59 GMT-03:00 Steven Wheeler 
mailto:swhee...@usinternet.com>>:
Hello,
I am working on upgrading from Asterisk 1.8 to Asterisk 11.6. One of the 
features we are excited for is Call Identifier 
Logging<https://wiki.asterisk.org/wiki/display/AST/Call+Identifier+Logging>. 
However, it doesn't appear that this new Call ID is accessible from the dial 
plan. Ideally we would like to store this Call ID in the CDR. Does anyone know 
if this is possible?

I could do something like this, but it seems like a terrible hack:
same => n,Set(CALLID=${SHELL(asterisk -rx "core show channel ${CHANNEL}" | grep 
' Call Identifer' | egrep -o 'C-[0-9a-f]+')})

Also as a side note, in the core show channel output ' Identifier' is misspelt 
as ' Identifer'
Steven Wheeler


--
_
-- 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

-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Richard Mudgett
On Tue, Jul 22, 2014 at 12:45 PM, Eric Wieling  wrote:

> Making LinkedID available in the dialplan would also be useful.
>

LinkedID is already available in the dialplan: CHANNEL(linkedid)

Richard
-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Eric Wieling
Which version was that added?  I don’t see it on my 11.10.0

[daffy-01 ~]# asterisk -rx "core show function CHANNEL" | grep -i link
[daffy-01 ~]#

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Richard Mudgett
Sent: Tuesday, July 22, 2014 1:56 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Call Identifier Logging



On Tue, Jul 22, 2014 at 12:45 PM, Eric Wieling 
mailto:ewiel...@nyigc.com>> wrote:
Making LinkedID available in the dialplan would also be useful.

LinkedID is already available in the dialplan: CHANNEL(linkedid)
Richard

-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Steven Wheeler
Making LinkedID available in the dialplan would also be useful.
LinkedID is already available in the dialplan: CHANNEL(linkedid)
Which version was that added?  I don’t see it on my 11.10.0

[daffy-01 ~]# asterisk -rx "core show function CHANNEL" | grep -i link
[daffy-01 ~]#


According to funcs/func_channel.c
468 else if (!strcasecmp(data, "linkedid")) {
469 ast_channel_lock(chan);
470 if (ast_strlen_zero(ast_channel_linkedid(chan))) {
471 /* fall back on the channel's uniqueid if 
linkedid is unset */
472 ast_copy_string(buf, 
ast_channel_uniqueid(chan), len);
473 }
474 else {
475 ast_copy_string(buf, 
ast_channel_linkedid(chan), len);
476 }
477 ast_channel_unlock(chan);

While useful, that doesn't solve the problem of being able to store the 
channel's logging identifier in CDR.

Steven Wheeler
-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Eric Wieling
Where is this documented?


From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steven Wheeler
Sent: Tuesday, July 22, 2014 2:08 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Call Identifier Logging

Making LinkedID available in the dialplan would also be useful.
LinkedID is already available in the dialplan: CHANNEL(linkedid)
Which version was that added?  I don’t see it on my 11.10.0

[daffy-01 ~]# asterisk -rx "core show function CHANNEL" | grep -i link
[daffy-01 ~]#


According to funcs/func_channel.c
468 else if (!strcasecmp(data, "linkedid")) {
469 ast_channel_lock(chan);
470 if (ast_strlen_zero(ast_channel_linkedid(chan))) {
471 /* fall back on the channel's uniqueid if 
linkedid is unset */
472 ast_copy_string(buf, 
ast_channel_uniqueid(chan), len);
473 }
474 else {
475 ast_copy_string(buf, 
ast_channel_linkedid(chan), len);
476 }
477 ast_channel_unlock(chan);

While useful, that doesn't solve the problem of being able to store the 
channel's logging identifier in CDR.

Steven Wheeler
-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Rafael dos Santos Saraiva
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}";


Att,
*Rafael dos Santos Saraiva*



2014-07-22 15:08 GMT-03:00 Steven Wheeler :

>  Making LinkedID available in the dialplan would also be useful.
>
> LinkedID is already available in the dialplan: CHANNEL(linkedid)
>
> Which version was that added?  I don’t see it on my 11.10.0
>
>
>
> [daffy-01 ~]# asterisk -rx "core show function CHANNEL" | grep -i link
>
> [daffy-01 ~]#
>
>
>
>
>
> According to funcs/func_channel.c
>
> 468 else if (!strcasecmp(data, "linkedid")) {
>
> 469 ast_channel_lock(chan);
>
> 470 if (ast_strlen_zero(ast_channel_linkedid(chan))) {
>
> 471 /* fall back on the channel's uniqueid if
> linkedid is unset */
>
> 472 ast_copy_string(buf,
> ast_channel_uniqueid(chan), len);
>
> 473 }
>
> 474 else {
>
> 475 ast_copy_string(buf,
> ast_channel_linkedid(chan), len);
>
> 476 }
>
> 477 ast_channel_unlock(chan);
>
>
>
> While useful, that doesn't solve the problem of being able to store the
> channel's logging identifier in CDR.
>
>
>
> *Steven Wheeler*
>
> --
> _
> -- 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
>
-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Steven Wheeler
Making LinkedID available in the dialplan would also be useful.
LinkedID is already available in the dialplan: CHANNEL(linkedid)
Which version was that added?  I don’t see it on my 11.10.0

[daffy-01 ~]# asterisk -rx "core show function CHANNEL" | grep -i link
[daffy-01 ~]#


According to funcs/func_channel.c
468 else if (!strcasecmp(data, "linkedid")) {
469 ast_channel_lock(chan);
470 if (ast_strlen_zero(ast_channel_linkedid(chan))) {
471 /* fall back on the channel's uniqueid if 
linkedid is unset */
472 ast_copy_string(buf, 
ast_channel_uniqueid(chan), len);
473 }
474 else {
475 ast_copy_string(buf, 
ast_channel_linkedid(chan), len);
476 }
477 ast_channel_unlock(chan);

While useful, that doesn't solve the problem of being able to store the 
channel's logging identifier in CDR.

Steven Wheeler

Where is this documented?

It does not appear to be documented. However, there is a reference in the 
Asterisk: The Definitive 
Guide.

Steven Wheeler

-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Steven Wheeler
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}";

Att,
Rafael dos Santos Saraiva

This isn't a suitable long term solution as it requires launching several 
external processes just to gain access to an internal variable. It is also 
likely to create bugs in the future if someone changes the output of that 
command. For instance if they fix the typo in "Call Identifer".

Steven Wheeler

-- 
_
-- 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

Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Steve Edwards

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-0003"\
| awk '/Call Identifer/ {gsub(/[][]/,""); print $3}'

Of course, a dialplan function would be best.

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  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


Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Steve Edwards

On Tue, 22 Jul 2014, Steve Edwards wrote:


How about something like:

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


Or:

asterisk -rx "core show channel SIP/spa841-0003"\
| awk -F'[][]' '/Call Identifer/ {print $2}'

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  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


Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Matthew Jordan
On Tue, Jul 22, 2014 at 2:29 PM, Steve Edwards
 wrote:
> On Tue, 22 Jul 2014, Steve Edwards wrote:
>
>> How about something like:
>>
>> asterisk -rx "core show channel SIP/spa841-0003"\
>> | awk '/Call Identifer/ {gsub(/[][]/,""); print $3}'
>
>
> Or:
>
>
> asterisk -rx "core show channel SIP/spa841-0003"\
> | 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


Re: [asterisk-users] Call Identifier Logging

2014-07-22 Thread Rafael dos Santos Saraiva
Really, a dialplan function would be best. I too don't like of an idea of
using a external process to get internal variables, but when necessary...
 :(


Att,
*Rafael dos Santos Saraiva*



2014-07-22 16:29 GMT-03:00 Steve Edwards :

> On Tue, 22 Jul 2014, Steve Edwards wrote:
>
>  How about something like:
>>
>> asterisk -rx "core show channel SIP/spa841-0003"\
>> | awk '/Call Identifer/ {gsub(/[][]/,""); print $3}'
>>
>
> Or:
>
> asterisk -rx "core show channel SIP/spa841-0003"\
> | awk -F'[][]' '/Call Identifer/ {print $2}'
>
> --
> Thanks in advance,
> -
> Steve Edwards   sedwa...@sedwards.com  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
>
-- 
_
-- 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