Hello list, I'm trying to populate my CDR logs with values which are available after the call has started (e.g. signalling IP of remote user, media IP, codec etc.). While CHANNEL function give me all I need for the incoming leg (leg A), I can't get the relevant values for the outgoing channel. I've tried using the option 'U' with my dial command (execute subroutine for called channel after called channel answered but before the call is bridged). While this throws the correct information to the console it does not populate the CDRs accordingly. Note: Asterisk ver is 1.8.7.1 and CDR's are written to MySQL with adaptive ODBC and the table therein contains the relevant fields. This is the console with 'very-verbose' output for the 'Dial' application where office_Admin2, IP 192.168.20.222, is calling office_ServerRoom, IP 192.168.20.226. My comments added prefixed by ** and on separate line: ** channel here is source channel: SIP/office_Admin2-00000015 [Dec 1 12:14:31] -- Executing [316 at InternalDP:5] Dial("SIP/office_Admin2-00000015", "SIP/office_ServerRoom,,FgU(jump2SetVar)") in new stack [Dec 1 12:14:31] == Using UDPTL CoS mark 5 [Dec 1 12:14:31] == Using SIP RTP CoS mark 5 [Dec 1 12:14:31] -- Called SIP/office_ServerRoom [Dec 1 12:14:31] -- SIP/office_ServerRoom-00000016 is ringing [Dec 1 12:14:31] -- SIP/office_ServerRoom-00000016 is ringing [Dec 1 12:14:33] -- SIP/office_ServerRoom-00000016 answered SIP/office_Admin2-00000015 ** from here the channel is the destination channel: SIP/office_ServerRoom-00000016 [Dec 1 12:14:33] -- Executing [s at jump2SetVar:1] Gosub("SIP/office_ServerRoom-00000016", "SetVar,postdial,1") in new stack ** This is how I obtain channel information: ** exten => postdial,1,Set(CDR(chanoutsigip)=${CHANNEL(peerip)}:${SIPPEER(${CHANNEL(peername)},port)}) ** same => n,Set(CDR(chanoutmediaip)=${CHANNEL(rtpdest,audio)}) ** same => n,Set(CDR(chanoutcodec)=${CHANNEL(audionativeformat)}) [Dec 1 12:14:33] -- Executing [postdial at SetVar:1] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutsigip)=192.168.20.226:5065") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:2] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutmediaip)=192.168.20.226:23008") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:3] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutcodec)=g729") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:4] Goto("SIP/office_ServerRoom-00000016", "endsub,1") in new stack [Dec 1 12:14:33] -- Goto (SetVar,endsub,1) [Dec 1 12:14:33] -- Executing [endsub at SetVar:1] Return("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Executing [s at jump2SetVar:2] Return("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Executing [s at app_dial_gosub_virtual_context:1] NoOp("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Auto fallthrough, channel 'SIP/office_ServerRoom-00000016' status is 'UNKNOWN' [Dec 1 12:14:33] -- Remotely bridging SIP/office_Admin2-00000015 and SIP/office_ServerRoom-00000016 When call is terminated the relevant fields in the database for CDR(chanoutsigip), CDR(chanoutmediaip) and CDR(chanoutcodec) are populated with their default values (typically blank or '-----') and NOT with the values above. Am I doing something wrong or is there a different way to populate CDR's with info from called channel (leg B)? Thank you for your replies... Harel ________________________________ This electronic message and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee you should not disseminate or distribute a copy of this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete. Warning: Although the company has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. EasyCall Ltd -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20111201/4c84c886/attachment.htm>
Hello Everyone, I didn't get a reply to my problem below so I'm posting again just in case someone who might be able to help missed my previous post. Thank You... ************************************************************************************* Hello list, I'm trying to populate my CDR logs with values which are available after the call has started (e.g. signalling IP of remote user, media IP, codec etc.). While CHANNEL function give me all I need for the incoming leg (leg A), I can't get the relevant values for the outgoing channel. I've tried using the option 'U' with my dial command (execute subroutine for called channel after called channel answered but before the call is bridged). While this throws the correct information to the console it does not populate the CDRs accordingly. Note: Asterisk ver is 1.8.7.1 and CDR's are written to MySQL with adaptive ODBC and the table therein contains the relevant fields. This is the console with 'very-verbose' output for the 'Dial' application where office_Admin2, IP 192.168.20.222, is calling office_ServerRoom, IP 192.168.20.226. My comments added prefixed by ** and on separate line: ** channel here is source channel: SIP/office_Admin2-00000015 [Dec 1 12:14:31] -- Executing [316 at InternalDP:5] Dial("SIP/office_Admin2-00000015", "SIP/office_ServerRoom,,FgU(jump2SetVar)") in new stack [Dec 1 12:14:31] == Using UDPTL CoS mark 5 [Dec 1 12:14:31] == Using SIP RTP CoS mark 5 [Dec 1 12:14:31] -- Called SIP/office_ServerRoom [Dec 1 12:14:31] -- SIP/office_ServerRoom-00000016 is ringing [Dec 1 12:14:31] -- SIP/office_ServerRoom-00000016 is ringing [Dec 1 12:14:33] -- SIP/office_ServerRoom-00000016 answered SIP/office_Admin2-00000015 ** from here the channel is the destination channel: SIP/office_ServerRoom-00000016 [Dec 1 12:14:33] -- Executing [s at jump2SetVar:1] Gosub("SIP/office_ServerRoom-00000016", "SetVar,postdial,1") in new stack ** This is how I obtain channel information: ** exten => postdial,1,Set(CDR(chanoutsigip)=${CHANNEL(peerip)}:${SIPPEER(${CHANNEL(peername)},port)}) ; resulting format: <a.b.c.d>:<port> ** same => n,Set(CDR(chanoutmediaip)=${CHANNEL(rtpdest,audio)}) ** same => n,Set(CDR(chanoutcodec)=${CHANNEL(audionativeformat)}) [Dec 1 12:14:33] -- Executing [postdial at SetVar:1] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutsigip)=192.168.20.226:5065") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:2] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutmediaip)=192.168.20.226:23008") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:3] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutcodec)=g729") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:4] Goto("SIP/office_ServerRoom-00000016", "endsub,1") in new stack [Dec 1 12:14:33] -- Goto (SetVar,endsub,1) [Dec 1 12:14:33] -- Executing [endsub at SetVar:1] Return("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Executing [s at jump2SetVar:2] Return("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Executing [s at app_dial_gosub_virtual_context:1] NoOp("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Auto fallthrough, channel 'SIP/office_ServerRoom-00000016' status is 'UNKNOWN' [Dec 1 12:14:33] -- Remotely bridging SIP/office_Admin2-00000015 and SIP/office_ServerRoom-00000016 When call is terminated the relevant fields in the database for CDR(chanoutsigip), CDR(chanoutmediaip) and CDR(chanoutcodec) are populated with their default values (typically blank or '-----') and NOT with the values above. Am I doing something wrong or is there a different way to populate CDR's with info from called channel (leg B)? Thank you for your replies... Harel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20111206/e6342616/attachment.htm>
Le 06/12/2011 10:16, Harel Cohen a ?crit :> > Hello Everyone, >Hi Harel> I didn?t get a reply to my problem below so I?m posting again just in > case someone who might be able to help missed my previous post. > > Thank You? >Please take a look at issue ASTERISK-18875 <https://issues.asterisk.org/jira/browse/ASTERISK-18875> [...] -- Daniel
Danny, Why would you think this is a "circumvent"? I'm using a nice feature of 1.8 where I can create any CDR field I like and populate it by using the CDR(<fieldname>) function. While all other fields that I created are populated properly (however before the 'dial' commences) it seems like at this point of the dial plan the CDR is closed for editing even though I configured endbeforehexten=no in my cdr.conf. It might be related to issue ASTERISK-18875 as suggested by Daniel (Vol. 89 issue 8, topic 9). I'll be happy to know if someone has a different knowledge on the subject, otherwise I'll simply follow ASTERISK-18875. My problem with this issue is that it is defined as low importance which means that it will probably take long to handle if at all... Harel ************************************************************** Message: 4 Date: Tue, 6 Dec 2011 07:29:54 -0600 From: "Danny Nicholas" <danny at debsinc.com> Subject: Re: [asterisk-users] Populate CDR issues To: "'Asterisk Users Mailing List - Non-Commercial Discussion'" <asterisk-users at lists.digium.com> Message-ID: <009801ccb41b$24417cd0$6cc47670$@debsinc.com> Content-Type: text/plain; charset="us-ascii" IMO you are trying to circumvent basic Asterisk functionality. It's your CDR so you can do what you want with it - I think the answer to this is to populate another DB with the live call data, then update the CDR from that after the call has ended (perhaps a daemon). From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Harel Cohen Sent: Tuesday, December 06, 2011 3:16 AM To: asterisk-users at lists.digium.com Subject: [asterisk-users] Populate CDR issues Hello Everyone, I didn't get a reply to my problem below so I'm posting again just in case someone who might be able to help missed my previous post. Thank You. **************************************************************************** ********* Hello list, I'm trying to populate my CDR logs with values which are available after the call has started (e.g. signalling IP of remote user, media IP, codec etc.). While CHANNEL function give me all I need for the incoming leg (leg A), I can't get the relevant values for the outgoing channel. I've tried using the option 'U' with my dial command (execute subroutine for called channel after called channel answered but before the call is bridged). While this throws the correct information to the console it does not populate the CDRs accordingly. Note: Asterisk ver is 1.8.7.1 and CDR's are written to MySQL with adaptive ODBC and the table therein contains the relevant fields. This is the console with 'very-verbose' output for the 'Dial' application where office_Admin2, IP 192.168.20.222, is calling office_ServerRoom, IP 192.168.20.226. My comments added prefixed by ** and on separate line: ** channel here is source channel: SIP/office_Admin2-00000015 [Dec 1 12:14:31] -- Executing [316 at InternalDP:5] Dial("SIP/office_Admin2-00000015", "SIP/office_ServerRoom,,FgU(jump2SetVar)") in new stack [Dec 1 12:14:31] == Using UDPTL CoS mark 5 [Dec 1 12:14:31] == Using SIP RTP CoS mark 5 [Dec 1 12:14:31] -- Called SIP/office_ServerRoom [Dec 1 12:14:31] -- SIP/office_ServerRoom-00000016 is ringing [Dec 1 12:14:31] -- SIP/office_ServerRoom-00000016 is ringing [Dec 1 12:14:33] -- SIP/office_ServerRoom-00000016 answered SIP/office_Admin2-00000015 ** from here the channel is the destination channel: SIP/office_ServerRoom-00000016 [Dec 1 12:14:33] -- Executing [s at jump2SetVar:1] Gosub("SIP/office_ServerRoom-00000016", "SetVar,postdial,1") in new stack ** This is how I obtain channel information: ** exten => postdial,1,Set(CDR(chanoutsigip)=${CHANNEL(peerip)}:${SIPPEER(${CHANNEL(peer name)},port)}) ; resulting format: <a.b.c.d>:<port> ** same => n,Set(CDR(chanoutmediaip)=${CHANNEL(rtpdest,audio)}) ** same => n,Set(CDR(chanoutcodec)=${CHANNEL(audionativeformat)}) [Dec 1 12:14:33] -- Executing [postdial at SetVar:1] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutsigip)=192.168.20.226:5065") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:2] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutmediaip)=192.168.20.226:23008") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:3] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutcodec)=g729") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:4] Goto("SIP/office_ServerRoom-00000016", "endsub,1") in new stack [Dec 1 12:14:33] -- Goto (SetVar,endsub,1) [Dec 1 12:14:33] -- Executing [endsub at SetVar:1] Return("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Executing [s at jump2SetVar:2] Return("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Executing [s at app_dial_gosub_virtual_context:1] NoOp("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Auto fallthrough, channel 'SIP/office_ServerRoom-00000016' status is 'UNKNOWN' [Dec 1 12:14:33] -- Remotely bridging SIP/office_Admin2-00000015 and SIP/office_ServerRoom-00000016 When call is terminated the relevant fields in the database for CDR(chanoutsigip), CDR(chanoutmediaip) and CDR(chanoutcodec) are populated with their default values (typically blank or '-----') and NOT with the values above. Am I doing something wrong or is there a different way to populate CDR's with info from called channel (leg B)? Thank you for your replies. Harel
Hi Mike, I've tried updating my CDR's via the h exten but with no success. I've tried with both endbeforehexten=no and endbeforehexten=yes (in cdr.conf) but the value refused to appear in my CDR (even though I see the Set() application being executed in the console under the h exten). Thank you for your suggestion though... Any other thoughts are welcome. Kind Regards, Harel Cohen -----Original Message----- Date: Mon, 12 Dec 2011 13:41:31 -0700 From: Mike Diehl <mdiehl at diehlnet.com> Subject: Re: [asterisk-users] Populate CDR issues To: asterisk-users at lists.digium.com Cc: Harel Cohen <harel at easycall.gi> Message-ID: <201112121341.32142.mdiehl at diehlnet.com> Content-Type: Text/Plain; charset="iso-8859-1" On Monday 12 December 2011 4:28:17 am Harel Cohen wrote:> Danny, > > Why would you think this is a "circumvent"? I'm using a nice feature > of 1.8 where I can create any CDR field I like and populate it by > using the > CDR(<fieldname>) function. While all other fields that I created are > populated properly (however before the 'dial' commences) it seems like > at this point of the dial plan the CDR is closed for editing even > though I configured endbeforehexten=no in my cdr.conf.I agree, this is a perfectly valid use of the CDR. I do the same thing, btw. I think what you are seeing is that when your call starts, Asterisk creates a record, either in memory, or in a db transaction. When the call is torn down, the record is updated and committed to the db. The down-shot is that any changes you make to the db record get clobbered by this last update. I ended up making some of my updates in the hang-up phase via the "h" extension. See if that will do what you need. -- Take care and have fun, Mike Diehl. ------------------------------ Date: Thu, 1 Dec 2011 12:57:56 +0100 From: Harel Cohen <harel at easycall.gi> Subject: [asterisk-users] Populate CDR issues To: "asterisk-users at lists.digium.com" <asterisk-users at lists.digium.com> Message-ID: <CABC006234837141A279831F68041406CABE9415A4 at ECS.EasyCall.local> Content-Type: text/plain; charset="us-ascii" Hello list, I'm trying to populate my CDR logs with values which are available after the call has started (e.g. signalling IP of remote user, media IP, codec etc.). While CHANNEL function give me all I need for the incoming leg (leg A), I can't get the relevant values for the outgoing channel. I've tried using the option 'U' with my dial command (execute subroutine for called channel after called channel answered but before the call is bridged). While this throws the correct information to the console it does not populate the CDRs accordingly. Note: Asterisk ver is 1.8.7.1 and CDR's are written to MySQL with adaptive ODBC and the table therein contains the relevant fields. This is the console with 'very-verbose' output for the 'Dial' application where office_Admin2, IP 192.168.20.222, is calling office_ServerRoom, IP 192.168.20.226. My comments added prefixed by ** and on separate line: ** channel here is source channel: SIP/office_Admin2-00000015 [Dec 1 12:14:31] -- Executing [316 at InternalDP:5] Dial("SIP/office_Admin2-00000015", "SIP/office_ServerRoom,,FgU(jump2SetVar)") in new stack [Dec 1 12:14:31] == Using UDPTL CoS mark 5 [Dec 1 12:14:31] == Using SIP RTP CoS mark 5 [Dec 1 12:14:31] -- Called SIP/office_ServerRoom [Dec 1 12:14:31] -- SIP/office_ServerRoom-00000016 is ringing [Dec 1 12:14:31] -- SIP/office_ServerRoom-00000016 is ringing [Dec 1 12:14:33] -- SIP/office_ServerRoom-00000016 answered SIP/office_Admin2-00000015 ** from here the channel is the destination channel: SIP/office_ServerRoom-00000016 [Dec 1 12:14:33] -- Executing [s at jump2SetVar:1] Gosub("SIP/office_ServerRoom-00000016", "SetVar,postdial,1") in new stack ** This is how I obtain channel information: ** exten => postdial,1,Set(CDR(chanoutsigip)=${CHANNEL(peerip)}:${SIPPEER(${CHANNEL(peername)},port)}) ** same => n,Set(CDR(chanoutmediaip)=${CHANNEL(rtpdest,audio)}) ** same => n,Set(CDR(chanoutcodec)=${CHANNEL(audionativeformat)}) [Dec 1 12:14:33] -- Executing [postdial at SetVar:1] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutsigip)=192.168.20.226:5065") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:2] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutmediaip)=192.168.20.226:23008") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:3] Set("SIP/office_ServerRoom-00000016", "CDR(chanoutcodec)=g729") in new stack [Dec 1 12:14:33] -- Executing [postdial at SetVar:4] Goto("SIP/office_ServerRoom-00000016", "endsub,1") in new stack [Dec 1 12:14:33] -- Goto (SetVar,endsub,1) [Dec 1 12:14:33] -- Executing [endsub at SetVar:1] Return("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Executing [s at jump2SetVar:2] Return("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Executing [s at app_dial_gosub_virtual_context:1] NoOp("SIP/office_ServerRoom-00000016", "") in new stack [Dec 1 12:14:33] -- Auto fallthrough, channel 'SIP/office_ServerRoom-00000016' status is 'UNKNOWN' [Dec 1 12:14:33] -- Remotely bridging SIP/office_Admin2-00000015 and SIP/office_ServerRoom-00000016 When call is terminated the relevant fields in the database for CDR(chanoutsigip), CDR(chanoutmediaip) and CDR(chanoutcodec) are populated with their default values (typically blank or '-----') and NOT with the values above. Am I doing something wrong or is there a different way to populate CDR's with info from called channel (leg B)? Thank you for your replies... Harel
Hi, http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf+sorting Read it, Might be it wil solved your doubts. On Fri, Dec 30, 2011 at 12:01 AM, Matt Hamilton <mistral9999 at hotmail.com>wrote:> I have a couple of performance/memory related questions: > > > Is there any downside to using long URIs as far as memory or database > (mysql) performance is concerned, e.g. > > sip:1234567890_1234567890 at abc.com? Or is this negligible? > > > Also is there a performance hit if no pattern matching is used? e.g. > > exten => _XXX,Noop(... > > vs > > exten => 100,Noop(.. > exten => 101,Noop(... > exten => 102,Noop(... > ... > exten => 999,Noop(... > > If a call comes to 999, does Asterisk go through each extension > sequentially from 100 to 999 until it finds the matching one? > > Thanks, > Matt > > > > > -- > _____________________________________________________________________ > -- 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 >-- Thanks and regards Virendra Bhati +91-8885268942 Software Engineer -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120102/48b2de18/attachment.htm>