Check state of call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux