From bd4109babcc810c680a76a5bb990a4dbb5264a58 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 27 Jun 2014 19:27:38 +0200 Subject: mgcp: Document transcoding semantic and follow it Transcoding from GSM to PCMA can lead to the MGCP MGW sending two PCMA packages with the same sequence number and timestamp. Once with the encoded audio and once completely empty. This is because "state->dst_packet_duration" is 0 in most cases (unless a ptime is forced) and we attempt to encode audio even if there are not enough samples. The encode_audio return will return 0 in that case which is not trated as an error by the mgcp network code. Handle rc == 0 specially and document the semantic. --- openbsc/include/openbsc/mgcp.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'openbsc/include') diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index d4d614099..1790f8431 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -87,6 +87,12 @@ typedef int (*mgcp_policy)(struct mgcp_trunk_config *cfg, int endpoint, int stat typedef int (*mgcp_reset)(struct mgcp_trunk_config *cfg); typedef int (*mgcp_rqnt)(struct mgcp_endpoint *endp, char tone); +/** + * Return: + * < 0 in case no audio was processed + * >= 0 in case audio was processed. The remaining payload + * length will be returned. + */ typedef int (*mgcp_processing)(struct mgcp_endpoint *endp, struct mgcp_rtp_end *dst_end, char *data, int *len, int buf_size); -- cgit v1.2.3