IIRC, according to the rfc, the 200ok responses have to be always forwarded, being the decision of caller to pick one and send a ACK+BYE for the other.
The easy solution with kamailio is to drop any 200ok once you got one. The callee might not stop resending it even when a CANCEL arrives, will wait for ACK and eventually BYE.
TM module will always forward the 200ok, as per rfc. If you want to drop in kamailio.cfg, a possible solution:
- use reply_route { ... } block to intercept 200ok for invite
- use htable to store when first 200ok is received (the key can be call-id)
- use cfgutils to get locks that will protect against races to access/update the htable
- processing logic: if it is a 200ok for INVITE, lock for htable, check if there is a key for that callid. If yes, unlock and drop. If not, add an item with call-id as a key, unlock and let the response go on