1 /* 2 * $Id$ 3 * 4 * Copyright (C) 2012 Smile Communications, jason.penton@smilecoms.com 5 * Copyright (C) 2012 Smile Communications, richard.good@smilecoms.com 6 * 7 * The initial version of this code was written by Dragos Vingarzan 8 * (dragos(dot)vingarzan(at)fokus(dot)fraunhofer(dot)de and the 9 * Fruanhofer Institute. It was and still is maintained in a separate 10 * branch of the original SER. We are therefore migrating it to 11 * Kamailio/SR and look forward to maintaining it from here on out. 12 * 2011/2012 Smile Communications, Pty. Ltd. 13 * ported/maintained/improved by 14 * Jason Penton (jason(dot)penton(at)smilecoms.com and 15 * Richard Good (richard(dot)good(at)smilecoms.com) as part of an 16 * effort to add full IMS support to Kamailio/SR using a new and 17 * improved architecture 18 * 19 * NB: Alot of this code was originally part of OpenIMSCore, 20 * FhG Fokus. 21 * Copyright (C) 2004-2006 FhG Fokus 22 * Thanks for great work! This is an effort to 23 * break apart the various CSCF functions into logically separate 24 * components. We hope this will drive wider use. We also feel 25 * that in this way the architecture is more complete and thereby easier 26 * to manage in the Kamailio/SR environment 27 * 28 * This file is part of Kamailio, a free SIP server. 29 * 30 * Kamailio is free software; you can redistribute it and/or modify 31 * it under the terms of the GNU General Public License as published by 32 * the Free Software Foundation; either version 2 of the License, or 33 * (at your option) any later version 34 * 35 * Kamailio is distributed in the hope that it will be useful, 36 * but WITHOUT ANY WARRANTY; without even the implied warranty of 37 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 38 * GNU General Public License for more details. 39 * 40 * You should have received a copy of the GNU General Public License 41 * along with this program; if not, write to the Free Software 42 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 43 * 44 */ 45 46 #ifndef _ISC_CHECKER_H 47 #define _ISC_CHECKER_H 48 49 #include <sys/types.h> /* for regex */ 50 #include <regex.h> 51 #include "../../core/sr_module.h" 52 #include "../../lib/ims/ims_getters.h" 53 #include "../../core/data_lump.h" 54 #include "../../core/data_lump_rpl.h" 55 #include "../../core/parser/parse_content.h" 56 #include "../../core/str.h" 57 #include "../../core/mem/mem.h" 58 #include "ims_isc_mod.h" 59 60 extern usrloc_api_t isc_ulb;/*!< Structure containing pointers to usrloc functions*/ 61 62 #define TRUE 1 63 #define FALSE 0 64 65 /** ISC match structure */ 66 typedef struct { 67 str server_name; /**< SIP URI of the AS to forward to */ 68 char default_handling; /**< handling to apply on failure to contact the AS */ 69 str service_info; /**< additional service information */ 70 int index; /**< index of the matching IFC */ 71 int include_register_request; /**< additional flag from the HSS */ 72 int include_register_response; /**< additional flag from the HSS */ 73 } isc_match; 74 75 76 /** 77 * Find the next match and fill up the ifc_match structure with the position of the match 78 * @param uri - URI of the user for which to apply the IFC 79 * @param direction - direction of the session 80 * @param skip - how many IFCs to skip because already matched 81 * @param msg - the SIP initial request to check on 82 * @return - TRUE if found, FALSE if none found, end of search space 83 */ 84 isc_match* isc_checker_find(str uri,char direction,int skip,struct sip_msg *msg,int registered, udomain_t *d); 85 86 void isc_free_match(isc_match *m); 87 int isc_is_registered(str *uri, udomain_t *d); 88 89 #endif 90