make a call

You must Login before you can answer or comment on any questions.

hi,

i developped an application to make a call. i tested it on iOS 5 it works. i just tested it on iOS 4. it doesn't work.

here is the code :

exports.call = function(number){
 
    var codeConfidentiel = Ti.App.Properties.getString('MJTelecomCode');
    var passerelle = Ti.App.Properties.getString('MJTelecomPasserelle');
 
    if(passerelle == null){
        alert('Veuillez choisir une passerelle dans le menu Réglages');
    }
    else{
        if(number != null || number != ''){
            //Passer l'appel
            var call;
            if(codeConfidentiel == null || codeConfidentiel == ''){
                if(Ti.Platform.osname == 'iphone'){
                    call = 'tel:' + passerelle + ',' + number + '#';
                }
                else{
                    call = 'tel:' + passerelle + ',' + number + 'p';
                }
            }
            else{
                if(Ti.Platform.osname == 'iphone'){
                    call = 'tel:' + passerelle + ',' + codeConfidentiel + '#,' + number + '#';
                }
                else{
                    call = 'tel:' + passerelle + ',' + codeConfidentiel + 'p,' + number + 'e';
                }
            }
 
            Ti.Platform.openURL(call);
        }
    }
}
thanks for help.

— asked 9 months ago by Djamel ZAHAL
2 Comments
  • it doesn't make the call when i click on the button call (which call this function)

    — commented 9 months ago by Djamel ZAHAL

  • plz test to output of Ti.API.log(call);

    — commented 9 months ago by Rainer Schleevoigt

1 Answer

Hi its the issue with # symbol sometimes, mostly in earlier version of iOS. check the log and put same here so that we can look for more info.

Your Answer

Think you can help? Login to answer this question!