enum.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Header file for Enum and E164 related functions
00005  *
00006  * Copyright (C) 2002-2008 Juha Heinanen
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  */
00032 #ifndef ENUM_H
00033 #define ENUM_H
00034 
00035 
00036 #include "../../parser/msg_parser.h"
00037 
00038 
00039 #define MAX_DOMAIN_SIZE 256
00040 #define MAX_COMPONENT_SIZE 32  /* separator, apex, ... This simplifies checks */
00041                 
00042 
00043 /*
00044  * Check if from user is an e164 number and has a naptr record
00045  */
00046 int is_from_user_enum_0(struct sip_msg* _msg, char* _str1, char* _str2);
00047 int is_from_user_enum_1(struct sip_msg* _msg, char* _suffix, char* _str2);
00048 int is_from_user_enum_2(struct sip_msg* _msg, char* _suffix, char* _service);
00049 
00050 /*
00051  * do source number destination routing.
00052  * that is, make the ruri based on the from number
00053  * this is like source ip policy routing
00054  */
00055 int enum_pv_query_1(struct sip_msg* _msg, char* _sp);
00056 int enum_pv_query_2(struct sip_msg* _msg, char* _sp, char* _suffix);
00057 int enum_pv_query_3(struct sip_msg* _msg, char* _sp, char* _suffix,
00058                     char* _service);
00059 
00060 /*
00061  * Make enum query and if query succeeds, replace current uri with the
00062  * result of the query
00063  */
00064 int enum_query(struct sip_msg* _msg, str* suffix, str* service);
00065 int enum_query_0(struct sip_msg* _msg, char* _str1, char* _str2);
00066 int enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2);
00067 int enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service);
00068 
00069 /*
00070  * Infrastructure ENUM versions.
00071  */
00072 int i_enum_query_0(struct sip_msg* _msg, char* _str1, char* _str2);
00073 int i_enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2);
00074 int i_enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service);
00075 
00076 
00077 #endif /* ENUM_H */