Hi.
It think it’s right. But I always check call state without hasMedia and roles.
I’ve faced with the issue that I couldn’t get PJ.PJSIP_INV_STATE_INCOMING for incoming calls. So I had to set flag for the incoming call in the callback function onIncomingCall. It’s workaround I could come up with.
Пятница, 12 февраля 2021, 20:51 +03:00 от nab@xxxxxxx:
Hello!
python code:
""" State of call
"""
@property
def incoming(self):
return not self.hasMedia() and \
(self.state == PJ.PJSIP_INV_STATE_INCOMING \
or self.state == PJ.PJSIP_INV_STATE_EARLY) \
and (self.role == PJ.PJSIP_ROLE_UAS \
or self.role == PJ.PJSIP_UAS_ROLE)
# incoming
@property
def calling(self):
return (self.state == PJ.PJSIP_INV_STATE_CALLING \
or self.state == PJ.PJSIP_INV_STATE_EARLY) \
and (self.role == PJ.PJSIP_ROLE_UAC \
or self.role == PJ.PJSIP_UAC_ROLE)
# calling
@property
def talking(self):
return self.state == PJ.PJSIP_INV_STATE_CONFIRMED \
and self.hasMedia()
This is correct?
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
С уважением, Каменский Антон.
_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org