cr_func.h

Go to the documentation of this file.
00001 /*
00002  * $Id: cr_func.h 5150 2008-10-31 16:45:17Z henningw $
00003  *
00004  * Copyright (C) 2007-2008 1&1 Internet AG
00005  *
00006  * This file is part of Kamailio, a free SIP server.
00007  *
00008  * Kamailio is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version
00012  *
00013  * Kamailio is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License 
00019  * along with this program; if not, write to the Free Software 
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 
00024 /**
00025  * \file cr_func.h
00026  * \brief Routing and balancing functions.
00027  * \ingroup carrierroute
00028  * - Module; \ref carrierroute
00029  */
00030 
00031 #ifndef CR_FUNC_H
00032 #define CR_FUNC_H
00033 
00034 #include "../../parser/msg_parser.h"
00035 #include "../../pvar.h"
00036 #include "../../mod_fix.h"
00037 #include "prime_hash.h"
00038 
00039 
00040 /**
00041  * Loads user carrier from subscriber table and stores it in an AVP.
00042  *
00043  * @param _msg the current SIP message
00044  * @param _user the user to determine the carrier data
00045  * @param _domain the domain to determine the domain data
00046  * @param _dstavp the name of the AVP where to store the carrier id
00047  *
00048  * @return 1 on success, -1 on failure
00049  */
00050 int cr_load_user_carrier(struct sip_msg * _msg, gparam_t *_user,
00051       gparam_t *_domain, gparam_t *_dstavp);
00052 
00053 
00054 /**
00055  * rewrites the request URI of msg after determining the
00056  * new destination URI
00057  *
00058  * @param _msg the current SIP message
00059  * @param _carrier the requested carrier
00060  * @param _domain the requested routing domain
00061  * @param _prefix_matching the user to be used for prefix matching
00062  * @param _rewrite_user the localpart of the URI to be rewritten
00063  * @param _hsrc the SIP header used for hashing
00064  * @param _dstavp the name of the destination AVP where the used host name is stored
00065  *
00066  * @return 1 on success, -1 on failure
00067  */
00068 int cr_route(struct sip_msg * _msg, gparam_t *_carrier,
00069       gparam_t *_domain, gparam_t *_prefix_matching,
00070       gparam_t *_rewrite_user, enum hash_source _hsrc,
00071       gparam_t *_dstavp);
00072 
00073 
00074 /**
00075  * rewrites the request URI of msg after determining the
00076  * new destination URI
00077  *
00078  * @param _msg the current SIP message
00079  * @param _carrier the requested carrier
00080  * @param _domain the requested routing domain
00081  * @param _prefix_matching the user to be used for prefix matching
00082  * @param _rewrite_user the localpart of the URI to be rewritten
00083  * @param _hsrc the SIP header used for hashing
00084  * @param _dstavp the name of the destination AVP where the used host name is stored
00085  *
00086  * @return 1 on success, -1 on failure
00087  */
00088 int cr_prime_route(struct sip_msg * _msg, gparam_t *_carrier,
00089       gparam_t *_domain, gparam_t *_prefix_matching,
00090       gparam_t *_rewrite_user, enum hash_source _hsrc,
00091       gparam_t *_dstavp);
00092 
00093 
00094 /**
00095  * Loads next domain from failure routing table and stores it in an AVP.
00096  *
00097  * @param _msg the current SIP message
00098  * @param _carrier the requested carrier
00099  * @param _domain the requested routing domain
00100  * @param _prefix_matching the user to be used for prefix matching
00101  * @param _host the host name to be used for rule matching
00102  * @param _reply_code the reply code to be used for rule matching
00103  * @param _dstavp the name of the destination AVP
00104  *
00105  * @return 1 on success, -1 on failure
00106  */
00107 int cr_load_next_domain(struct sip_msg * _msg, gparam_t *_carrier,
00108       gparam_t *_domain, gparam_t *_prefix_matching, gparam_t *_host,
00109       gparam_t *_reply_code, gparam_t *_dstavp);
00110 
00111 #endif

Generated on Mon May 21 18:00:25 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6