Add new clearmode codec support for data calls
This new codec will get handled like RFC4040 in yrtpchan, ysipchan and will just be handled as alaw audio in zapcard/DAHDI. The zapcard code will set the udi bearer cap to any calls with the clearmode format (which would get sent via SIP/SDP).pull/2/head
parent
cebbaa38e1
commit
79aea14938
|
@ -449,6 +449,9 @@
|
|||
; alaw: bool: Companded-only G711 a-law (PCMU/8000)
|
||||
;alaw=default
|
||||
|
||||
; clearmode: bool: Transparent 64kbit/s B channel (RFC4040)
|
||||
;clearmode=default
|
||||
|
||||
; gsm: bool: European GSM 06.10 (GSM/8000)
|
||||
;gsm=default
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ static const FormatInfo s_formats[] = {
|
|||
FormatInfo("ilbc30", 50, 30000),
|
||||
// FormatInfo("speex", 0),
|
||||
FormatInfo("g729", 10, 10000),
|
||||
FormatInfo("clearmode", 80, 20000, "data", 0, 1, false),
|
||||
FormatInfo("plain", 0, 0, "text", 0),
|
||||
FormatInfo("raw", 0, 0, "data", 0),
|
||||
};
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace TelEngine {
|
|||
const TokenDict SDPParser::s_payloads[] = {
|
||||
{ "mulaw", 0 },
|
||||
{ "alaw", 8 },
|
||||
{ "clearmode", 97 },
|
||||
{ "gsm", 3 },
|
||||
{ "lpc10", 7 },
|
||||
{ "2*slin", 10 },
|
||||
|
@ -91,6 +92,7 @@ const TokenDict SDPParser::s_rtpmap[] = {
|
|||
{ "MPA/90000", 14 },
|
||||
{ "iLBC/8000", 98 },
|
||||
{ "AMR/8000", 96 },
|
||||
{ "CLEARMODE/8000", 97 },
|
||||
{ "AMR-WB/16000", 99 },
|
||||
{ "SPEEX/8000", 102 },
|
||||
{ "SPEEX/16000", 103 },
|
||||
|
|
|
@ -1665,9 +1665,21 @@ bool ISDNQ931Call::sendSetup(SignallingMessage* sigMsg)
|
|||
m_data.m_transferCapability = sigMsg->params().getValue(YSTRING("transfer-cap"), "speech");
|
||||
m_data.m_transferMode = "circuit";
|
||||
m_data.m_transferRate = "64kbit";
|
||||
m_data.m_format = sigMsg->params().getValue(YSTRING("format"),q931()->format());
|
||||
if (0xffff == lookup(m_data.m_format,Q931Parser::s_dict_bearerProto1,0xffff))
|
||||
m_data.m_format = "alaw";
|
||||
|
||||
const char *formats = sigMsg->params().getValue(YSTRING("formats"), "");
|
||||
|
||||
if (formats && strcmp(formats, "clearmode") == 0)
|
||||
{
|
||||
m_data.m_format = "clearmode";
|
||||
m_data.m_transferCapability = "udi";
|
||||
}
|
||||
else
|
||||
{
|
||||
m_data.m_format = sigMsg->params().getValue(YSTRING("format"),q931()->format());
|
||||
if (0xffff == lookup(m_data.m_format,Q931Parser::s_dict_bearerProto1,0xffff))
|
||||
m_data.m_format = "alaw";
|
||||
}
|
||||
|
||||
m_data.processBearerCaps(msg,true);
|
||||
// ChannelID
|
||||
if (!m_circuit)
|
||||
|
|
|
@ -1225,6 +1225,7 @@ bool SigChannel::startCall(Message& msg, SigTrunk* trunk)
|
|||
sigMsg->params().addParam("callername",msg.getValue("callername"));
|
||||
sigMsg->params().copyParam(msg,"circuits");
|
||||
sigMsg->params().copyParam(msg,"format");
|
||||
sigMsg->params().copyParam(msg,"formats");
|
||||
sigMsg->params().copyParam(msg,"callernumtype");
|
||||
sigMsg->params().copyParam(msg,"callernumplan");
|
||||
if (msg.getValue("privacy") && msg.getBoolValue("privacy",true))
|
||||
|
|
|
@ -981,10 +981,11 @@ static TokenDict s_types[] = {
|
|||
#undef MAKE_NAME
|
||||
|
||||
static TokenDict s_formats[] = {
|
||||
{"slin", ZapDevice::Slin},
|
||||
{"default", ZapDevice::Default},
|
||||
{"mulaw", ZapDevice::Mulaw},
|
||||
{"alaw", ZapDevice::Alaw},
|
||||
{"slin", ZapDevice::Slin},
|
||||
{"default", ZapDevice::Default},
|
||||
{"mulaw", ZapDevice::Mulaw},
|
||||
{"alaw", ZapDevice::Alaw},
|
||||
{"clearmode", ZapDevice::Alaw},
|
||||
{0,0}
|
||||
};
|
||||
#ifdef HAVE_ZAP
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace { // anonymous
|
|||
static TokenDict dict_payloads[] = {
|
||||
{ "mulaw", 0 },
|
||||
{ "alaw", 8 },
|
||||
{ "clearmode", 97 },
|
||||
{ "gsm", 3 },
|
||||
{ "lpc10", 7 },
|
||||
{ "2*slin", 10 },
|
||||
|
|
Loading…
Reference in New Issue