Re: [asterisk-users] peer IP address in CDR

2010-06-30 Thread Philipp von Klitzing
Hi!

> For codecs use CHANNEL function, but you will only get CallLegA
> codecs. Without hacking Asterisk, you will not be able to get CallLegB
> codecs. Patch for Asterisk 1.4.33.1 attached to get such info. 

Thank you! In the meanwhile I found that with the help of the M option to 
Dial (macro called right after connect) it is possible to access also the 
bridged CHANNEL variables including "audionativeformat" - but those 
variables will already be destroyed before you get to the h extension.

Now I would like to find a way how to add some "adaptive" functionality 
to MySQL CDR in asterisk-addons for Asterisk 1.4 that can append self-
chosen fields to the cdr table (like: codec). It appears that patch 11642 
doesn't - anymore - do that successfully:

https://issues.asterisk.org/view.php?id=11642

So far I do not want to switch to ODBC (Tilghman was so kind to make a 
backport available). Note: asterisk-addons for Asterisk 1.6 is not 
compatible with Asterisk 1.4. I'd also prefer to avoid to write to MySQL 
(or AstDB as a means to export variables from the bridged channel to the 
originating channel) directly from the dialplan.

Philipp


-- 
_
-- 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] peer IP address in CDR

2010-06-30 Thread Mindaugas Kezys
For codecs use CHANNEL function, but you will only get CallLegA codecs.
Without hacking Asterisk, you will not be able to get CallLegB codecs.

Patch for Asterisk 1.4.33.1 attached to get such info.

Retrieve such info with variables:

RTPAUDIOQOS
BRTPAUDIOQOS

And even more:

LEG1DATA
LEG2DATA

In format: 

uniqueid|accountcode|chan_type|audionativeformat|audioreadformat|audiowritef
ormat|language|hangupcause|peerip|recvip|from|uri|useragent|

example:

LEG2DATA:
1277817284.0|7|SIP|alaw|alaw|alaw|en|16|192.168.0.148|192.168.0.148|sip:1003
@173test|sip:1...@192.168.0.148:5061|X-PRO build 1082

Regards,
Mindaugas Kezys

Kolmisoft UAB 
VoIP Billing Solutions
e-mail: i...@kolmisoft.com
URL: http://www.kolmisoft.com


-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Philipp von
Klitzing
Sent: Tuesday, June 29, 2010 6:20 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] peer IP address in CDR

Hi!

> Do you already have script to capture user's IP address? If not, check
> it here how I am capturing it:
>
> http://www.ilovetovoip.com/2010/05/getting-users-ip-address-remaining-
> within-the-dialplan

Or simply use one fo these:

  ${SIPCHANINFO(peerip)}
  ${SIPCHANINFO(recvip)}
  ${SIPCHANINFO(uri)}

More details with "show function SIPCHANINFO" on the CLI.

But: Anyone has an idea how to store the codec(s) that were employed for
the call in the CDR (or access it during hangup in the dialplan)?

The Wiki has a suggested patch to enhance SIPCHANINFO, but I wonder if 
there is a cleaner and built-in way to do it:
http://www.voip-info.org/wiki/index.php?page=Asterisk+func+sipchaninfo

Philipp


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


chan_sip.c.patch
Description: Binary data
-- 
_
-- 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] peer IP address in CDR

2010-06-29 Thread Remco Bressers
I'll try it out tomorrow. 

Youre my hero of the day!

Regards,

Remco


Op 29 jun. 2010 om 17:45 heeft Zeeshan Zakaria  het 
volgende geschreven:

> Just put exten => _,s, before the MYSQL ...
> 
> Zeeshan A Zakaria
> 
> --
> www.ilovetovoip.com
> 
>> On 2010-06-29 11:41 AM, "Remco Bressers"  wrote:
>> 
>> Thanks Zeeshan, but i don't use (and understand) AEL :)
>> 
>> Any regular examples out there? :)
>> 
>> regards,
>> 
>> Remco
>> 
>> 
>> On 06/29/2010 05:27 PM, Zeeshan Zakaria wrote:
>> > Let me make it simple for you:
>> > 
>> > Add a column ...
>> 
>> > mailto:list-aster...@skycomuk.com>> wrote:
>> > 
>> > Remco Bressers wr...
>> 
>> --
>> _
>> -- Bandwidth and Colocation Pr...
>> 
> 
> -- 
> _
> -- 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] peer IP address in CDR

