bind_presence.c

Go to the documentation of this file.
00001 /*
00002  * $Id: bind_presence.c 1979 2007-04-06 13:24:12Z anca_vamanu $
00003  *
00004  * presence module - presence server implementation
00005  *
00006  * Copyright (C) 2006 Voice Sistem S.R.L.
00007  *
00008  * This file is part of Kamailio, a free SIP server.
00009  *
00010  * Kamailio is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * Kamailio is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License 
00021  * along with this program; if not, write to the Free Software 
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  * History:
00025  * --------
00026  *  2007-04-17  initial version (Anca Vamanu)
00027  */
00028 
00037 #include <stdio.h>
00038 #include <stdlib.h>
00039 #include "../../dprint.h"
00040 #include "../../sr_module.h"
00041 #include "presence.h"
00042 #include "bind_presence.h"
00043 #include "notify.h"
00044 #include "publish.h"
00045 #include "subscribe.h"
00046 
00047 int bind_presence(presence_api_t* api)
00048 {
00049         if (!api) {
00050                 LM_ERR("Invalid parameter value\n");
00051                 return -1;
00052         }
00053         
00054         api->add_event = add_event;
00055         api->contains_event= contains_event;
00056         api->search_event= search_event;
00057         api->get_event_list= get_event_list;
00058         api->update_watchers_status= update_watchers_status;
00059         api->new_shtable= new_shtable;
00060         api->destroy_shtable= destroy_shtable;
00061         api->insert_shtable= insert_shtable;
00062         api->search_shtable= search_shtable;
00063         api->delete_shtable= delete_shtable;
00064         api->update_shtable= update_shtable;
00065         api->mem_copy_subs= mem_copy_subs;
00066         api->update_db_subs_timer= update_db_subs_timer;
00067         api->extract_sdialog_info= extract_sdialog_info;
00068         api->get_sphere= get_sphere;
00069         api->get_presentity= get_p_notify_body;
00070         api->free_presentity= free_notify_body;
00071         api->pres_auth_status= pres_auth_status;
00072         api->handle_publish= handle_publish;
00073         api->handle_subscribe0= handle_subscribe0;
00074         api->handle_subscribe= handle_subscribe;
00075         return 0;
00076 }
00077 
00078