I am not quite sure, but I would try to store a long-term flag with the help of the dialog module.

[...]The dialog module provides dialog awareness for the Kamailio proxy. It's functionality is to keep track of the current dialogs, to offer information about them (e.g. how many dialogs are active), and to manage various characteristics of dialogs. The module exports several functions that can be used directly from the configuration route script as well as functions for the RPC interface. [...]

[...]10.6. $dlg_var(key)

This is a read/write variable that can be used to store custom values assigned with a dialog (e.g. the URI of a billing-server, an assigned emergency-server). This pseudo-variable will be available only for subsequential requests after doing loose_route().

Note: You will receive "NULL", if there is no dialog for this request.[...]


Hint: ACK is a subsequential request

Anyway, I am wondering if your approach would be compliant to RFC 3261.

KR


Von: sr-users <sr-users-bounces@lists.kamailio.org> im Auftrag von Valter Nogueira <valter@fastway.com.br>
Gesendet: Freitag, 2. Oktober 2020 17:01
An: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Betreff: [SR-Users] Drop calls with response 200 without previous 180/183 reponses
 
I would like to use Kamailio to drop every call that is answered with no previous 180 / 183 responses or with 180 / 183 responses with no media attached (no SDP?).

Is it possible? How could I accomplish this?

Thanks,

Valter