<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Cambria;
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Cambria","serif";
        color:#000066;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Cambria","serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#1F497D'>Hello Everyone,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#1F497D'>I didn&#8217;t get a reply to my problem below so I&#8217;m posting again just in case someone who might be able to help missed my previous post.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#1F497D'>Thank You&#8230;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>*************************************************************************************</span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>Hello list,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>I&#8217;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&#8217;t get the relevant values for the outgoing channel. I&#8217;ve tried using the option &#8216;U&#8217; 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.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>Note: Asterisk ver is 1.8.7.1 and CDR&#8217;s are written to MySQL with adaptive ODBC and the table therein contains the relevant fields.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>This is the console with &#8216;very-verbose&#8217; output for the &#8216;Dial&#8217; 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:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>** channel here is source channel: SIP/office_Admin2-00000015<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:31]&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [316@InternalDP:5] Dial(&quot;SIP/office_Admin2-00000015&quot;, &quot;SIP/office_ServerRoom,,FgU(jump2SetVar)&quot;) in new stack<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:31]&nbsp;&nbsp; == Using UDPTL CoS mark 5<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:31]&nbsp;&nbsp; == Using SIP RTP CoS mark 5<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:31]&nbsp;&nbsp;&nbsp;&nbsp; -- Called SIP/office_ServerRoom<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:31]&nbsp;&nbsp;&nbsp;&nbsp; -- SIP/office_ServerRoom-00000016 is ringing<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:31]&nbsp;&nbsp;&nbsp;&nbsp; -- SIP/office_ServerRoom-00000016 is ringing<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- SIP/office_ServerRoom-00000016 answered SIP/office_Admin2-00000015<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>** from here the channel is the destination channel: SIP/office_ServerRoom-00000016<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [s@jump2SetVar:1] Gosub(&quot;SIP/office_ServerRoom-00000016&quot;, &quot;SetVar,postdial,1&quot;) in new stack<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>** This is how I obtain channel information:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>** exten =&gt; postdial,1,Set(CDR(chanoutsigip)=${CHANNEL(peerip)}:${SIPPEER(${CHANNEL(peername)},port)})</span><span style='font-family:"Cambria","serif";color:#1F497D'> ; resulting format: &lt;a.b.c.d&gt;:&lt;port&gt;</span><span style='font-family:"Cambria","serif";color:#000066'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>** same =&gt; n,Set(CDR(chanoutmediaip)=${CHANNEL(rtpdest,audio)})<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>** same =&gt; n,Set(CDR(chanoutcodec)=${CHANNEL(audionativeformat)})<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [postdial@SetVar:1] Set(&quot;SIP/office_ServerRoom-00000016&quot;, &quot;CDR(chanoutsigip)=192.168.20.226:5065&quot;) in new stack<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [postdial@SetVar:2] Set(&quot;SIP/office_ServerRoom-00000016&quot;, &quot;CDR(chanoutmediaip)=192.168.20.226:23008&quot;) in new stack<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [postdial@SetVar:3] Set(&quot;SIP/office_ServerRoom-00000016&quot;, &quot;CDR(chanoutcodec)=g729&quot;) in new stack<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [postdial@SetVar:4] Goto(&quot;SIP/office_ServerRoom-00000016&quot;, &quot;endsub,1&quot;) in new stack<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Goto (SetVar,endsub,1)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [endsub@SetVar:1] Return(&quot;SIP/office_ServerRoom-00000016&quot;, &quot;&quot;) in new stack<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [s@jump2SetVar:2] Return(&quot;SIP/office_ServerRoom-00000016&quot;, &quot;&quot;) in new stack<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Executing [s@app_dial_gosub_virtual_context:1] NoOp(&quot;SIP/office_ServerRoom-00000016&quot;, &quot;&quot;) in new stack<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Auto fallthrough, channel 'SIP/office_ServerRoom-00000016' status is 'UNKNOWN'<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>[Dec&nbsp; 1 12:14:33]&nbsp;&nbsp;&nbsp;&nbsp; -- Remotely bridging SIP/office_Admin2-00000015 and SIP/office_ServerRoom-00000016<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>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 &#8216;-----&#8216;) and NOT with the values above.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>Am I doing something wrong or is there a different way to populate CDR&#8217;s with info from called channel (leg B)?<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>Thank you for your replies&#8230;<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Cambria","serif";color:#000066'>Harel<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>