euac_funcs.h

00001 #ifndef __EUAC_FUNCS_H
00002 #define __EUAC_FUNCS_H
00003 
00004 #include "events_uac.h"
00005 
00006 /* manipulation with message */
00007 void extract_contact(struct sip_msg *m, str *dst);
00008 
00009 /* creating/recreating subscriptions 
00010  * if failover_time > 0 it calls euac_set_timer to this value 
00011  * noth these functions returns nonzero on error - this MUST
00012  * be handled everywhere */
00013 int new_subscription(events_uac_t *uac, str *contact_to_send, int failover_time);
00014 int renew_subscription(events_uac_t *uac, int expires, int failover_time);
00015 
00016 /* */
00017 events_uac_t *find_euac_nolock(struct sip_msg *m);
00018 void euac_set_timer(events_uac_t *uac, int seconds);
00019 void euac_clear_timer(events_uac_t *uac);
00020 int remove_euac_reference_nolock(events_uac_t *uac);
00021 void remove_uac_from_list(events_uac_t *uac);
00022 void insert_uac_to_list(events_uac_t *uac);
00023 
00024 /* processing NOTIFY requests (always sends OK response) */
00025 void do_notification(events_uac_t *uac, struct sip_msg *m);
00026 void discard_notification(events_uac_t *uac, struct sip_msg *m, int res_code, char *msg);
00027 void refresh_dialog(events_uac_t *uac, struct sip_msg *m);
00028 void refresh_dialog_resp(events_uac_t *uac, struct sip_msg *m);
00029 
00030 /* waiting time after error (before new attempt about subscription) */
00031 extern int resubscribe_timeout_on_err; 
00032 
00033 /* time specifying how long wait for terminating NOTIFY
00034  * after 2xx response on SUBSCRIBE with 0 expires*/
00035 extern int waiting_for_notify_time; 
00036 
00037 /* default subscription duration */
00038 extern int subscribe_time;
00039 
00040 /* time interval before expiration when should be the subscription refreshed
00041  * (recommended are some seconds before) */
00042 extern int resubscribe_delta;
00043 
00044 /* minimum time for resubscriptions */
00045 extern int min_resubscribe_time;
00046 
00047 extern int failover_timeout;
00048 
00049 /* for randomized start of subscriptions */
00050 extern int max_subscribe_delay;
00051 
00052 #endif