2010-06-29 Thread Zeeshan Zakaria
Just put exten => _,s, before the MYSQL ...

Zeeshan A Zakaria

--
www.ilovetovoip.com

On 2010-06-29 11:41 AM, "Remco Bressers"  wrote:

Thanks Zeeshan, but i don't use (and understand) AEL :)

Any regular examples out there? :)

regards,

Remco



On 06/29/2010 05:27 PM, Zeeshan Zakaria wrote:
> Let me make it simple for you:
>
> Add a column ...

> mailto:list-aster...@skycomuk.com>> wrote:
>
> Remco Bressers wr...
--

_
-- Bandwidth and Colocation Pr...
-- 
_
-- 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] peer IP address in CDR

2010-06-29 Thread Remco Bressers
Thanks Zeeshan, but i don't use (and understand) AEL :)

Any regular examples out there? :)

regards,

Remco


On 06/29/2010 05:27 PM, Zeeshan Zakaria wrote:
> Let me make it simple for you:
> 
> Add a column to your table, e.g. `my column`.
> 
> In the dialplan do the following (AEL example):
> 
> MYSQL(Connect connid localhost username password database);
> MYSQL(Query resultid ${connid} INSERT INTO `cdr`
> (`mycolumn`) VALUES('${SIPCHANINFO(ip)}'));
> MYSQL(Disconnect ${connid});
> 
> --
> Zeeshan
> 
> On Tue, Jun 29, 2010 at 10:32 AM, Gareth Blades
> mailto:list-aster...@skycomuk.com>> wrote:
> 
> Remco Bressers wrote:
> > Hi,
> >
> > Sorry, but i forgot to notice that i am already using the 'userfield'
> > column so that's not a possibility. Is there any way i can add the IP
> > address to a custom MySQL field in CDR? With AGI possibly? The problem
> > is, that the CDR entry is written in MySQL when the call is
> hungup, so i
> > have no possibility to write the IP address after a call.
> >
> > Regards,
> >
> > Remco
> >
> 
> See my earlier post. You can certenly write the information after the
> call is hung up by using the 'h' extension. I do this myself to write
> the calculated call cost to a custom column in the mysql table.
> 
> --
> _
> -- 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
> 
> 
> 
> 
> -- 
> Zeeshan A Zakaria
> 

-- 
_
-- 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] peer IP address in CDR

2010-06-29 Thread Zeeshan Zakaria
Let me make it simple for you:

Add a column to your table, e.g. `my column`.

In the dialplan do the following (AEL example):

MYSQL(Connect connid localhost username password database);
MYSQL(Query resultid ${connid} INSERT INTO `cdr` (`mycolumn`)
VALUES('${SIPCHANINFO(ip)}'));
MYSQL(Disconnect ${connid});

--
Zeeshan

On Tue, Jun 29, 2010 at 10:32 AM, Gareth Blades
wrote:

> Remco Bressers wrote:
> > Hi,
> >
> > Sorry, but i forgot to notice that i am already using the 'userfield'
> > column so that's not a possibility. Is there any way i can add the IP
> > address to a custom MySQL field in CDR? With AGI possibly? The problem
> > is, that the CDR entry is written in MySQL when the call is hungup, so i
> > have no possibility to write the IP address after a call.
> >
> > Regards,
> >
> > Remco
> >
>
> See my earlier post. You can certenly write the information after the
> call is hung up by using the 'h' extension. I do this myself to write
> the calculated call cost to a custom column in the mysql table.
>
> --
> _
> -- 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
>



-- 
Zeeshan A Zakaria
-- 
_
-- 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] peer IP address in CDR

2010-06-29 Thread Philipp von Klitzing
Hi!

> Do you already have script to capture user's IP address? If not, check
> it here how I am capturing it:
>
> http://www.ilovetovoip.com/2010/05/getting-users-ip-address-remaining-
> within-the-dialplan

Or simply use one fo these:

  ${SIPCHANINFO(peerip)}
  ${SIPCHANINFO(recvip)}
  ${SIPCHANINFO(uri)}

