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

Function mod_init

modules/uac_auth/uac_auth.c:112–139  ·  view source on GitHub ↗

Module init function */

Source from the content-addressed store, hash-verified

110
111/** Module init function */
112static int mod_init(void)
113{
114 pv_spec_t user_spec;
115 pv_spec_t realm_spec;
116 pv_spec_t pwd_spec;
117
118 LM_DBG("start\n");
119
120 /* parse the auth AVP spesc, if any */
121 if ( auth_username_avp || auth_password_avp || auth_realm_avp) {
122 if (!auth_username_avp || !auth_password_avp || !auth_realm_avp) {
123 LM_ERR("partial definition of auth AVP!\n");
124 return -1;
125 }
126 if ( parse_auth_avp(auth_realm_avp, &realm_spec, "realm")<0
127 || parse_auth_avp(auth_username_avp, &user_spec, "username")<0
128 || parse_auth_avp(auth_password_avp, &pwd_spec, "password")<0
129 || pv_get_avp_name(0, &(realm_spec.pvp), &(realm_avp_name), &(realm_avp_type) )!=0
130 || pv_get_avp_name(0, &(user_spec.pvp), &(user_avp_name), &(user_avp_type) )!=0
131 || pv_get_avp_name(0, &(pwd_spec.pvp), &(pwd_avp_name), &(pwd_avp_type) )!=0
132 ) {
133 LM_ERR("invalid AVP definition for AUTH avps\n");
134 return -1;
135 }
136 }
137
138 return 0;
139}
140
141
142

Callers

nothing calls this directly

Calls 2

parse_auth_avpFunction · 0.85
pv_get_avp_nameFunction · 0.85

Tested by

no test coverage detected