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

Function ospGetUriUser

modules/osp/sipheader.c:879–900  ·  view source on GitHub ↗

* Get user part from Request-Line header * param msg SIP message * param uriuser User part of To header * param bufsize Size of touser buffer * return 0 success, -1 failure */

Source from the content-addressed store, hash-verified

877 * return 0 success, -1 failure
878 */
879int ospGetUriUser(
880 struct sip_msg* msg,
881 char* uriuser,
882 int bufsize)
883{
884 int result = -1;
885
886 if ((uriuser != NULL) && (bufsize > 0)) {
887 uriuser[0] = '\0';
888 if (parse_sip_msg_uri(msg) >= 0) {
889 ospCopyStrToBuffer(&msg->parsed_uri.user, uriuser, bufsize);
890 ospSkipUserParam(uriuser);
891 result = 0;
892 } else {
893 LM_ERR("failed to parse Request-Line URI\n");
894 }
895 } else {
896 LM_ERR("bad parameters to parse user part from RURI\n");
897 }
898
899 return result;
900}
901
902/*
903 * Get Identity header

Callers 2

ospValidateHeaderFunction · 0.85
ospRequestRoutingFunction · 0.85

Calls 3

parse_sip_msg_uriFunction · 0.85
ospCopyStrToBufferFunction · 0.85
ospSkipUserParamFunction · 0.85

Tested by

no test coverage detected