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

Function dm_send_auth

modules/aaa_diameter/dm_peer.c:105–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104
105static int dm_send_auth(struct dm_message *msg)
106{
107 struct msg *dmsg;
108 struct dm_avp *dm_avp;
109 struct avp *avp;
110 union avp_value val;
111 struct list_head *it;
112 struct dict_object *mar; /* Multimedia-Auth-Request (MAR, code: 286) */
113
114 FD_CHECK(fd_dict_search(fd_g_config->cnf_dict, DICT_COMMAND, CMD_BY_NAME,
115 "Multimedia-Auth-Request", &mar, ENOENT));
116
117 FD_CHECK(fd_msg_new(mar, MSGFL_ALLOC_ETEID, &dmsg));
118
119 /* App id */
120 {
121 struct msg_hdr *h;
122 FD_CHECK(fd_msg_hdr(dmsg, &h));
123 h->msg_appl = AAA_APP_SIP;
124 }
125
126 FD_CHECK(dm_add_session(dmsg, mar));
127
128 /* Auth-Application-Id */
129 {
130 FD_CHECK(fd_msg_avp_new(dm_dict.Auth_Application_Id, 0, &avp));
131
132 memset(&val, 0, sizeof val);
133 val.i32 = AAA_APP_SIP;
134 FD_CHECK(fd_msg_avp_setvalue(avp, &val));
135 FD_CHECK(fd_msg_avp_add(dmsg, MSG_BRW_LAST_CHILD, avp));
136 }
137
138 /* Auth-Session-State */
139 {
140 FD_CHECK(fd_msg_avp_new(dm_dict.Auth_Session_State, 0, &avp));
141
142 memset(&val, 0, sizeof val);
143 val.i32 = NO_STATE_MAINTAINED;
144 FD_CHECK(fd_msg_avp_setvalue(avp, &val));
145 FD_CHECK(fd_msg_avp_add(dmsg, MSG_BRW_LAST_CHILD, avp));
146 }
147
148 /* Origin-* */
149 FD_CHECK(fd_msg_add_origin(dmsg, 0));
150
151 /* Destination-Realm */
152 {
153 FD_CHECK(fd_msg_avp_new(dm_dict.Destination_Realm, 0, &avp));
154
155 memset(&val, 0, sizeof val);
156 val.os.data = (unsigned char *)dm_realm.s;
157 val.os.len = dm_realm.len;
158 FD_CHECK(fd_msg_avp_setvalue(avp, &val));
159 FD_CHECK(fd_msg_avp_add(dmsg, MSG_BRW_LAST_CHILD, avp));
160 }
161
162 /* SIP-AOR */

Callers 1

dm_peer_send_msgFunction · 0.85

Calls 3

dm_add_sessionFunction · 0.85
dm_add_pending_replyFunction · 0.85
list_entryClass · 0.50

Tested by

no test coverage detected