<span style="font-family: courier new,monospace;">/etc/asterisk/cdr_mysql.conf</span><br>
<br><font size="1"><b style="font-family: courier new,monospace;">[global]</b><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">hostname=127.0.0.1</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">dbname=protv</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">table=cdr</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">password=pt.rj</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">user=root</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;port=3306</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;sock=/tmp/mysql.sock</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;</span><br style="font-family: courier new,monospace;"><b style="font-family: courier new,monospace;">[columns]</b><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;static &quot;&lt;value&gt;&quot; =&gt; &lt;column&gt;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias &lt;cdrvar&gt; =&gt; &lt;column&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">alias start =&gt; calldate</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Mude esta linha e deixe assim: &quot;alias clid =&gt; clid</span>&quot;<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;alias src =&gt; src</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;alias dst =&gt; dst</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias dcontext =&gt; dcontext</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias channel =&gt; channel</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias dstchannel =&gt; dstchannel</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias lastapp =&gt; lastapp</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias lastdata =&gt; lastdata</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias duration =&gt; duration</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias billsec =&gt; billsec</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias disposition =&gt; disposition</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias amaflags =&gt; amaflags</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias accountcode =&gt; accountcode</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias userfield =&gt; userfield</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias uniqueid =&gt; uniqueid</span></font><br><br><br>Ats,<br>Rodrigo Lang.<br><br><div class="gmail_quote">Em 20 de fevereiro de 2010 12:21, Marcelo S Dias Muniz <span dir="ltr">&lt;<a href="mailto:marcelosdias@superig.com.br">marcelosdias@superig.com.br</a>&gt;</span> escreveu:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Pessoal, quem puder me auxiliar, agradeço.<br>Na bilhetagem de meu pabx, não está gravando o valor do campo &quot;clid&quot; na tabela &quot;cdr&quot;.<br>
Não estou percebendo o que estou fazendo de errado.<br>Abaixo segue o resultado e meus arquivos de configuração.<br>
<br><span style="font-family: courier new,monospace;"></span>



        
        
        
        
        
        

