00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00055 #ifndef S_CSCF_REGISTRAR_NOTIFY_H_
00056 #define S_CSCF_REGISTRAR_NOTIFY_H_
00057
00058 #include "../../sr_module.h"
00059 #include "../../locking.h"
00060 #include "../tm/tm_load.h"
00061 #include "ims_pm.h"
00062
00063
00064 #define MSG_REG_SUBSCRIBE_OK "Subscription to REG saved"
00065 #define MSG_REG_UNSUBSCRIBE_OK "Subscription to REG dropped"
00066
00067
00069 enum {
00070 IMS_REGISTRAR_NONE,
00071 IMS_REGISTRAR_SUBSCRIBE,
00072 IMS_REGISTRAR_UNSUBSCRIBE,
00073 IMS_REGISTRAR_SUBSCRIBE_EXPIRED,
00075 IMS_REGISTRAR_CONTACT_REGISTERED,
00076 IMS_REGISTRAR_CONTACT_CREATED,
00077 IMS_REGISTRAR_CONTACT_REFRESHED,
00078 IMS_REGISTRAR_CONTACT_SHORTENED,
00079 IMS_REGISTRAR_CONTACT_EXPIRED,
00080 IMS_REGISTRAR_CONTACT_DEACTIVATED,
00081 IMS_REGISTRAR_CONTACT_PROBATION,
00082 IMS_REGISTRAR_CONTACT_UNREGISTERED,
00083 IMS_REGISTRAR_CONTACT_REJECTED
00084 }IMS_Registrar_events;
00085
00087 typedef struct _r_notification {
00088 str req_uri;
00089 str uri;
00090 str subscription_state;
00091 str event;
00093 str content_type;
00094 str content;
00096 dlg_t *dialog;
00098 #ifdef WITH_IMS_PM
00099 unsigned short is_scscf_dereg;
00100 #endif
00101
00102 struct _r_notification *next;
00103 struct _r_notification *prev;
00104 } r_notification;
00105
00107 typedef struct {
00108 gen_lock_t *lock;
00109 r_notification *head;
00110 r_notification *tail;
00111 } r_notification_list;
00112
00113
00114 int r_notify_init();
00115 void r_notify_destroy();
00116
00117
00118 int S_can_subscribe(struct sip_msg *msg,char *str1,char *str2);
00119
00120 int S_subscribe(struct sip_msg *msg,char *str1,char *str2);
00121
00122 int S_SUBSCRIBE_reply(struct sip_msg *msg, int code, char *text,int *expires,str *contact);
00123
00124 int S_event_reg(void *p,void *c,void *s,int event_type,int send_now);
00125
00126
00127 void send_notification(r_notification *n);
00128
00129 void notification_timer(unsigned int ticks, void* param);
00130
00131 r_notification* new_r_notification(str req_uri,str uri,str subscription_state,str event,
00132 str content_type,str content,dlg_t *dialog,int version);
00133 void add_r_notification(r_notification *n);
00134 void free_r_notification(r_notification *n);
00135
00136
00137 #endif //S_CSCF_REGISTRAR_NOTIFY_H_