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

Function make_send_message

modules/aaa_radius/aaa_radius.c:298–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296
297
298int make_send_message(struct sip_msg* msg, int index, VALUE_PAIR **send) {
299
300 pv_value_t pt;
301 map_list *mp = sets[index]->parsed;
302
303 for (; mp; mp = mp->next) {
304 if (pv_get_spec_value(msg, mp->pv, &pt) < 0)
305 return -1;
306
307 if (pt.flags & PV_VAL_INT) {
308 //LM_DBG("%.*s---->%d---->%d---->%d\n",mp->name.len, mp->name.s,
309 // pt.ri, mp->value, pt.flags);
310
311 if (!rc_avpair_add(rh, send, ATTRID(mp->value), &pt.ri, -1, VENDOR(mp->value)))
312 return -1;
313 }
314 else
315 if (pt.flags & PV_VAL_STR) {
316 //LM_DBG("%.*s----->%.*s---->%d---->%d---->%d\n",mp->name.len,
317 // mp->name.s, pt.rs.len, pt.rs.s, mp->value, pt.flags, pt.rs.len);
318 if (rc_dict_getattr(rh,mp->value)->type == PW_TYPE_IPADDR) {
319 uint32_t ipaddr=rc_get_ipaddr(pt.rs.s);
320 if (!rc_avpair_add(rh, send, ATTRID(mp->value), &ipaddr, -1, VENDOR(mp->value)))
321 return -1;
322 } else {
323 if (!rc_avpair_add(rh, send, ATTRID(mp->value), pt.rs.s, pt.rs.len, VENDOR(mp->value)))
324 return -1;
325 }
326 }
327 }
328 return 0;
329}
330
331
332int send_auth_func(struct sip_msg* msg, str* s1, str* s2) {

Callers 4

send_auth_funcFunction · 0.85
send_auth_func_asyncFunction · 0.85
send_acct_funcFunction · 0.85
send_acct_func_asyncFunction · 0.85

Calls 2

pv_get_spec_valueFunction · 0.85
rc_get_ipaddrFunction · 0.85

Tested by

no test coverage detected