Commit 9440be81 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #28473: sipbuddy: replace tabs with spaces, reindent.

parent c5bc8f42
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
*/ */
#ifndef SIPBUDDY_H #ifndef SIPBUDDY_H
#define SIPBUDDY_H #define SIPBUDDY_H
#include <pjsip-simple/presence.h> #include <pjsip-simple/presence.h>
#include <pj/timer.h> #include <pj/timer.h>
...@@ -50,118 +50,118 @@ class SIPAccount; // dummy prototype ...@@ -50,118 +50,118 @@ class SIPAccount; // dummy prototype
*/ */
static void buddy_evsub_on_state(pjsip_evsub *sub, pjsip_event *event); static void buddy_evsub_on_state(pjsip_evsub *sub, pjsip_event *event);
static void buddy_evsub_on_tsx_state(pjsip_evsub *sub, static void buddy_evsub_on_tsx_state(pjsip_evsub *sub,
pjsip_transaction *tsx, pjsip_transaction *tsx,
pjsip_event *event); pjsip_event *event);
static void buddy_evsub_on_rx_notify(pjsip_evsub *sub, static void buddy_evsub_on_rx_notify(pjsip_evsub *sub,
pjsip_rx_data *rdata, pjsip_rx_data *rdata,
int *p_st_code, int *p_st_code,
pj_str_t **p_st_text, pj_str_t **p_st_text,
pjsip_hdr *res_hdr, pjsip_hdr *res_hdr,
pjsip_msg_body **p_body); pjsip_msg_body **p_body);
static void buddy_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry); static void buddy_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry);
class SIPBuddy { class SIPBuddy {
public: public:
/** /**
* Constructor * Constructor
* @param uri SIP uri of remote user that we want to subscribe, * @param uri SIP uri of remote user that we want to subscribe,
*/ */
SIPBuddy(const std::string &uri, SIPAccount *acc); SIPBuddy(const std::string &uri, SIPAccount *acc);
/** /**
* Destructor. * Destructor.
* Process the the unsubscription before the destruction. * Process the the unsubscription before the destruction.
*/ */
~SIPBuddy(); ~SIPBuddy();
/** /**
* Compare with another buddy's uris. * Compare with another buddy's uris.
* @param b Other buddy pointer * @param b Other buddy pointer
*/ */
bool match(SIPBuddy *b); bool match(SIPBuddy *b);
/** /**
* The PBX must approve the subrciption before the buddy is added in the buddy list. * The PBX must approve the subrciption before the buddy is added in the buddy list.
*/ */
void accept(); void accept();
/** /**
* Send a SUBCRIBE to the PXB or directly to a buddy in the IP2IP context. * Send a SUBCRIBE to the PXB or directly to a buddy in the IP2IP context.
*/ */
bool subscribe(); bool subscribe();
/** /**
* Send a SUBCRIBE to the PXB or directly to a buddy in the IP2IP context but * Send a SUBCRIBE to the PXB or directly to a buddy in the IP2IP context but
* the 0s timeout make the dialog expire immediatly. * the 0s timeout make the dialog expire immediatly.
*/ */
bool unsubscribe(); bool unsubscribe();
/** /**
* Return the monitor variable. * Return the monitor variable.
*/ */
bool isSubscribed(); bool isSubscribed();
/** /**
* Return the buddy URI * Return the buddy URI
*/ */
std::string getURI(); std::string getURI();
friend void buddy_evsub_on_state( pjsip_evsub *sub, pjsip_event *event); friend void buddy_evsub_on_state(pjsip_evsub *sub, pjsip_event *event);
friend void buddy_evsub_on_tsx_state(pjsip_evsub *sub, friend void buddy_evsub_on_tsx_state(pjsip_evsub *sub,
pjsip_transaction *tsx, pjsip_transaction *tsx,
pjsip_event *event); pjsip_event *event);
friend void buddy_evsub_on_rx_notify(pjsip_evsub *sub, friend void buddy_evsub_on_rx_notify(pjsip_evsub *sub,
pjsip_rx_data *rdata, pjsip_rx_data *rdata,
int *p_st_code, int *p_st_code,
pj_str_t **p_st_text, pj_str_t **p_st_text,
pjsip_hdr *res_hdr, pjsip_hdr *res_hdr,
pjsip_msg_body **p_body); pjsip_msg_body **p_body);
friend void buddy_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry); friend void buddy_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry);
void incLock() { void incLock() {
lock_count++; lock_count++;
} }
void decLock() { void decLock() {
lock_count--; lock_count--;
} }
private: private:
/** /**
* Plan a retry or a renew a subscription. * Plan a retry or a renew a subscription.
* @param reschedule Allow for reschedule. * @param reschedule Allow for reschedule.
* @param msec Delay value in milliseconds. * @param msec Delay value in milliseconds.
*/ */
void rescheduleTimer(bool reschedule, unsigned msec); void rescheduleTimer(bool reschedule, unsigned msec);
/** /**
* Callback after a presence notification was received. * Callback after a presence notification was received.
* Tranfert info to the SIP account. * Tranfert info to the SIP account.
*/ */
pj_status_t reportPresence(); pj_status_t reportPresence();
/** /**
* Process the un/subscribe request transmission. * Process the un/subscribe request transmission.
*/ */
pj_status_t updateSubscription(); pj_status_t updateSubscription();
/* /*
* Compare the reason of a transaction end with the given string. * Compare the reason of a transaction end with the given string.
*/ */
bool isTermReason(std::string); bool isTermReason(std::string);
/** /**
* return the code after a transaction is terminated. * return the code after a transaction is terminated.
*/ */
unsigned getTermCode(); unsigned getTermCode();
SIPAccount *acc; /**< Associated SIP account pointer */ SIPAccount *acc; /**< Associated SIP account pointer */
pj_str_t uri; /**< Buddy URI. */ pj_str_t uri; /**< Buddy URI. */
pj_str_t contact; /**< Contact learned from subscrp. */ pj_str_t contact; /**< Contact learned from subscrp. */
pj_str_t display; /**< Buddy display name. */ pj_str_t display; /**< Buddy display name. */
pjsip_dialog *dlg; /**< The underlying dialog. */ pjsip_dialog *dlg; /**< The underlying dialog. */
pj_bool_t monitor; /**< Should we monitor? */ pj_bool_t monitor; /**< Should we monitor? */
pj_str_t name; /**< Buddy name. */ pj_str_t name; /**< Buddy name. */
pj_caching_pool cp_; pj_caching_pool cp_;
pj_pool_t *pool; /**< Pool for this buddy. */ pj_pool_t *pool; /**< Pool for this buddy. */
pjsip_pres_status status; /**< Buddy presence status. */ pjsip_pres_status status; /**< Buddy presence status. */
pjsip_evsub *sub; /**< Buddy presence subscription */ pjsip_evsub *sub; /**< Buddy presence subscription */
unsigned term_code; /**< Subscription termination code */ unsigned term_code; /**< Subscription termination code */
pj_str_t term_reason;/**< Subscription termination reason */ pj_str_t term_reason;/**< Subscription termination reason */
pj_timer_entry timer; /**< Resubscription timer */ pj_timer_entry timer; /**< Resubscription timer */
void *user_data; /**< Application data. */ void *user_data; /**< Application data. */
int lock_count; int lock_count;
}; };
#endif /* SIPBUDDY_H */ #endif /* SIPBUDDY_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment