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