siputils/checks.h

Go to the documentation of this file.
00001 /*
00002  * $Id: checks.h 5289 2008-12-03 14:33:13Z henningw $
00003  *
00004  * Various URI checks
00005  *
00006  * Copyright (C) 2001-2003 FhG Fokus
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  * 2003-03-26 created by janakj
00027  * 2004-04-14 uri_param and add_uri_param introduced (jih)
00028  */
00029 
00030 
00031 #ifndef CHECKS_H
00032 #define CHECKS_H
00033 
00034 #include "../../parser/msg_parser.h"
00035 
00036 
00037 /*
00038  * Check if given username matches those in digest credentials
00039  */
00040 int is_user(struct sip_msg* _msg, char* _user, char* _str2);
00041 
00042 
00043 /*
00044  * Check if message includes a to-tag
00045  */
00046 int has_totag(struct sip_msg* _m, char* _foo, char* _bar);
00047 
00048 
00049 /*
00050  * Find if Request URI has a given parameter with no value
00051  */
00052 int uri_param_1(struct sip_msg* _msg, char* _param, char* _str2);
00053 
00054 
00055 /*
00056  * Find if Request URI has a given parameter with matching value
00057  */
00058 int uri_param_2(struct sip_msg* _msg, char* _param, char* _value);
00059 
00060 
00061 /*
00062  * Adds a new parameter to Request URI
00063  */
00064 int add_uri_param(struct sip_msg* _msg, char* _param, char* _s2);
00065 
00066 
00067 /*
00068  * Converts Request-URI, if it is tel URI, to SIP URI.  Returns 1, if
00069  * conversion succeeded or if no conversion was needed, i.e., Request-URI
00070  * was not tel URI.  Returns -1, if conversion failed.
00071  */
00072 int tel2sip(struct sip_msg* _msg, char* _s1, char* _s2);
00073 
00074 
00075 /*
00076  * Check if user part of URI in pseudo variable is an e164 number
00077  */
00078 int is_uri_user_e164(struct sip_msg* _m, char* _sp, char* _s2);
00079 
00080 #endif /* CHECKS_H */

Generated on Thu May 24 12:00:24 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6