linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] how to disable codecs?


From: Maxim Podbereznyi
Subject: [Linphone-developers] how to disable codecs?
Date: Tue, 25 Aug 2009 23:54:15 +0400

Hi everybody!

I have a console version of linphone-3.0.0 ported to ARM with added some functionality such as enabling and disabling codecs on the fly. Also I added my peculiar codec to linphone with which SIP-clients in our network can have conversations safely.

I use the following code to enable/disable codecs:

void set_codec(int g711, int amr)
{
    codecs_config_t *config=&lc->codecs_conf;
    PayloadType *pt;
    MSList *node;
    for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){
        pt=(PayloadType*)(node->data);
        if (strcmp(pt->mime_type, "cruis_amr")==0) {
            if (!amr) {
                debug(("disable AMR\n"));
                payload_type_set_enable(pt,0);
            }
            else {
                debug(("enable AMR\n"));
                payload_type_set_enable(pt,1);
            }
            continue;
        }
        if ((strcmp(pt->mime_type, "PCMU")==0) || (strcmp(pt->mime_type, "PCMA")==0)) {
            if (!g711) {
                debug(("disable %s\n",pt->mime_type));
                payload_type_set_enable(pt,0);
            }
            else {
                debug(("enable %s\n",pt->mime_type));
                payload_type_set_enable(pt,1);
            }
        }
    }
}

The problem is that my codec (described as cruis_amr above) is not fully disabled. Actually if g711 is disabled or not is not important, because cruis_amr is safty codec. Two peers get connected with cruis_amr codec always if the calling peer has cruis_amr codec enabled, while the called peer can have it disabled. So I don't understand which additional steps I should perform to avoid such mistakes (safety call should be safety :) ).

I appreciate any help.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]