* Extract URI depending on the request from To or From header */
| 45 | * Extract URI depending on the request from To or From header |
| 46 | */ |
| 47 | static inline int get_uri_user(struct sip_msg* _m, str** _uri_user) |
| 48 | { |
| 49 | struct sip_uri *puri; |
| 50 | |
| 51 | if ((REQ_LINE(_m).method.len == 8) && |
| 52 | (memcmp(REQ_LINE(_m).method.s, "REGISTER", 8) == 0)) { |
| 53 | if ((puri=parse_to_uri(_m))==NULL) { |
| 54 | LM_ERR("failed to parse To header\n"); |
| 55 | return -1; |
| 56 | } |
| 57 | } else { |
| 58 | if ((puri=parse_from_uri(_m))==NULL) { |
| 59 | LM_ERR("parsing From header\n"); |
| 60 | return -1; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | *_uri_user = &(puri->user); |
| 65 | |
| 66 | return 0; |
| 67 | } |
| 68 | |
| 69 | |
| 70 | /* |
no test coverage detected