00001 /* 00002 * $Id: usrloc.c 5193 2008-11-13 10:21:53Z 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 * 00025 * 2006-11-28 Added a new function to the usrloc_api, to retrieve the number 00026 * of registered users. (Jeffrey Magder - SOMA Networks) 00027 */ 00028 00029 /*! \file 00030 * \brief USRLOC - module API exports interfaces 00031 * \ingroup usrloc 00032 * 00033 * - Module \ref usrloc 00034 */ 00035 00036 #include "usrloc.h" 00037 #include "../../sr_module.h" 00038 #include "ul_mod.h" 00039 00040 /*! nat branch flag */ 00041 extern unsigned int nat_bflag; 00042 /*! flag to protect against wrong initialization */ 00043 extern unsigned int init_flag; 00044 00045 00046 /*! 00047 * \brief usrloc module API export bind function 00048 * \param api usrloc API 00049 * \return 0 on success, -1 on failure 00050 */ 00051 int bind_usrloc(usrloc_api_t* api) 00052 { 00053 if (!api) { 00054 LM_ERR("invalid parameter value\n"); 00055 return -1; 00056 } 00057 if (init_flag==0) { 00058 LM_ERR("configuration error - trying to bind to usrloc module" 00059 " before being initialized\n"); 00060 return -1; 00061 } 00062 00063 api->register_udomain = register_udomain; 00064 api->get_all_ucontacts = get_all_ucontacts; 00065 api->insert_urecord = insert_urecord; 00066 api->delete_urecord = delete_urecord; 00067 api->get_urecord = get_urecord; 00068 api->lock_udomain = lock_udomain; 00069 api->unlock_udomain = unlock_udomain; 00070 api->release_urecord = release_urecord; 00071 api->insert_ucontact = insert_ucontact; 00072 api->delete_ucontact = delete_ucontact; 00073 api->get_ucontact = get_ucontact; 00074 api->update_ucontact = update_ucontact; 00075 api->register_ulcb = register_ulcb; 00076 00077 api->use_domain = use_domain; 00078 api->db_mode = db_mode; 00079 api->nat_flag = nat_bflag; 00080 00081 return 0; 00082 }
1.5.6