Hi all.

I'm facing problems when setting global preferred codecs. What I would like to do is to strictly use specific codec (G.711 a-law) for answering machine mode in my demo application. This is due to the fact that messages that are played (i.e. "please leave your message after the beep" stuff) are recorded using G.711 a-law codec on board. Here is what I'm exactly doing in the app.

   First, register all audio capabilities:

static struct {
   int h323cap, ivanaCap, txFrames, rxFrames;
} cap_conv[] = {
{ OO_G711ULAW64K, MLAW, 20, 160 }, { OO_G711ALAW64K, ALAW, 20, 160 },
   { OO_G729, G729, 20, 80 },
   { OO_G728, G728, 20, 160 },
   { OO_G726_40K, G726_40, 20, 80 },
   { OO_G726_32K, G726_32, 20, 80 },
   { OO_G726_24K, G726_24, 20, 80 },
   { OO_G726_16K, G726_16, 20, 80 },
   { OO_G7231, G723_63, 20, 80 }
};
OOCapPrefs codecList;
...

/* Add audio capabilities and store them */
codecList.index = SIZEOF_CAP_CONV;
for (unsigned i=0;i<SIZEOF_CAP_CONV;i++) {
   ooCapabilityAddSimpleCapability(NULL,cap_conv[i].h323cap,
        cap_conv[i].txFrames, cap_conv[i].rxFrames, FALSE, OORXANDTX,
        &spcEpStartReceiveChannel, &spcEpStartTransmitChannel,
        &spcEpStopReceiveChannel, &spcEpStopTransmitChannel, FALSE);
codecList.order[i] = cap_conv[i].h323cap; }

When the application is running, I can turn on/off answering machine mode like this:
                   m_answermachineenabled = !m_answermachineenabled;
                   if (m_answermachineenabled)  {
                       ooH323EpEnableAutoAnswer();
                       ooChangeCapPrefOrder(NULL, OO_G711ALAW64K, 0);
                   }
                   else {
                       ooH323EpDisableAutoAnswer();
                       ooResetCapPrefs(NULL);
                       for (int i=0; i<codecList.index; i++)
                           ooAppendCapToCapPrefs(NULL, codecList.order[i]);
                   }

However, when I really enable answering machine mode, two endpoints still negotiate wrong codec (OO_G711ULAW64K), i.e. the first registered codec from cap_conv[]. Why is this happening? What am I doing wrong? I'm always using faststart. Can this be a problem?

   Regards,
      Aleksandar

--
Aleksandar Sutic
phone: +381 65 311 2317
e-mail: [EMAIL PROTECTED]
web:    www.sutic.dzaba.com



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
ooh323c-devel mailing list
ooh323c-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ooh323c-devel

Reply via email to