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

Function dm_add_session

modules/aaa_diameter/dm_peer.c:73–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73static inline int dm_add_session(struct msg *msg, struct dict_object *model)
74{
75 struct avp *avp;
76 union avp_value val;
77 os0_t sess_bkp;
78 size_t sess_bkp_len;
79
80 /* Session-Id */
81 {
82 struct session * sess = NULL;
83 os0_t s;
84 FD_CHECK(fd_sess_new( &sess, fd_g_config->cnf_diamid, fd_g_config->cnf_diamid_len, NULL, 0));
85 FD_CHECK(fd_sess_getsid(sess, &s, &sess_bkp_len));
86 sess_bkp = os0dup(s, sess_bkp_len);
87 if (!sess_bkp) {
88 LM_ERR("oom\n");
89 return -1;
90 }
91
92 FD_CHECK(fd_dict_search(fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Session-Id", &model, ENOENT));
93 FD_CHECK(fd_msg_avp_new(model, 0, &avp));
94 memset(&val, 0, sizeof val);
95 val.os.data = sess_bkp;
96 val.os.len = sess_bkp_len;
97 FD_CHECK(fd_msg_avp_setvalue(avp, &val));
98 FD_CHECK(fd_msg_avp_add(msg, MSG_BRW_FIRST_CHILD, avp));
99 }
100
101 return 0;
102}
103
104
105static int dm_send_auth(struct dm_message *msg)

Callers 2

dm_send_authFunction · 0.85
dm_send_acctFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected