I used handling type (id = 400153) from your example:
send_wait(0, top_object(), "call_attr", "contact_handling", "sync_fetch", "STATIC", format("contact = U'%s' and special_handling = 400153", customer.id), -1, 0);
contact_handling is factory which stores relation between contacts and specail handlings, so if you found data row matches search query - handling exists.
to validate this query you can simply check it using sql or try to use more obvious dot referenced query like:
send_wait(0, top_object(), "call_attr", "contact_handling", "sync_fetch", "STATIC",
"contact.userid like 'testuser' AND special_handling.sym like 'VIP'"
-1, 0);
logf(SIGNIFICANT, "found: %d rows", msg[1]);
Regards, cdtj