* Parse Contact header field body and extract URI * Does not parse headers !! */
| 240 | * Does not parse headers !! |
| 241 | */ |
| 242 | static inline int get_contact_uri(struct sip_msg* _m, str* _uri) |
| 243 | { |
| 244 | contact_t* c; |
| 245 | |
| 246 | _uri->len = 0; |
| 247 | |
| 248 | if (!_m->contact) return 1; |
| 249 | |
| 250 | if (parse_contact(_m->contact) < 0) { |
| 251 | LM_ERR("failed to parse Contact body\n"); |
| 252 | return -2; |
| 253 | } |
| 254 | |
| 255 | c = ((contact_body_t*)_m->contact->parsed)->contacts; |
| 256 | |
| 257 | if (!c) { |
| 258 | LM_ERR("Empty body or * contact\n"); |
| 259 | return -3; |
| 260 | } |
| 261 | |
| 262 | _uri->s = c->uri.s; |
| 263 | _uri->len = c->uri.len; |
| 264 | return 0; |
| 265 | } |
| 266 | |
| 267 | |
| 268 | /* |
no test coverage detected