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

Function init_acc_aaa

modules/acc/acc.c:758–816  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756static aaa_map rd_vals[RV_STATIC_MAX];
757
758int init_acc_aaa(char* aaa_proto_url, int srv_type)
759{
760 int n;
761 str prot_url;
762
763 memset(rd_attrs, 0, sizeof(rd_attrs));
764 memset(rd_vals, 0, sizeof(rd_vals));
765
766 rd_attrs[RA_ACCT_STATUS_TYPE].name = "Acct-Status-Type";
767 rd_attrs[RA_SERVICE_TYPE].name = "Service-Type";
768 rd_attrs[RA_SIP_RESPONSE_CODE].name = "Sip-Response-Code";
769 rd_attrs[RA_SIP_METHOD].name = "Sip-Method";
770 rd_attrs[RA_TIME_STAMP].name = "Event-Timestamp";
771 n = RA_STATIC_MAX;
772 /* caution: keep these aligned to core acc output */
773 rd_attrs[n++].name = "Sip-From-Tag";
774 rd_attrs[n++].name = "Sip-To-Tag";
775 rd_attrs[n++].name = "Acct-Session-Id";
776
777 rd_vals[RV_STATUS_START].name = "Start";
778 rd_vals[RV_STATUS_STOP].name = "Stop";
779 rd_vals[RV_STATUS_ALIVE].name = "Alive";
780 rd_vals[RV_STATUS_FAILED].name = "Failed";
781 rd_vals[RV_SIP_SESSION].name = "Sip-Session";
782
783 /* add and count the extras as attributes */
784 n += extra2attrs( aaa_extra_tags, rd_attrs, n);
785
786 /* add and count the legs as attributes */
787 n += extra2attrs( aaa_leg_tags, rd_attrs, n);
788
789 rd_attrs[n++].name = "Sip-Call-Duration";
790 rd_attrs[n++].name = "Sip-Call-MSDuration";
791 rd_attrs[n++].name = "Sip-Call-Setuptime";
792 rd_attrs[n++].name = "Sip-Call-Created";
793
794 prot_url.s = aaa_proto_url;
795 prot_url.len = strlen(aaa_proto_url);
796
797 if(aaa_prot_bind(&prot_url, &proto)) {
798 LM_ERR("AAA protocol bind failure\n");
799 return -1;
800 }
801
802 conn = proto.init_prot(&prot_url);
803 if (!conn) {
804 LM_ERR("AAA protocol initialization failure\n");
805 return -1;
806 }
807
808 INIT_AV(proto, conn, rd_attrs, n, rd_vals, RV_STATIC_MAX, "acc", -1, -1);
809
810 if (srv_type != -1)
811 rd_vals[RV_SIP_SESSION].value = srv_type;
812
813
814 LM_DBG("init_acc_aaa success!\n");
815 return 0;

Callers 1

mod_initFunction · 0.85

Calls 2

extra2attrsFunction · 0.85
aaa_prot_bindFunction · 0.85

Tested by

no test coverage detected