Greeting list, 

I am using two async functions(http_async_query) in configuration one for authentication and other one for push notifications. I am also using tsilio module to suspend the transaction and resumed it.  

I am resetting this flag 'T_ASYNC_SUSPENDED' before suspending the transaction. Everything is working fine except. When caller send CANCEL on the call, kamailio successfully completes sip flow at callee(B party) side but send back below packet towards caller. 
 
2018/07/10 19:47:41.125893 172.31.21.87:5060 -> 39.38.156.111:59969
SIP/2.0 500 I'm terribly sorry, server error occurred (1/TM )
Via: SIP/2.0/UDP 39.38.156.111:59969;branch=z9hG4bK-524287-1---91c6114330fe6293;rport=59969
To: <sip:923335550609@sip.talkhomeappcall.com;transport=UDP>;tag=9fe2d4c84d97a4af81aa65ca8fc51b3d-62cb
From: <sip:923135082344@sip.talkhomeappcall.com;transport=UDP>;tag=d72eaf4c
Call-ID: VkAwxpSgkKSGn5dXaXgn5A..
CSeq: 2 INVITE
Content-Length: 0


root@sip:~# kamailio -V
version: kamailio 5.1.3 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 08:06:26 May  2 2018 with gcc 4.9.2


Could someone please help me out how to fix this. Cancels are handles automatically so, i cannot hardcore anything to resolve it. 

Best Regards, 

Aqs Younas