mgcp: Change API to remove memory management from the name

Jacob pointed out that "free_endp" refers to the memory of
the endpoint being freed. What we want is actually a way to
release an endpoint (and the resource it allocated) or in
the case of the testcase/testapp initialize the data structure
correctly. Introduce two names for that.
diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c
index f25c1fa..1198c24 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -940,7 +940,7 @@
 		if (tcfg->force_realloc) {
 			LOGP(DMGCP, LOGL_NOTICE, "Endpoint 0x%x already allocated. Forcing realloc.\n",
 			    ENDPOINT_NUMBER(endp));
-			mgcp_free_endp(endp);
+			mgcp_release_endp(endp);
 			if (p->cfg->realloc_cb)
 				p->cfg->realloc_cb(tcfg, ENDPOINT_NUMBER(endp));
 		} else {
@@ -1006,7 +1006,7 @@
 		case MGCP_POLICY_REJECT:
 			LOGP(DMGCP, LOGL_NOTICE, "CRCX rejected by policy on 0x%x\n",
 			     ENDPOINT_NUMBER(endp));
-			mgcp_free_endp(endp);
+			mgcp_release_endp(endp);
 			return create_err_response(endp, 400, "CRCX", p->trans);
 			break;
 		case MGCP_POLICY_DEFER:
@@ -1033,7 +1033,7 @@
 	create_transcoder(endp);
 	return create_response_with_sdp(endp, "CRCX", p->trans);
 error2:
-	mgcp_free_endp(endp);
+	mgcp_release_endp(endp);
 	LOGP(DMGCP, LOGL_NOTICE, "Resource error on 0x%x\n", ENDPOINT_NUMBER(endp));
 	return create_err_response(endp, error_code, "CRCX", p->trans);
 }
@@ -1248,7 +1248,7 @@
 	mgcp_format_stats(endp, stats, sizeof(stats));
 
 	delete_transcoder(endp);
-	mgcp_free_endp(endp);
+	mgcp_release_endp(endp);
 	if (p->cfg->change_cb)
 		p->cfg->change_cb(endp->tcfg, ENDPOINT_NUMBER(endp), MGCP_ENDP_DLCX);
 
@@ -1488,9 +1488,9 @@
 	return 0;
 }
 
-void mgcp_free_endp(struct mgcp_endpoint *endp)
+void mgcp_release_endp(struct mgcp_endpoint *endp)
 {
-	LOGP(DMGCP, LOGL_DEBUG, "Deleting endpoint on: 0x%x\n", ENDPOINT_NUMBER(endp));
+	LOGP(DMGCP, LOGL_DEBUG, "Releasing endpoint on: 0x%x\n", ENDPOINT_NUMBER(endp));
 	endp->ci = CI_UNUSED;
 	endp->allocated = 0;
 
@@ -1516,6 +1516,11 @@
 	memset(&endp->taps, 0, sizeof(endp->taps));
 }
 
+void mgcp_initialize_endp(struct mgcp_endpoint *endp)
+{
+	return mgcp_release_endp(endp);
+}
+
 static int send_trans(struct mgcp_config *cfg, const char *buf, int len)
 {
 	struct sockaddr_in addr;
diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/openbsc/src/libmgcp/mgcp_vty.c
index 42d99e7..8633668 100644
--- a/openbsc/src/libmgcp/mgcp_vty.c
+++ b/openbsc/src/libmgcp/mgcp_vty.c
@@ -1047,7 +1047,7 @@
 	}
 
 	endp = &trunk->endpoints[endp_no];
-	mgcp_free_endp(endp);
+	mgcp_release_endp(endp);
 	return CMD_SUCCESS;
 }