| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
#ifndef LOST_RESPONSE_H |
| 35 |
#define LOST_RESPONSE_H |
| 36 |
|
| 37 |
#define PROP_LANG (const char *)"lang" |
| 38 |
#define PROP_MSG (const char *)"message" |
| 39 |
|
| 40 |
#define ROOT_NODE (const char *)"findServiceResponse" |
| 41 |
#define DISPNAME_NODE (const char *)"displayName" |
| 42 |
#define SERVICE_NODE (const char *)"service" |
| 43 |
#define SERVICENR_NODE (const char *)"serviceNumber" |
| 44 |
#define WARNINGS_NODE (const char *)"warnings" |
| 45 |
#define PATH_NODE (const char *)"via" |
| 46 |
#define PATH_NODE_VIA (const char *)"via" |
| 47 |
#define MAPP_NODE (const char *)"mapping" |
| 48 |
#define MAPP_NODE_URI (const char *)"uri" |
| 49 |
#define MAPP_PROP_EXP (const char *)"expires" |
| 50 |
#define MAPP_PROP_LUP (const char *)"lastUpdated" |
| 51 |
#define MAPP_PROP_SRC (const char *)"source" |
| 52 |
#define MAPP_PROP_SID (const char *)"sourceId" |
| 53 |
|
| 54 |
#define RED_NODE (const char *)"redirect" |
| 55 |
#define RED_PROP_TAR (const char *)"target" |
| 56 |
#define RED_PROP_SRC (const char *)"source" |
| 57 |
#define RED_PROP_MSG (const char *)"message" |
| 58 |
|
| 59 |
#define ERRORS_NODE (const char *)"errors" |
| 60 |
|
| 61 |
#define SIP_S (const char *)"sip:" |
| 62 |
#define SIPS_S (const char *)"sips:" |
| 63 |
|
| 64 |
#define HELD_RESPONSE_REFERENCE 1 |
| 65 |
#define HELD_RESPONSE_VALUE 2 |
| 66 |
|
| 67 |
typedef struct lost_list |
| 68 |
{ |
| 69 |
char *value; |
| 70 |
struct lost_list *next; |
| 71 |
} s_lost_list_t, *p_lost_list_t; |
| 72 |
|
| 73 |
typedef struct lost_info |
| 74 |
{ |
| 75 |
char *text; |
| 76 |
char *lang; |
| 77 |
} s_lost_info_t, *p_lost_info_t; |
| 78 |
|
| 79 |
typedef struct lost_data |
| 80 |
{ |
| 81 |
char *expires; |
| 82 |
char *updated; |
| 83 |
char *source; |
| 84 |
char *sourceid; |
| 85 |
char *urn; |
| 86 |
char *number; |
| 87 |
p_lost_info_t name; |
| 88 |
} s_lost_data_t, *p_lost_data_t; |
| 89 |
|
| 90 |
typedef struct lost_type |
| 91 |
{ |
| 92 |
char *type; |
| 93 |
char *target; |
| 94 |
char *source; |
| 95 |
p_lost_info_t info; |
| 96 |
} s_lost_type_t, *p_lost_type_t; |
| 97 |
|
| 98 |
typedef struct lost_issue |
| 99 |
{ |
| 100 |
p_lost_type_t issue; |
| 101 |
struct lost_issue *next; |
| 102 |
} s_lost_issue_t, *p_lost_issue_t; |
| 103 |
|
| 104 |
typedef enum lost_cat |
| 105 |
{ |
| 106 |
RESPONSE, |
| 107 |
ERROR, |
| 108 |
REDIRECT, |
| 109 |
OTHER = -1 |
| 110 |
} lost_cat_t; |
| 111 |
|
| 112 |
typedef struct lost_fsr |
| 113 |
{ |
| 114 |
lost_cat_t category; |
| 115 |
p_lost_data_t mapping; |
| 116 |
p_lost_issue_t warnings; |
| 117 |
p_lost_issue_t errors; |
| 118 |
p_lost_type_t redirect; |
| 119 |
p_lost_list_t path; |
| 120 |
p_lost_list_t uri; |
| 121 |
} s_lost_fsr_t, *p_lost_fsr_t; |
| 122 |
|
| 123 |
|
| 124 |
p_lost_fsr_t lost_parse_findServiceResponse(str); |
| 125 |
|
| 126 |
int lost_check_HeldResponse(xmlNodePtr); |
| 127 |
|
| 128 |
int lost_append_response_list(p_lost_list_t *, str); |
| 129 |
|
| 130 |
void lost_print_findServiceResponse(p_lost_fsr_t); |
| 131 |
|
| 132 |
void lost_free_findServiceResponse(p_lost_fsr_t *); |
| 133 |
|
| 134 |
|
| 135 |
int is_urn(char *); |
| 136 |
int is_cid(char *); |
| 137 |
int is_http(char *); |
| 138 |
int is_https(char *); |
| 139 |
int is_cid_laquot(char *); |
| 140 |
int is_http_laquot(char *); |
| 141 |
int is_https_laquot(char *); |
| 142 |
|
| 143 |
|
| 144 |
int lost_search_response_list(p_lost_list_t *, char **, const char *); |
| 145 |
|
| 146 |
#endif |