contact_ops.h

Go to the documentation of this file.
00001 /*
00002  * $Id: contact_ops.h 5318 2008-12-08 16:38:47Z henningw $
00003  *
00004  *  mangler module
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-04-07 first version.  
00027  */
00028 
00029 /* TODO :decode2format unpleasant */
00030 
00031 #ifndef CONTACT_OPS_H
00032 #define CONTACT_OPS_H
00033 
00034 /* if you want to parse all contacts not just de first one */
00035 
00036 
00037 
00038 #include "../../parser/msg_parser.h"   /* struct sip_msg */
00039 
00040 #define ENCODE_ALL_CONTACTS 1
00041 #define DECODE_ALL_CONTACTS 1
00042 
00043 #define DEFAULT_SEPARATOR "*"
00044 
00045 
00046 char *contact_flds_separator;
00047 
00048 
00049 struct uri_format
00050 {
00051    str username;
00052    str password;
00053    str ip;
00054    str port;
00055    str protocol;
00056    int first;
00057    int second;
00058 };
00059 
00060 typedef struct uri_format contact_fields_t;
00061 
00062 
00063 int encode_contact (struct sip_msg *msg, char *encoding_prefix,char *public_ip);
00064 int decode_contact (struct sip_msg *msg, char *unused1,char *unused2);
00065 int decode_contact_header (struct sip_msg *msg, char *unused1,char *unused2);
00066    
00067 int encode2format (str uri, struct uri_format *format);
00068 int decode2format (str uri, char separator, struct uri_format *format);
00069 
00070 int encode_uri (str uri, char *encoding_prefix, char *public_ip,char separator, str * result);
00071 int decode_uri (str uri, char separator, str * result);
00072 
00073 
00074 
00075 
00076 
00077 #endif

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