More details with "show function SIPCHANINFO" on the CLI.

But: Anyone has an idea how to store the codec(s) that were employed for
the call in the CDR (or access it during hangup in the dialplan)?

The Wiki has a suggested patch to enhance SIPCHANINFO, but I wonder if 
there is a cleaner and built-in way to do it:
http://www.voip-info.org/wiki/index.php?page=Asterisk+func+sipchaninfo

Philipp


-- 
_
-- 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] peer IP address in CDR

2010-06-29 Thread Gareth Blades
Remco Bressers wrote:
> Hi,
> 
> Sorry, but i forgot to notice that i am already using the 'userfield'
> column so that's not a possibility. Is there any way i can add the IP
> address to a custom MySQL field in CDR? With AGI possibly? The problem
> is, that the CDR entry is written in MySQL when the call is hungup, so i
> have no possibility to write the IP address after a call.
> 
> Regards,
> 
> Remco
> 

See my earlier post. You can certenly write the information after the 
call is hung up by using the 'h' extension. I do this myself to write 
the calculated call cost to a custom column in the mysql table.

-- 
_
-- 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] peer IP address in CDR

2010-06-29 Thread Remco Bressers
Hi,

Sorry, but i forgot to notice that i am already using the 'userfield'
column so that's not a possibility. Is there any way i can add the IP
address to a custom MySQL field in CDR? With AGI possibly? The problem
is, that the CDR entry is written in MySQL when the call is hungup, so i
have no possibility to write the IP address after a call.

Regards,

Remco

On 06/29/2010 03:53 PM, Zeeshan Zakaria wrote:
> Hi,
> 
> There is usually an empty column in the cdr table named 'userfield'. You
> can also add a column of your own. Then in the dialplan use:
> 
> Set(CDR(userfield)="user IP address")
> 
> And this will automatically add this information into the userfield column.
> 
> Do you already have script to capture user's IP address? If not, check
> it here how I am capturing it:
> 
> http://www.ilovetovoip.com/2010/05/getting-users-ip-address-remaining-within-the-dialplan
> 
> Zeeshan A Zakaria
> 
> --
> www.ilovetovoip.com 
> 
>> On 2010-06-29 8:20 AM, "Faisal Hanif" > > wrote:
>>
>> Simply set it to costume field of cdrs in dialplan and you will have
>> it a part of native cdr
>> Regards,
>>
>> *Faisal Hanif*
>>
>> --
>> _
>> -- 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
> 


-- 
Met vriendelijke groet,
Signet bv


Remco Bressers

T 040 - 707 4 907
F 040 - 707 4 909
E rbress...@signet.nl
altijd online? www.signet.nl

-- 
_
-- 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] peer IP address in CDR

2010-06-29 Thread Gareth Blades
Remco Bressers wrote:
> Hi,
> 
> The subject says it all. Is it possible to put the IP address of the
> peer in the CDR records? Using AGI maybe?
> 

Yes you can either put the information in the userfield if you are using 
a plain text file.

If you are storing to a mysql table for example then you can create 
additional columns and write whatever information you want to them. See 
http://www.voip-info.org/wiki/view/Asterisk+cdr+mysql for an example of 
how to do this.

-- 
_
-- 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] peer IP address in CDR

2010-06-29 Thread Zeeshan Zakaria
Hi,

There is usually an empty column in the cdr table named 'userfield'. You can
also add a column of your own. Then in the dialplan use:

Set(CDR(userfield)="user IP address")

And this will automatically add this information into the userfield column.

Do you already have script to capture user's IP address? If not, check it
here how I am capturing it:

http://www.ilovetovoip.com/2010/05/getting-users-ip-address-remaining-within-the-dialplan

Zeeshan A Zakaria

--
www.ilovetovoip.com

On 2010-06-29 8:20 AM, "Faisal Hanif"  wrote:

 Simply set it to costume field of cdrs in dialplan and you will have it a
part of native cdr
 Regards,

*Faisal Hanif*

--
_
-- 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] peer IP address in CDR

2010-06-29 Thread Faisal Hanif
 Simply set it to costume field of cdrs in dialplan and you will have 
it a part of native cdr

Regards,

*Faisal Hanif*
-- 
_
-- 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