linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] how to disable codecs?


From: Simon Morlat
Subject: Re: [Linphone-developers] how to disable codecs?
Date: Wed, 26 Aug 2009 12:42:13 +0200
User-agent: KMail/1.11.4 (Linux/2.6.30-1-amd64; KDE/4.2.4; x86_64; ; )

Hi,

Your code seems correct. If it is executed before the calls, you should have 
cruis_amr codec present or not in the SDP offer or answer within the INVITE or 
200OK messages (check the logs).
The problem is probably elsewere (you code is not called, or called while the 
calls are already started...).

Simon


Le mardi 25 août 2009 21:54:15, Maxim Podbereznyi a écrit :
> 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]