<table rules="none" width="987" border="0" cellspacing="0" cols="16" frame="void" height="136">
        <colgroup><col width="136"><col width="32"><col width="30"><col width="27"><col width="60"><col width="84"><col width="77"><col width="65"><col width="59"><col width="59"><col width="50"><col width="97"><col width="59"><col width="88"><col width="104"><col width="86"></colgroup>
        <tbody>
                <tr>
                        <td width="136" align="left" height="17">calldate</td>
                        <td width="32" align="left">clid</td>
                        <td width="30" align="left">src</td>
                        <td width="27" align="left">dst</td>
                        <td width="60" align="left">dcontext</td>
                        <td width="84" align="left">channel</td>
                        <td width="77" align="left">dstchannel</td>
                        <td width="65" align="left">lastapp</td>
                        <td width="59" align="left">lastdata</td>
                        <td width="59" align="left">duration</td>
                        <td width="50" align="left">billsec</td>
                        <td width="97" align="left">disposition</td>
                        <td width="59" align="left">amaflags</td>
                        <td width="88" align="left">accountcode</td>
                        <td width="104" align="left">uniqueid</td>
                        <td width="86" align="left">userfield</td>
                </tr>
                <tr>
                        <td align="left" height="17">02/20/10 11:57 AM</td>
                        <td align="left"> <br></td>
                        <td align="left"> <br></td>
                        <td align="left"> s</td>
                        <td align="left"> default</td>
                        <td align="left"> DAHDI/1-1</td>
                        <td align="left"> <br></td>
                        <td align="left"> Hangup</td>
                        <td align="left"> <br></td>
                        <td align="left">10</td>
                        <td align="left">6</td>
                        <td align="left"> ANSWERED</td>
                        <td align="left">3</td>
                        <td align="left"> <br></td>
                        <td align="left">1266674259</td>
                        <td align="left"> <br></td>
                </tr>
                <tr>
                        <td align="left" height="17">02/20/10 11:58 AM</td>
                        <td align="left"> <br></td>
                        <td align="left"> <br></td>
                        <td align="left"> s</td>
                        <td align="left"> default</td>
                        <td align="left"> DAHDI/1-1</td>
                        <td align="left"> <br></td>
                        <td align="left"> Hangup</td>
                        <td align="left"> <br></td>
                        <td align="left">9</td>
                        <td align="left">5</td>
                        <td align="left"> ANSWERED</td>
                        <td align="left">3</td>
                        <td align="left"> <br></td>
                        <td align="left">1266674300.1</td>
                        <td align="left"> <br></td>
                </tr>
                <tr>
                        <td align="left" height="17">02/20/10 12:04 PM</td>
                        <td align="left"> <br></td>
                        <td align="left"> <br></td>
                        <td align="left"> s</td>
                        <td align="left"> default</td>
                        <td align="left"> DAHDI/1-1</td>
                        <td align="left"> <br></td>
                        <td align="left"> Hangup</td>
                        <td align="left"> <br></td>
                        <td align="left">10</td>
                        <td align="left">6</td>
                        <td align="left"> ANSWERED</td>
                        <td align="left">3</td>
                        <td align="left"> <br></td>
                        <td align="left">1266674694.2</td>
                        <td align="left"> <br></td>
                </tr>
                <tr>
                        <td align="left" height="17">02/20/10 12:19 PM</td>
                        <td align="left"> <br></td>
                        <td align="left"> <br></td>
                        <td align="left"> s</td>
                        <td align="left"> default</td>
                        <td align="left"> DAHDI/1-1</td>
                        <td align="left"> <br></td>
                        <td align="left"> Hangup</td>
                        <td align="left"> <br></td>
                        <td align="left">4</td>
                        <td align="left">0</td>
                        <td align="left"> ANSWERED</td>
                        <td align="left">3</td>
                        <td align="left"> <br></td>
                        <td align="left">1266675579</td>
                        <td align="left"> <br></td>
                </tr>
                <tr>
                        <td align="left" height="17">02/20/10 12:26 PM</td>
                        <td align="left"> <br></td>
                        <td align="left"> <br></td>
                        <td align="left"> s</td>
                        <td align="left"> default</td>
                        <td align="left"> DAHDI/1-1</td>
                        <td align="left"> <br></td>
                        <td align="left"> Hangup</td>
                        <td align="left"> <br></td>
                        <td align="left">11</td>
                        <td align="left">7</td>
                        <td align="left"> ANSWERED</td>
                        <td align="left">3</td>
                        <td align="left"> <br></td>
                        <td align="left">1266676007.1</td>
                        <td align="left"> <br></td>
                </tr>
                <tr>
                        <td align="left" height="17">02/20/10 12:28 PM</td>
                        <td align="left"> <br></td>
                        <td align="left"> <br></td>
                        <td align="left"> s</td>
                        <td align="left"> default</td>
                        <td align="left"> DAHDI/1-1</td>
                        <td align="left"> <br></td>
                        <td align="left"> Hangup</td>
                        <td align="left"> <br></td>
                        <td align="left">11</td>
                        <td align="left">7</td>
                        <td align="left"> ANSWERED</td>
                        <td align="left">3</td>
                        <td align="left"> <br></td>
                        <td align="left">1266676090.2</td>
                        <td align="left"> <br></td>
                </tr>
                <tr>
                        <td align="left" height="17">02/20/10 12:29 PM</td>
                        <td align="left"> <br></td>
                        <td align="left"> <br></td>
                        <td align="left"> s</td>
                        <td align="left"> default</td>
                        <td align="left"> DAHDI/1-1</td>
                        <td align="left"> <br></td>
                        <td align="left"> Hangup</td>
                        <td align="left"> <br></td>
                        <td align="left">11</td>
                        <td align="left">7</td>
                        <td align="left"> ANSWERED</td>
                        <td align="left">3</td>
                        <td align="left"> <br></td>
                        <td align="left">1266676158.3</td>
                        <td align="left"> <br></td>
                </tr>
        </tbody>
