/****************************************************************************** * Copyright (c) 2000-2023 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * * Contributors: * Gabor Szalai - initial implementation and initial documentation * Peter Kremer * Sandor Palugyai * Tibor Harai ******************************************************************************/ #include "Payloadgen_Types.hh" namespace Payloadgen__Types{ OCTETSTRING f__generate__comfort__noise(const INTEGER& level, const Coefficient__list& coefficients) { if(level<0 || level>127) TTCN_error("Invalid comfort noise level value: %d", (int)level); OCTETSTRING ret_val = int2oct(level, 1); for(int i=0;i1) { TTCN_error("Invalid comfort noise coefficient value(%d): %f", i, (double)coefficients[i]); } ret_val = ret_val + int2oct(float2int(( ((double)coefficients[i]*32768)/258)+127.0), 1); } return ret_val; } OCTETSTRING f__generate__tones__events(const Tones__DTMFs& events_dtmfs) { OCTETSTRING header(0,0), value(0,0); for(int i=0;i