1 /* 2 * pua module - presence user agent module 3 * 4 * Copyright (C) 2006 Voice Sistem S.R.L. 5 * 6 * This file is part of Kamailio, a free SIP server. 7 * 8 * Kamailio is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version 12 * 13 * Kamailio is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 */ 22 23 24 #ifndef _PU_SEND_PUBLISH_ 25 #define _PU_SEND_PUBLISH_ 26 #include <time.h> 27 #include "../../modules/tm/tm_load.h" 28 #include "../../core/str.h" 29 #include "hash.h" 30 #include "event_list.h" 31 #define ERR_PUBLISH_NO_BODY -10 32 33 typedef struct publ_info 34 { 35 str id; 36 str* pres_uri; 37 str* body; 38 int expires; 39 int flag; 40 int source_flag; 41 int event; 42 str content_type; /*! the content_type of the body if present(optional if the 43 same as the default value for that event) */ 44 str* etag; 45 str* outbound_proxy; 46 str* extra_headers; 47 void* cb_param; /*! the parameter for the function to be called on the callback 48 for the received reply; it must be allocated in share memory; 49 a reference to it will be found in the cb_param filed of the ua_pres_structure 50 receied as a parameter for the registered function*/ 51 }publ_info_t; 52 53 typedef int (*send_publish_t)(publ_info_t* publ); 54 int send_publish( publ_info_t* publ ); 55 56 void publ_cback_func(struct cell *t, int type, struct tmcb_params *ps); 57 str* publ_build_hdr(int expires, pua_event_t* event, str* content_type, str* etag, 58 str* extra_headers, int is_body); 59 ua_pres_t* publish_cbparam(publ_info_t* publ, str* body, str* tuple_id, 60 int ua_flag); 61 62 #endif 63