<div dir="ltr">Hi Daniel :)<br><br>i tryied 2 methods to save it<br> <br>1) i created a new table on kamailio_router called `acc`<br><br>from `utils/kamctl/mysql/acc-create.sql`<br><br>```<br>CREATE TABLE `acc` (<br>    `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,<br>    `method` VARCHAR(16) DEFAULT '' NOT NULL,<br>    `from_tag` VARCHAR(128) DEFAULT '' NOT NULL,<br>    `to_tag` VARCHAR(128) DEFAULT '' NOT NULL,<br>    `callid` VARCHAR(255) DEFAULT '' NOT NULL,<br>    `sip_code` VARCHAR(3) DEFAULT '' NOT NULL,<br>    `sip_reason` VARCHAR(128) DEFAULT '' NOT NULL,<br>    `time` DATETIME NOT NULL<br>);<br>CREATE INDEX callid_idx ON acc (`callid`);<br>```<br>then <br><br>```<br>route[IS_CALLER_BLACKLISTED] {<br><br>  python_exec("check_caller_blacklisted");<br><br>  if ($var(callerBlacklisted) == 1){<br><br>     t_send_reply("403", "Forbidden");<br><br>     acc_db_request("403 Forbidden", "acc");<br><br>     exit;<br><br>  }<br><br>```<br><br>in `acc` i have now calls that were not answered with 200ok :)<br><br><br>2) add new fields on exsisting acc_cdrs table used to store cdrs <br><br>```<br>ALTER TABLE `acc_cdrs` ADD COLUMN `from_tag` varchar(128) DEFAULT NULL AFTER `dst_domain`;<br>ALTER TABLE `acc_cdrs` ADD COLUMN `to_tag` VARCHAR(128) DEFAULT NULL AFTER `from_tag`;<br>ALTER TABLE `acc_cdrs` ADD COLUMN `sip_code` VARCHAR(3) DEFAULT NULL AFTER `to_tag`;<br>ALTER TABLE `acc_cdrs` ADD COLUMN `sip_reason` varchar(128) DEFAULT NULL AFTER `sip_code`;<br>ALTER TABLE `acc_cdrs` ADD COLUMN `time` datetime DEFAULT NULL AFTER `sip_reason`;<br>```<br><br>```<br>route[IS_CALLER_BLACKLISTED] {<div><br>  python_exec("check_caller_blacklisted");</div><div><br>  if ($var(callerBlacklisted) == 1){<br><br>     t_send_reply("403", "Forbidden");<br><br>     acc_db_request("403 Forbidden", "acc_cdrs");<br><br>     exit;<br><br>  }<br><br>```<br><br>In this way i have both stored calls that were not answered with 200ok and that were answered with 200ok.<br>The idea is to have all in one table `acc_cdrs`.<br><br>Can be ok also the second solution?<br><br>Thank you very much!<br>Miro<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 14 giu 2019 alle ore 09:06 Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>I don't think that you can get a dialog-based CDR for calls that
      were not answered with 200ok. But you can get a record in acc
      table, by storing failed transaction record (see the mod params
      for acc and failed transaction flag or use acc_db_request()).</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="gmail-m_-1623064218268261766moz-cite-prefix">On 13.06.19 22:45, Pejic, Miroslav
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>Hi :)</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245);min-height:14px"><span></span><br>
            </p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>I'm trying to save a
                failed call in the kamailio_router.acc_cdrs database </span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>after sending the
                403 Forbidden by router, using the module acc, if is it
                possible?</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span><br>
              </span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span><a href="https://www.kamailio.org/docs/modules/5.2.x/modules/acc.html" target="_blank">https://www.kamailio.org/docs/modules/5.2.x/modules/acc.html</a></span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245);min-height:14px"><span></span><br>
            </p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>Something like this:</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245);min-height:14px"><span></span><br>
            </p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>route[IS_CALLER_BLACKLISTED]
                {</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245);min-height:14px"><span></span><br>
            </p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span> 
                python_exec("check_caller_blacklisted");</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245);min-height:14px"><span></span><br>
            </p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>  if
                ($var(callerBlacklisted) == 1){</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245);min-height:14px"><span></span><br>
            </p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>    
                t_send_reply("403", "Forbidden");</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245);min-height:14px"><span></span><br>
            </p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span><span style="white-space:pre-wrap">     </span>IT’S
                POSSIBLE HERE SAVE A CALL ON KAMAILIO_ROUTER.ACC_CDRS?</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245);min-height:14px"><span><span class="gmail-m_-1623064218268261766gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>
                 </span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span><span style="white-space:pre-wrap">     </span>exit;</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>  }</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245);min-height:14px"><span></span><br>
            </p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>Thanks in advance!</span></p>
            <p style="margin:0px;font-stretch:normal;font-size:12px;line-height:normal;font-family:Courier;color:rgb(18,31,60);background-color:rgb(241,242,245)"><span>Miro</span></p>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="gmail-m_-1623064218268261766mimeAttachmentHeader"></fieldset>
      <pre class="gmail-m_-1623064218268261766moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="gmail-m_-1623064218268261766moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="gmail-m_-1623064218268261766moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="gmail-m_-1623064218268261766moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="gmail-m_-1623064218268261766moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a class="gmail-m_-1623064218268261766moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="gmail-m_-1623064218268261766moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a></pre>
  </div>

</blockquote></div>