title: How to have Kannel automatically clear DLR with type=4
body: <p>I am hoping someone can help me work through an issue I am having regarding DLRs of the "intermediate" type (ie type=4) continuing to queue.</p>
  
  <p>My understanding is that in the US, DLR that are successful and final (ie DELIVERED (1)), are  rare while intermediate DLR such as "Queued on SMSC". ACCEPTD, REJECTD are much more common as carriers accept messages on behalf of their customers.</p>
  
  <p>The SMSC we use send back exclusively type=2 for undelivered messages and type=4 DLR for messages that are successfully delivered to the carrier. We are using internal DLR storage in Kannel (not using mysql) and the problem is that a DLR of type=4 is not considered final and thus does not leave the DLR queue. When we get a type=4 DLR back, the following messages are seen in the bearerbox log.</p>
  
  <pre><code>2013-11-05 14:59:06 [15084] [6] DEBUG: DLR[internal]: Looking for DLR smsc=test, ts=4154168431, dst=&lt;censored&gt;, type=4
  2013-11-05 14:59:06 [15084] [6] DEBUG: DLR[internal]: created DLR message for URL &lt;http://localhost/dlr.php&gt;
  2013-11-05 14:59:06 [15084] [6] DEBUG: DLR[internal]: DLR not destroyed, still waiting for other delivery report
  </code></pre>
  
  <p>It appears Kannel is waiting for a DLR of type=1 or 2 to come in before it takes the DLR out of its queue. </p>
  
  <p>Is there a Kannel setting to make it so a type=4 DLR is considered a final DLR and thus clear the DLR out of memory? I've messed with the dlr-mask setting in Kannel but I don't think that attribute holds my answer.</p>
  
  <p>Thanks in advance and please let me know if I can provide any further information.</p>
  
  <p>TL;DR: How can I have Kannel consider a DLR of type=4 to be a final DLR. </p>