registrar_notify.h

Go to the documentation of this file.
00001 /*
00002  * $Id: registrar_notify.h 560 2008-05-22 15:26:09Z vingarzan $
00003  *  
00004  * Copyright (C) 2004-2006 FhG Fokus
00005  *
00006  * This file is part of Open IMS Core - an open source IMS CSCFs & HSS
00007  * implementation
00008  *
00009  * Open IMS Core is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * For a license to use the Open IMS Core software under conditions
00015  * other than those described here, or to purchase support for this
00016  * software, please contact Fraunhofer FOKUS by e-mail at the following
00017  * addresses:
00018  *     info@open-ims.org
00019  *
00020  * Open IMS Core is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU General Public License for more details.
00024  * 
00025  * It has to be noted that this Open Source IMS Core System is not 
00026  * intended to become or act as a product in a commercial context! Its 
00027  * sole purpose is to provide an IMS core reference implementation for 
00028  * IMS technology testing and IMS application prototyping for research 
00029  * purposes, typically performed in IMS test-beds.
00030  * 
00031  * Users of the Open Source IMS Core System have to be aware that IMS
00032  * technology may be subject of patents and licence terms, as being 
00033  * specified within the various IMS-related IETF, ITU-T, ETSI, and 3GPP
00034  * standards. Thus all Open IMS Core users have to take notice of this 
00035  * fact and have to agree to check out carefully before installing, 
00036  * using and extending the Open Source IMS Core System, if related 
00037  * patents and licences may become applicable to the intended usage 
00038  * context.  
00039  *
00040  * You should have received a copy of the GNU General Public License
00041  * along with this program; if not, write to the Free Software
00042  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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_

Generated on Thu Oct 23 04:14:39 2008 for Open IMS Core CSCFs by  doxygen 1.5.2