Added support to negotiate gsm half rate on iax.

git-svn-id: http://yate.null.ro/svn/yate/trunk@5554 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2013-06-25 13:21:29 +00:00
parent ed86466da2
commit 5be733d70a
4 changed files with 10 additions and 4 deletions

View File

@ -284,6 +284,9 @@
; gsm: bool: European GSM 06.10
;gsm=enable
; gsmhr: bool: European GSM 06.20 (GSM Half Rate)
;gsmhr=enable
; lpc10: bool: LPC 10
;lpc10=enable

View File

@ -854,6 +854,7 @@ const TokenDict IAXFormat::s_formats[] = {
{"G.726 AAL2", G726AAL2},
{"G.722", G722},
{"AMR", AMR},
{"GSM_HR", GSM_HR},
{"JPEG", JPEG},
{"PNG", PNG},
{"H261", H261},
@ -913,11 +914,10 @@ u_int32_t IAXFormat::encode(const String& formats, const TokenDict* dict, char s
if (!dict)
return 0;
u_int32_t mask = 0;
ObjList* list = formats.split(',',false);
ObjList* list = formats.split(sep,false);
for (ObjList* o = list->skipNull(); o; o = o->skipNext()) {
int fmt = lookup(o->get()->toString(),dict);
if (fmt > 0)
mask |= fmt;
mask |= fmt;
}
TelEngine::destruct(list);
return mask;

View File

@ -693,8 +693,10 @@ public:
G726AAL2 = (1 << 11),
G722 = (1 << 12),
AMR = (1 << 13),
// NOTE: GSM Half Rate is not defined in RFC5456
GSM_HR = (1 << 31),
AudioMask = G723_1 | GSM | ULAW | ALAW | G726 | ADPCM | SLIN | LPC10 | G729 | SPEEX |
ILBC | G726AAL2 | G722 | AMR,
ILBC | G726AAL2 | G722 | AMR | GSM_HR,
JPEG = (1 << 16),
PNG = (1 << 17),
ImageMask = JPEG | PNG,

View File

@ -51,6 +51,7 @@ static const TokenDict dict_payloads[] = {
{"slin", IAXFormat::SLIN},
{"g722", IAXFormat::G722},
{"amr", IAXFormat::AMR},
{"gsmhr", IAXFormat::GSM_HR},
{0, 0}
};