<div dir="ltr"><div>You are trying to reimplement callid[1] which has been in Asterisk since v11.  Callid</div><div> is accessible from dialplan using CHANNEL(callid)[2].  Accessibility from the</div><div> dialplan has been in Asterisk 13 since 13.15.0 and in Asterisk 15 since it was first</div><div> released. The callid is created when the incoming channel goes into dialplan not</div><div> when it is bridged.</div><br><div>As to the approach.  You do know that Asterisk is multi-threaded and can handle</div><div> more than one call at a time?  Using a simple global variable sets the uniqueid</div><div>for ALL log messages regardless of whether that message has anything to do with</div><div> the channel of that uniqueid.<br></div><div><div><br></div><div>You really should use callid rather than attempt to re-implement this wheel.  The</div><div>callid functionality was a large change to the codebase when it was added in v11.<br></div><div></div><br></div><div>Richard<br></div><div><br></div><div>[1] <a href="https://wiki.asterisk.org/wiki/display/AST/Call+Identifier+Logging">https://wiki.asterisk.org/wiki/display/AST/Call+Identifier+Logging</a></div><div>[2] <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Function_CHANNEL">https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Function_CHANNEL</a><br></div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 2, 2018 at 2:57 PM, Balraj Singh <span dir="ltr"><<a href="mailto:balraj.singh@zemosolabs.com" target="_blank">balraj.singh@zemosolabs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Asterisk version : 15.4.1 ( current )<div><br></div><div>Ok so I added in :</div><div>cdr.h :</div><div><br></div><div><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">extern</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">volatile</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">char</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">* </span><span class="gmail-m_-9065289496112350380gmail-pl-en gmail-m_-9065289496112350380gmail-x gmail-m_-9065289496112350380gmail-x-first gmail-m_-9065289496112350380gmail-x-last" style="box-sizing:border-box;color:rgb(36,41,46);border-radius:0.2em;background-color:rgb(172,242,189);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;text-decoration-style:initial;text-decoration-color:initial">getUniqueId</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">(</span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">void</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">);</span><br></div><div><br></div><div>cdr.c :</div><div><br></div><div>//save unique id in this variable</div><div>//this is a global variable</div><div><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">volatile</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">char</span><span class="gmail-m_-9065289496112350380gmail-x gmail-m_-9065289496112350380gmail-x-first gmail-m_-9065289496112350380gmail-x-last" style="box-sizing:border-box;border-radius:0.2em;color:rgb(36,41,46);background-color:rgb(172,242,189);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;text-decoration-style:initial;text-decoration-color:initial"> *UNIQUEID</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">;</span><br></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">//function to get unique id</span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);text-decoration-style:initial;text-decoration-color:initial">volatile</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);text-decoration-style:initial;text-decoration-color:initial">char</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> *</span><span class="gmail-m_-9065289496112350380gmail-pl-en" style="box-sizing:border-box;color:rgb(111,66,193);text-decoration-style:initial;text-decoration-color:initial">getUniqueId</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">() {</span><br></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">    return</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> UNIQUEID;</span><br></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">}</span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">//start saving unique id from channel</span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);text-decoration-style:initial;text-decoration-color:initial">static</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);text-decoration-style:initial;text-decoration-color:initial">struct</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> cdr_object *</span><span class="gmail-m_-9065289496112350380gmail-pl-en" style="box-sizing:border-box;color:rgb(111,66,193);text-decoration-style:initial;text-decoration-color:initial">cdr_object_alloc</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">(</span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);text-decoration-style:initial;text-decoration-color:initial">struct</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> ast_channel_snapshot *chan) {</span><br></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    ....</span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    <span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">UNIQUEID = chan-></span><span class="gmail-m_-9065289496112350380gmail-pl-smi" style="box-sizing:border-box;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">uniqueid</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">;</span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    ....</span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">}</span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);text-decoration-style:initial;text-decoration-color:initial">static</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);text-decoration-style:initial;text-decoration-color:initial">struct</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> cdr_object *</span><span class="gmail-m_-9065289496112350380gmail-pl-en" style="box-sizing:border-box;color:rgb(111,66,193);text-decoration-style:initial;text-decoration-color:initial">cdr_object_create_and_append</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">(</span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);text-decoration-style:initial;text-decoration-color:initial"><wbr>struct</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> cdr_object *cdr) {</span><br></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    ....</span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    <span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">if</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> (!UNIQUEID || (UNIQUEID[</span><span class="gmail-m_-9065289496112350380gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">0</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">] != </span><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;color:rgb(3,47,98);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box;color:rgb(3,47,98)">'</span><span class="gmail-m_-9065289496112350380gmail-pl-cce" style="box-sizing:border-box">\0</span><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box;color:rgb(3,47,98)">'</span></span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">)) {</span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">        <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">UNIQUEID = cdr_last-></span><span class="gmail-m_-9065289496112350380gmail-pl-smi" style="box-sizing:border-box;text-decoration-style:initial;text-decoration-color:initial">uniqueid</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">;</span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    }</span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    ....</span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">}</span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">static</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">struct</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> ast_cdr *</span><span class="gmail-m_-9065289496112350380gmail-pl-en" style="box-sizing:border-box;color:rgb(111,66,193);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">cdr_object_create_public_<wbr>records</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">(</span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">struct</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> cdr_object *cdr) {</span><br></span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    ....</span></span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    <span class="gmail-m_-9065289496112350380gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);text-decoration-style:initial;text-decoration-color:initial">ast_copy_string</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">(UNIQUEID, party_a-></span><span class="gmail-m_-9065289496112350380gmail-pl-smi" style="box-sizing:border-box;text-decoration-style:initial;text-decoration-color:initial">uniqueid</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">, </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);text-decoration-style:initial;text-decoration-color:initial">sizeof</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">(party_a-></span><span class="gmail-m_-9065289496112350380gmail-pl-smi" style="box-sizing:border-box;text-decoration-style:initial;text-decoration-color:initial">uniqueid</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">));</span></span></span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    ....</span></span></span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">}</span></span></span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">static</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">void</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-en" style="box-sizing:border-box;color:rgb(111,66,193);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">handle_channel_cache_message</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">(</span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">v<wbr>oid</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> *data, </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">struct</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> stasis_subscription *sub, </span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">struct</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> stasis_message *message) {</span><br></span></span></span></span></span></span></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    ....</span></span></span></span></span></span></span></span></span></span></span></div><div><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237)">    <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">UNIQUEID = <span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">new_snapshot ? new_snapshot-></span><span class="gmail-m_-9065289496112350380gmail-pl-smi" style="box-sizing:border-box;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">uniqueid</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> : old_snapshot-></span><span class="gmail-m_-9065289496112350380gmail-pl-smi" style="box-sizing:border-box;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial">uniqueid</span><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">;</span></span></span></font></div><div><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237)"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">    ....</span></span></span></font></div><div><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237)"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">} //end saving unique id</span></span></span></font></div><div><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237)"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></font></div><div>logger.c :</div><div><br></div><div>//include cdr header file</div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">#</span><span class="gmail-m_-9065289496112350380gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">include</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;color:rgb(3,47,98);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box;color:rgb(3,47,98)">"</span>asterisk/cdr.h<span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box;color:rgb(3,47,98)">"</span></span><br></div><div><br></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">static int format_log_default(struct logchannel *chan, struct logmsg *msg, char *buf, size_t size) {
    char call_identifier_str[13];</span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap"><br></span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">    //Get unique id from cdr here
    volatile char *UNIQUEID = getUniqueId();

    if (msg->callid) {
        snprintf(call_identifier_str, sizeof(call_identifier_str), "[C-%08x]", msg->callid);
    } else {
        call_identifier_str[0] = '\0';
    }

    switch (chan->type) {
        case LOGTYPE_SYSLOG:</span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap"><br></span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">            //Print unique id along with other log content</span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">
            snprintf(buf, size, "%s[%d][%s]: %s:%d in %s: %s",
                     levels[msg->level], msg->lwp, UNIQUEID, msg->file,
                     msg->line, msg->function, msg->message);
            term_strip(buf, buf, size);
            break;
        case LOGTYPE_FILE:</span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap"><br></span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">            /<span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">/Print unique id along with other log content</span></span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">            snprintf(buf, size, "[%s] %s[%d][%s] %s: %s",</span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">                     msg->date, msg->level_name, msg->lwp, UNIQUEID,
                     msg->file, msg->message);
            term_strip(buf, buf, size);
            break;
        case LOGTYPE_CONSOLE: {
            char linestr[32];

            /*
             * Verbose messages are interpreted by console channels in their own
             * special way
             */
            if (msg->level == __LOG_VERBOSE) {
                return logger_add_verbose_magic(msg, buf, size);
            }

            /* Turn the numeric line number into a string for colorization */
            snprintf(linestr, sizeof(linestr), "%d", msg->line);

            snprintf(buf, size, "[%s] "
            COLORIZE_FMT
            "[%d][%s]: "
            COLORIZE_FMT
            ":"
            COLORIZE_FMT
            " "
            COLORIZE_FMT
            ": %s",
                    msg->date,
                    COLORIZE(colors[msg->level], 0, msg->level_name),
                    msg->lwp,</span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap"><br></span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">                    //add unique id here too 
                    UNIQUEID,</span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">
                    COLORIZE(COLOR_BRWHITE, 0, msg->file),
                    COLORIZE(COLOR_BRWHITE, 0, linestr),
                    COLORIZE(COLOR_BRWHITE, 0, msg->function),
                    msg->message);
        }
            break;
    }

    return 0;
}</span></font><br></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap"><br></span></font></span></span></span></span></div><div><span class="gmail-m_-9065289496112350380gmail-pl-s" style="box-sizing:border-box;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span class="gmail-m_-9065289496112350380gmail-pl-pds" style="box-sizing:border-box"><span style="background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;font-size:12px;white-space:pre-wrap"><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#24292e"><div>void __ast_verbose(const char *file, int line, const char *func, int level, const char *fmt, ...) {</div><div>    ast_callid callid;</div><div>    va_list ap;</div><div><br></div><div>    callid = ast_read_threadstorage_callid(<wbr>);</div><div><br></div><div>    va_start(ap, fmt);</div><div><br></div><div>    //get the unique id</div><div>    const char *UNIQUEID = getUniqueId();</div><div>    </div><div>    //check if unique id is null or empty and print debug statement accordingly</div><div>    if (UNIQUEID) {</div><div>        if (UNIQUEID[0] != '\0') {</div><div>            printf("[%s]", UNIQUEID);</div><div>        } else {</div><div>            printf("UNIQUEID IS EMPTY ");</div><div>        }</div><div>    }</div><div><br></div><div>    __ast_verbose_ap(file, line, func, level, callid, fmt, ap);</div><div>    va_end(ap);</div><div>}</div><div><br></div><div><br></div><div><br></div><div>Thank you.</div></font></span></span></span></span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(230,255,237);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div></div><br><br><div class="gmail_quote"><div><div class="gmail-h5"><div dir="ltr">On Mon, Jul 2, 2018 at 7:33 PM Tech Support <<a href="mailto:asterisk@voipbusiness.us" target="_blank">asterisk@voipbusiness.us</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-h5"><div lang="EN-US"><div class="gmail-m_-9065289496112350380m_7909344683997406948WordSection1"><p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">Hello;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">    What version of Asterisk are you using? Do you want to post your modifications to the two files?<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">Thanks;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">John V.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:11pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11pt;font-family:"Calibri",sans-serif"> asterisk-dev [mailto:<a href="mailto:asterisk-dev-bounces@lists.digium.com" target="_blank">asterisk-dev-bounces@<wbr>lists.digium.com</a>] <b>On Behalf Of </b>Balraj Singh<br><b>Sent:</b> Monday, July 02, 2018 03:07 AM<br><b>To:</b> <a href="mailto:asterisk-dev@lists.digium.com" target="_blank">asterisk-dev@lists.digium.com</a><br><b>Cc:</b> Mani Kanta Gadde <<a href="mailto:manikanta.gadde@zemosolabs.com" target="_blank">manikanta.gadde@zemosolabs.<wbr>com</a>><br><b>Subject:</b> [asterisk-dev] Regarding Unique Id In Logs<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hi,<u></u><u></u></p><div><p class="MsoNormal">Problem Statement : How to print $(UNIQUEID) in every log line. <u></u><u></u></p></div><div><p class="MsoNormal">So we posted this query on asterisk community (<a href="https://community.asterisk.org/t/how-to-print-uniqueid-in-every-log-line/75041" target="_blank">here</a>), and I was able to get that uniqueid in every log line by modifying the source code of logger.c and cdr.c files of asterisk. <u></u><u></u></p></div><div><p class="MsoNormal">So further we had a doubt that the way we approached to that solution was correct or not? . The developers on that forum told us to post this in asterisk-dev community as this was unrelated to that forum. So, please tell us, that the approach <span style="background:white none repeat scroll 0% 0%">( please read the approach in the link provided ) </span>we used is correct or not.<u></u><u></u></p></div><div><p class="MsoNormal">Technically what could be the caveats related to the approach if any?, could there be any alternates of that? . <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thank you.<u></u><u></u></p></div></div></div></div></div></div><span class="gmail-HOEnZb"><font color="#888888">-- <br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-dev</a></font></span></blockquote></div>
<br>-- <br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-dev</a><br></blockquote></div><br></div></div></div>