presence_profile/add_events.c

Go to the documentation of this file.
00001 /*
00002  *
00003  * Copyright (C) 2011 Mészáros Mihály
00004  *
00005  * This file is part of Kamailio, a free SIP server.
00006  *
00007  * Kamailio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version
00011  *
00012  * Kamailio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License 
00018  * along with this program; if not, write to the Free Software 
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  * History:
00022  * --------
00023  *  2011-09-22  initial version (misi)
00024  */
00025 
00034 #include <stdio.h>
00035 #include <stdlib.h>
00036 #include <string.h>
00037 #include "../../parser/parse_content.h"
00038 #include "../presence/event_list.h"
00039 #include "presence_profile.h"
00040 
00041 
00042 int profile_add_events(void)
00043 {
00044     pres_ev_t event;
00045         
00046     /* constructing profile event */
00047     memset(&event, 0, sizeof(pres_ev_t));
00048     event.name.s = "ua-profile";
00049     event.name.len = 10;
00050 
00051 
00052     event.content_type.s = "text/xml";
00053     event.content_type.len = 8;
00054 
00055     event.default_expires= 3600;
00056     event.type = PUBL_TYPE;
00057     event.req_auth = 0;
00058     event.evs_publ_handl = 0;
00059     
00060     if (pres_add_event(&event) < 0) {
00061         LM_ERR("failed to add event \"ua-profile\"\n");
00062         return -1;
00063     }           
00064         
00065     return 0;
00066 }