MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / get_uri_user

Function get_uri_user

modules/auth_aaa/authorize.c:47–67  ·  view source on GitHub ↗

* Extract URI depending on the request from To or From header */

Source from the content-addressed store, hash-verified

45 * Extract URI depending on the request from To or From header
46 */
47static 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/*

Callers 1

authorizeFunction · 0.85

Calls 2

parse_to_uriFunction · 0.85
parse_from_uriFunction · 0.85

Tested by

no test coverage detected