00001 #ifndef __SIP_EVENTS_UAC_H
00002 #define __SIP_EVENTS_UAC_H
00003
00004
00005
00006 #include "../dialog/dlg_mod.h"
00007 #include "../../timer.h"
00008 #include "../../timer_ticks.h"
00009 #include <cds/msg_queue.h>
00010 #include <cds/ref_cntr.h>
00011 #include <presence/qsa.h>
00012
00013 #include "trace.h"
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 typedef enum {
00024 euac_unconfirmed,
00025 euac_unconfirmed_destroy,
00026 euac_confirmed,
00027 euac_waiting,
00028 euac_resubscription,
00029 euac_resubscription_destroy,
00030 euac_waiting_for_termination,
00031 euac_predestroyed,
00032 euac_destroyed,
00033 } events_uac_status_t;
00034
00035 struct _events_uac_t;
00036 typedef struct _events_uac_t events_uac_t;
00037
00038 typedef void (*notify_callback_func)(events_uac_t *uac, struct sip_msg *, void *param);
00039
00040 struct _events_uac_t {
00041
00042 dlg_t *dialog;
00043
00044
00045
00046
00047
00048 notify_callback_func cb;
00049
00050
00051 void *cbp;
00052
00053
00054 str headers;
00055 str local_uri;
00056 str remote_uri;
00057 str route;
00058 str outbound_proxy;
00059
00060 struct _events_uac_t *prev, *next;
00061
00062 events_uac_status_t status;
00063
00064
00065
00066 reference_counter_data_t ref_cntr;
00067
00068 struct timer_ln timer;
00069 int timer_started;
00070
00071
00072 char id[64];
00073 };
00074
00075
00076 events_uac_t *create_events_uac(str *remote_uri, str *local_uri,
00077 const str *events,
00078 notify_callback_func cb,
00079 void *cbp,
00080 const str *other_headers, str *route,
00081 str *outbound_proxy);
00082
00083 void free_events_uac(events_uac_t *uac);
00084
00085
00086 int destroy_events_uac(events_uac_t *uac);
00087
00088
00089 events_uac_t *find_events_uac(dlg_id_t *id);
00090
00091
00092 void remove_uac_reference(events_uac_t *uac);
00093
00094
00095 int events_uac_init();
00096
00097
00098 void events_uac_destroy();
00099
00100
00101 int process_euac_notify(struct sip_msg* m);
00102
00103 #endif