00001 /* 00002 * $Id: ucontact.h 5272 2008-11-27 12:32:26Z henningw $ 00003 * 00004 * Copyright (C) 2001-2003 FhG Fokus 00005 * 00006 * This file is part of Kamailio, a free SIP server. 00007 * 00008 * Kamailio is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version 00012 * 00013 * Kamailio is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 * 00022 * History: 00023 * --------- 00024 * 2003-03-12 added replication mark and three zombie states (nils) 00025 * 2005-07-11 added FL_NAT_SIPPING for nat pinging with SIP method 00026 * instead of UDP package (bogdan) 00027 */ 00028 00035 #ifndef UCONTACT_H 00036 #define UCONTACT_H 00037 00038 00039 #include <stdio.h> 00040 #include <time.h> 00041 #include "../../qvalue.h" 00042 #include "../../str.h" 00043 #include "../usrloc/usrloc.h" 00044 00046 #define UL_EXPIRED_TIME 10 00047 00048 00057 ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, 00058 ucontact_info_t* _ci); 00059 00060 00065 void free_ucontact(ucontact_t* _c); 00066 00067 00073 void print_ucontact(FILE* _f, ucontact_t* _c); 00074 00075 00082 int mem_update_ucontact(ucontact_t* _c, ucontact_info_t *_ci); 00083 00084 00085 /* ===== State transition functions - for write back cache scheme ======== */ 00086 00091 void st_update_ucontact(ucontact_t* _c); 00092 00093 00099 int st_delete_ucontact(ucontact_t* _c); 00100 00101 00107 int st_expired_ucontact(ucontact_t* _c); 00108 00109 00115 int st_flush_ucontact(ucontact_t* _c); 00116 00117 00118 /* ==== Database related functions ====== */ 00119 00125 int db_insert_ucontact(ucontact_t* _c); 00126 00127 00133 int db_update_ucontact(ucontact_t* _c); 00134 00135 00141 int db_delete_ucontact(ucontact_t* _c); 00142 00143 00144 /* ====== Module interface ====== */ 00145 00146 struct urecord; 00147 00155 int update_ucontact(struct urecord* _r, ucontact_t* _c, ucontact_info_t* _ci); 00156 00157 00158 00159 #endif
1.7.1