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

Function dm_register_callbacks

modules/aaa_diameter/dm_impl.c:739–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737
738
739int dm_register_callbacks(void)
740{
741 struct disp_when data;
742 struct dict_object *vendor_dict;
743
744 /* accounting */
745 {
746 memset(&data, 0, sizeof data);
747
748 /* Initialize the dictionary objects we use */
749 FD_CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_NAME,
750 "Diameter Base Accounting", &data.app);
751
752 /* Register the dispatch callback */
753 FD_CHECK(fd_disp_register(dm_acc_reply,
754 DISP_HOW_APPID, &data, NULL, NULL));
755
756 /* Advertise support for the Diameter Base Accounting app */
757 FD_CHECK(fd_disp_app_support(data.app, NULL, 0, 1 ));
758 }
759
760 /* auth */
761 {
762 memset(&data, 0, sizeof data);
763
764 /* Initialize the dictionary objects we use */
765 FD_CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_NAME,
766 "Diameter Session Initiation Protocol (SIP) Application", &data.app);
767
768 /* Register the dispatch callback */
769 FD_CHECK(fd_disp_register(dm_auth_reply,
770 DISP_HOW_APPID, &data, NULL, NULL));
771
772 /* Advertise support for the Diameter SIP Application app */
773 FD_CHECK(fd_disp_app_support(data.app, NULL, 0, 1 ));
774 }
775
776 /* custom commands */
777 {
778 int i;
779
780 memset(&data, 0, sizeof data);
781
782 for (i = 0; i < n_app_ids; i++) {
783 /* Initialize the dictionary objects we use */
784 FD_CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID,
785 &app_defs[i].id, &data.app);
786
787 /* Register the dispatch callback */
788 FD_CHECK(fd_disp_register(dm_receive_msg,
789 DISP_HOW_APPID, &data, NULL, NULL));
790
791 if (app_defs[i].vendor != (unsigned int)-1) {
792 FD_CHECK_dict_search(DICT_VENDOR, VENDOR_BY_ID,
793 &app_defs[i].vendor, &vendor_dict);
794 } else {
795 vendor_dict = NULL;
796 }

Callers 1

dm_peer_loopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected