linphone-users
[Top][All Lists]
Advanced

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

[Linphone-users] Suggested changes to source code


From: mls
Subject: [Linphone-users] Suggested changes to source code
Date: Tue, 27 Sep 2016 09:28:42 +0000
User-agent: Roundcube Webmail/0.9.5

Hello all,

I found two issues in Linphone Android, the github version:

Issue one:

When dialing a number containing spaces (like the ones from the Android contact list), the backend crashes with signal 11 , function linphone_proxy_config_normalize_phone_number

My solution:

add a new function to submodules/linphone/coreapi/proxy.c :

//remove spaces
static char *clean_spaces(const char *number){
        char *result=ms_malloc0(strlen(number)+1);
        char *w=result;
        const char *r;
        for(r=number;*r!='\0';++r){
                if (*r!=' '){
                        *w++=*r;
                }
        }
        *w++='\0';
        return result;
}


and change a bit function linphone_proxy_config_normalize_sip_uri as follows:

LinphoneAddress* linphone_proxy_config_normalize_sip_uri(LinphoneProxyConfig *proxy, const char *username2) {
        enum_lookup_res_t *enumres=NULL;
        char *enum_domain=NULL;
        char *tmpurl;
        const char *username;
        LinphoneAddress *uri;

        if (!username2 || *username2=='\0') return NULL;

        username=clean_spaces(username2);

       if (is_enum(username,&enum_domain)){


.... the rest is the same

This seems to fix it.


Issue 2:
When a call is RECEIVED, the notifications are not muted.
You can hear the notification during the incoming call, and all audio gets briefly routed via the loud speaker. This happens only with the incoming calls, not with outgoing.

Solution:
in file src/org/linphone/LinphoneService.java
on line 1082, change a bit this statement:

                if (state == State.Connected) {
                        if (mLc.getCallsNb() == 1) {
                                mAudioManager.abandonAudioFocus(null);
                                requestAudioFocus(STREAM_VOICE_CALL);
                        }

                        if (Hacks.needSoftvolume()) {
                                Log.w("Using soft volume audio hack");
                                adjustVolume(0); // Synchronize
                        }
                setAudioManagerInCallMode(); //added
                requestAudioFocus(STREAM_VOICE_CALL); //added
                }

This seems to fix it.

I don't know id anyone reported this before, but you can take a look.

Thanks






reply via email to

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