</table>
<br><span style="font-family: courier new,monospace;"><br>arquivo /etc/asterisk/extensions.conf</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><font size="1"><b><span style="font-family: courier new,monospace;">[general]</span></b><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">static=yes</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">writeprotect=no</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">autofallthrough=no</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">clearglobalvars=no</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">priorityjumping=yes</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><b><span style="font-family: courier new,monospace;">[default]</span></b><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">exten =&gt; s,1,Answer                 ; Atende a ligacao...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">exten =&gt; s,2,Playback(introprotv)   ; Mensagem</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">exten =&gt; s,3,Hangup()               ; termina</span><br style="font-family: courier new,monospace;"></font><br><br><span style="font-family: courier new,monospace;">/etc/asterisk/cdr_mysql.conf</span><br>

<br><font size="1"><b style="font-family: courier new,monospace;">[global]</b><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">hostname=127.0.0.1</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">dbname=protv</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">table=cdr</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">password=pt.rj</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">user=root</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;port=3306</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;sock=/tmp/mysql.sock</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;</span><br style="font-family: courier new,monospace;"><b style="font-family: courier new,monospace;">[columns]</b><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;static &quot;&lt;value&gt;&quot; =&gt; &lt;column&gt;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias &lt;cdrvar&gt; =&gt; &lt;column&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">alias start =&gt; calldate</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">alias callerid =&gt; clid</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias src =&gt; src</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias dst =&gt; dst</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias dcontext =&gt; dcontext</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias channel =&gt; channel</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias dstchannel =&gt; dstchannel</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias lastapp =&gt; lastapp</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias lastdata =&gt; lastdata</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias duration =&gt; duration</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias billsec =&gt; billsec</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias disposition =&gt; disposition</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias amaflags =&gt; amaflags</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias accountcode =&gt; accountcode</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">;alias userfield =&gt; userfield</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">;alias uniqueid =&gt; uniqueid</span></font><br><br><font style="font-family: courier new,monospace;" size="1"><font size="2">estrutura da tabela cdr</font><br></font><pre style="font-family: courier new,monospace;">
<font size="1">CREATE TABLE `cdr` (<br>  `calldate` datetime NOT NULL default &#39;0000-00-00 00:00:00&#39;,<br>  `clid` varchar(80) NOT NULL default &#39;&#39;,<br>  `src` varchar(80) NOT NULL default &#39;&#39;,<br>  `dst` varchar(80) NOT NULL default &#39;&#39;,<br>

  `dcontext` varchar(80) NOT NULL default &#39;&#39;,<br>  `channel` varchar(80) NOT NULL default &#39;&#39;,<br>  `dstchannel` varchar(80) NOT NULL default &#39;&#39;,<br>  `lastapp` varchar(80) NOT NULL default &#39;&#39;,<br>

  `lastdata` varchar(80) NOT NULL default &#39;&#39;,<br>  `duration` int(11) NOT NULL default &#39;0&#39;,<br>  `billsec` int(11) NOT NULL default &#39;0&#39;,<br>  `disposition` varchar(45) NOT NULL default &#39;&#39;,<br>

  `amaflags` int(11) NOT NULL default &#39;0&#39;,<br>  `accountcode` varchar(20) NOT NULL default &#39;&#39;,<br>  `uniqueid` varchar(32) NOT NULL default &#39;&#39;,<br>  `userfield` varchar(255) NOT NULL default &#39;&#39;,<br>

  KEY `calldate` (`calldate`),<br>  KEY `dst` (`dst`),<br>  KEY `accountcode` (`accountcode`)<br>) ENGINE=MyISAM DEFAULT CHARSET=latin1;<br></font></pre><br>
<br>_______________________________________________<br>
KHOMP: qualidade em placas de E1, GSM, FXS e FXO para Asterisk.<br>
- Hardware com alta disponibilidade de recursos e qualidade KHOMP<br>
- Suporte técnico local qualificado e gratuito<br>
Conheça a linha completa de produtos KHOMP em <a href="http://www.khomp.com.br" target="_blank">www.khomp.com.br</a><br>
_______________________________________________<br>
Lista de discussões AsteriskBrasil.org<br>
<a href="mailto:AsteriskBrasil@listas.asteriskbrasil.org">AsteriskBrasil@listas.asteriskbrasil.org</a><br>
<a href="http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil" target="_blank">http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil</a><br></blockquote></div><br><br clear="all"><br>-- <br>Rodrigo F. Lang<br>
Amd. de Redes em Telecom<br>