From 62e836c53394acccc83283ba6b11d462ba8e8483 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 3 Feb 2010 11:03:45 +0100 Subject: [mgcp] Make the mgcp_protocol generate a struct msgb* Do not directly send data from inside the mgcp_protocol.c implementation. Instead allocate and return a struct msgb*. The caller can then either wrap that into the IPA protcol or directly send it over the UDP socket. --- openbsc/include/openbsc/mgcp.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'openbsc/include/openbsc/mgcp.h') diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index 114b39546..ee721d88d 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -21,6 +21,11 @@ * */ +#ifndef OPENBSC_MGCP_H +#define OPENBSC_MGCP_H + +#include "msgb.h" + #define RTP_PORT_DEFAULT 4000 extern unsigned int rtp_base_port; @@ -49,8 +54,9 @@ static inline int rtp_calculate_port(int multiplex, int base) } int mgcp_parse_config(const char *config_file, struct gsm_network *dummy_network); -int mgcp_handle_message(int fd, struct msgb *msg, struct sockaddr_in *source); -int mgcp_send_rsip(int fd, struct sockaddr_in *source); + +struct msgb *mgcp_handle_message(struct msgb *msg); +struct msgb *mgcp_create_rsip(void); int mgcp_vty_init(void); /* endpoint managed */ @@ -60,3 +66,5 @@ int mgcp_vty_init(void); typedef int (*mgcp_change)(int endpoint, int state, int local_rtp, void *); void mgcp_set_change_cb(mgcp_change cb, void *data); + +#endif -- cgit v1.2.3