* Module initialization function */
| 111 | * Module initialization function |
| 112 | */ |
| 113 | static int mod_init(void) |
| 114 | { |
| 115 | str prot_url; |
| 116 | |
| 117 | LM_DBG("initializing\n"); |
| 118 | |
| 119 | memset(attrs, 0, sizeof(attrs)); |
| 120 | memset(vals, 0, sizeof(vals)); |
| 121 | attrs[A_USER_NAME].name = "User-Name"; |
| 122 | attrs[A_SIP_URI_USER].name = "SIP-URI-User"; |
| 123 | attrs[A_SIP_FROM_TAG].name = "SIP-From-Tag"; |
| 124 | attrs[A_SIP_CALL_ID].name = "SIP-Call-Id"; |
| 125 | attrs[A_SIP_REQUEST_HASH].name = "SIP-Request-Hash"; |
| 126 | attrs[A_SIP_AVP].name = "SIP-AVP"; |
| 127 | attrs[A_SERVICE_TYPE].name = "Service-Type"; |
| 128 | vals[V_SIP_VERIFY_DESTINATION].name = "Sip-Verify-Destination"; |
| 129 | vals[V_SIP_VERIFY_SOURCE].name = "Sip-Verify-Source"; |
| 130 | |
| 131 | prot_url.s = aaa_proto_url; |
| 132 | prot_url.len = strlen(aaa_proto_url); |
| 133 | |
| 134 | if(aaa_prot_bind(&prot_url, &proto)) { |
| 135 | LM_ERR("aaa protocol bind failure\n"); |
| 136 | return -1; |
| 137 | } |
| 138 | |
| 139 | if (!(conn = proto.init_prot(&prot_url))) { |
| 140 | LM_ERR("aaa protocol initialization failure\n"); |
| 141 | return -2; |
| 142 | } |
| 143 | |
| 144 | INIT_AV(proto, conn, attrs, A_MAX, vals, V_MAX, "peering", -3, -4); |
| 145 | |
| 146 | if (verify_destination_service_type != -1) |
| 147 | vals[V_SIP_VERIFY_DESTINATION].value = verify_destination_service_type; |
| 148 | |
| 149 | if (verify_source_service_type != -1) |
| 150 | vals[V_SIP_VERIFY_SOURCE].value = verify_source_service_type; |
| 151 | |
| 152 | return 0; |
| 153 | } |
nothing calls this directly
no test coverage detected