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

Function dm_init_sip_application

modules/aaa_diameter/dm_impl.c:1171–1512  ·  view source on GitHub ↗

Register the Diameter SIP Application (RFC 4740) commands, AVPs, etc. */

Source from the content-addressed store, hash-verified

1169
1170/* Register the Diameter SIP Application (RFC 4740) commands, AVPs, etc. */
1171int dm_init_sip_application(void)
1172{
1173 struct dict_object *sip;
1174 struct dict_object * UTF8String_type;
1175
1176 struct dict_application_data data =
1177 { 6, "Diameter Session Initiation Protocol (SIP) Application" };
1178 FD_CHECK_dict_new(DICT_APPLICATION, &data, NULL, &sip);
1179
1180 FD_CHECK_dict_search(DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type);
1181
1182 /* SIP-Server-URI */
1183 {
1184 /*
1185 The SIP-Server-URI AVP (AVP Code 371) is of type UTF8String. This
1186 AVP contains a SIP or SIPS URI (as defined in RFC 3261 [RFC3261])
1187 that identifies a SIP server.
1188 */
1189 struct dict_avp_data data = {
1190 371, /* Code */
1191 0, /* Vendor */
1192 "SIP-Server-URI", /* Name */
1193 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */
1194 AVP_FLAG_MANDATORY, /* Fixed flag values */
1195 AVP_TYPE_OCTETSTRING /* base type of data */
1196 };
1197 FD_CHECK_dict_new(DICT_AVP, &data, UTF8String_type, NULL);
1198 }
1199
1200 /* SIP-Method */
1201 {
1202 /*
1203 The SIP-Method-AVP (AVP Code 393) is of type UTF8String and contains
1204 the method of the SIP request that triggered the Diameter message.
1205 The Diameter server MUST use this AVP solely for authorization of SIP
1206 requests, and MUST NOT use it to compute the Digest authentication.
1207 To compute the Digest authentication, the Diameter server MUST use
1208 the Digest-Method AVP instead.
1209 */
1210 struct dict_avp_data data = {
1211 393, /* Code */
1212 0, /* Vendor */
1213 "SIP-Method", /* Name */
1214 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */
1215 AVP_FLAG_MANDATORY, /* Fixed flag values */
1216 AVP_TYPE_OCTETSTRING /* base type of data */
1217 };
1218 FD_CHECK_dict_new(DICT_AVP, &data, UTF8String_type, NULL);
1219 }
1220
1221 /* SIP-Number-Auth-Items */
1222 {
1223 /*
1224 The SIP-Number-Auth-Items AVP (AVP Code 382) is of type Unsigned32
1225 and indicates the number of authentication and/or authorization
1226 credentials that the Diameter server included in a Diameter message.
1227
1228 When the AVP is present in a request, it indicates the number of

Callers 2

dm_peer_loopFunction · 0.85
dm_init_minimalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected