Go to the documentation of this file.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
00036 #include "usrloc.h"
00037 #include "dlist.h"
00038 #include "urecord.h"
00039 #include "ucontact.h"
00040 #include "udomain.h"
00041 #include "../../sr_module.h"
00042 #include "ul_mod.h"
00043
00045 extern unsigned int nat_bflag;
00047 extern unsigned int init_flag;
00048
00049
00055 int bind_usrloc(usrloc_api_t* api)
00056 {
00057 if (!api) {
00058 LM_ERR("invalid parameter value\n");
00059 return -1;
00060 }
00061 if (init_flag==0) {
00062 LM_ERR("configuration error - trying to bind to usrloc module"
00063 " before being initialized\n");
00064 return -1;
00065 }
00066
00067 api->register_udomain = register_udomain;
00068 api->get_udomain = get_udomain;
00069 api->get_all_ucontacts = get_all_ucontacts;
00070 api->insert_urecord = insert_urecord;
00071 api->delete_urecord = delete_urecord;
00072 api->get_urecord = get_urecord;
00073 api->lock_udomain = lock_udomain;
00074 api->unlock_udomain = unlock_udomain;
00075 api->release_urecord = release_urecord;
00076 api->insert_ucontact = insert_ucontact;
00077 api->delete_ucontact = delete_ucontact;
00078 api->get_ucontact = get_ucontact;
00079 api->update_ucontact = update_ucontact;
00080 api->register_ulcb = register_ulcb;
00081 api->get_aorhash = ul_get_aorhash;
00082
00083 api->get_urecord_by_ruid = get_urecord_by_ruid;
00084 api->get_ucontact_by_instance = get_ucontact_by_instance;
00085
00086 api->use_domain = use_domain;
00087 api->db_mode = db_mode;
00088 api->nat_flag = nat_bflag;
00089
00090 return 0;
00091 }