00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef CONTACT_OPS_H
00037 #define CONTACT_OPS_H
00038
00039
00040
00041
00042
00043 #include "../../parser/msg_parser.h"
00044 #include "common.h"
00045
00046 #define ENCODE_ALL_CONTACTS 1
00047 #define DECODE_ALL_CONTACTS 1
00048
00049 #define DEFAULT_SEPARATOR "*"
00050
00051
00052 char *contact_flds_separator;
00053
00054
00055 struct uri_format
00056 {
00057 str username;
00058 str password;
00059 str ip;
00060 str port;
00061 str protocol;
00062 str rcv_ip;
00063 str rcv_port;
00064 str rcv_proto;
00065 str transport;
00066 str rest;
00067 int first;
00068 int second;
00069 };
00070
00071 typedef struct uri_format contact_fields_t;
00072
00073
00074 int encode_contact (struct sip_msg *msg, char *encoding_prefix,char *public_ip);
00075 int decode_contact (struct sip_msg *msg, char *unused1,char *unused2);
00076 int decode_contact_header (struct sip_msg *msg, char *unused1,char *unused2);
00077
00078 int encode2format (struct sip_msg* msg, str* uri, struct uri_format *format);
00079 int decode2format (str* uri, char separator, struct uri_format *format);
00080
00081 int encode_uri (struct sip_msg* msg, str* uri, char *encoding_prefix,
00082 char *public_ip,char separator, str * result);
00083 int decode_uri (str* uri, char separator, str * result, str* dst_uri);
00084
00085
00086
00087
00088
00089 #endif