= SIP Instant Messaging = [[TracNav(Python_SIP/TOC)]] == Sending IM == There are two ways to send IM, using [http://www.pjsip.org/python/pjsua.htm#Buddy-send_pager send_pager()] method of [http://www.pjsip.org/python/pjsua.htm#Buddy Buddy] object, or [http://www.pjsip.org/python/pjsua.htm#Call-send_pager send_pager()] method of [http://www.pjsip.org/python/pjsua.htm#Call Call] object. The former is probably preferable since it allows you to send pager without having to establish a call, but just to say that sending IM within call is possible. === Typing Indication === In addition to sending instant messages, you can also send typing indication to remote buddy using [http://www.pjsip.org/python/pjsua.htm#Buddy-send_typing_ind send_typing_ind()]. === Pager Status === The transmission status of outgoing instant messages is reported in [http://www.pjsip.org/python/pjsua.htm#BuddyCallback-on_pager_status on_pager_status()] method of [http://www.pjsip.org/python/pjsua.htm#BuddyCallback BuddyCallback] class, or [http://www.pjsip.org/python/pjsua.htm#CallCallback-on_pager_status on_pager_status()] of [http://www.pjsip.org/python/pjsua.htm#CallCallback CallCallback] class, depending on how the instant message was sent. [[BR]] == Receiving IM == There are three ways to receive incoming instant messages (yes unfortunately it's not that straightforward), depending on how and who sends the instant message: * if the IM was sent within call, then it will be received in [http://www.pjsip.org/python/pjsua.htm#CallCallback-on_pager on_pager()] method of [http://www.pjsip.org/python/pjsua.htm#CallCallback CallCallback object] * if the IM was sent '''not''' within the call and the sender is in the our buddy list, then it will be received in [http://www.pjsip.org/python/pjsua.htm#BuddyCallback-on_pager on_pager()] method of [http://www.pjsip.org/python/pjsua.htm#BuddyCallback BuddyCallback] object. * failing all that, the IM will be reported in [http://www.pjsip.org/python/pjsua.htm#AccountCallback-on_pager on_pager()] method of [http://www.pjsip.org/python/pjsua.htm#AccountCallback AccountCallback]. Incoming typing indications will be received in similar way, in ''on_typing()'' callback.