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

Function parse_from_uri

parser/parse_from.c:95–126  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

93 *
94 */
95struct sip_uri *parse_from_uri(struct sip_msg *msg)
96{
97 struct to_body *tb = NULL;
98
99 if(msg==NULL)
100 return NULL;
101
102 if(parse_from_header(msg)<0)
103 {
104 LM_ERR("cannot parse FROM header\n");
105 return NULL;
106 }
107
108 if(msg->from==NULL || get_from(msg)==NULL)
109 return NULL;
110
111 tb = get_from(msg);
112
113 if(tb->parsed_uri.user.s!=NULL || tb->parsed_uri.host.s!=NULL)
114 return &tb->parsed_uri;
115
116 if (parse_uri(tb->uri.s, tb->uri.len , &tb->parsed_uri)<0)
117 {
118 LM_ERR("failed to parse From uri\n");
119 memset(&tb->parsed_uri, 0, sizeof(struct sip_uri));
120 set_err_info(OSER_EC_PARSER, OSER_EL_MEDIUM, "error parsing From uri");
121 set_err_reply(400, "bad From uri");
122 return NULL;
123 }
124
125 return &tb->parsed_uri;
126}

Callers 15

pv_get_xto_attrFunction · 0.85
get_realmFunction · 0.85
rls_handle_subscribeFunction · 0.85
w_sip_validateFunction · 0.85
ruri_tel2sipFunction · 0.85
sd_lookupFunction · 0.85
is_from_localFunction · 0.85
check_fromFunction · 0.85
ospParseSubscribeFunction · 0.85
get_uris_to_subscribeFunction · 0.85
get_username_domainFunction · 0.85
aaa_is_user_inFunction · 0.85

Calls 4

parse_from_headerFunction · 0.85
parse_uriFunction · 0.85
set_err_infoFunction · 0.85
set_err_replyFunction · 0.85

Tested by

no test coverage detected