I am using pjsua2 with python 2.7, in single-threaded mode:
ep_cfg.uaConfig.threadCnt = 0
ep_cfg.uaConfig.mainThreadOnly = True
I initiate two outgoing phone calls though my ISP, and when the first
call is answered, I attempt to cancel the second, unanswered call, like
this:
second_call.hangup(pj.CallOpParam(True))
This initially seems to work, the hangup() invocation returns and the
call becomes DISCONNECTED, but then my application prints these messages
and terminates:
23:24:12.655 sip_transactio ...Unable to register CANCEL transaction
(key exists)
23:24:12.663 pjsua_call.c .Failed to send end session message: Object
already exists (PJ_EEXISTS) [status=70015]
23:24:12.663 call.cpp pjsua_call_hangup(id, prm.statusCode,
param.p_reason, param.p_msg_data) error: Object already exists
(PJ_EEXISTS) (status=70015) [../src/pjsua2/call.cpp:501]
terminate called after throwing an instance of 'pj::Error'
... and there is nothing I can do to catch the exception and recover.
Any advice on how to cancel a call while in early state will be greatly
appreciated.