Check for callto: protocol support using javascript

Discussion in 'Javascript' started by Alexander, Jan 10, 2006.

  1. Alexander

    Alexander Guest

    Hi,

    I am developing a web-application which will start telephone-calls using a
    special protocol (callto: or phone:)

    There will be two groups of users, one with a phone-client installed and
    support for the protocol,
    and one without this client.

    So I need to write a javascript-function to check if the callto: or phoneto:
    protocol is available on the client.

    ANY IDEAS???

    If I just add the link for every user, the ones with no client will run into
    an error message on every click:
    "Protocol not supported" in firefox
    "Page cannot be displayed" in IE

    Regards Alexander
     
    Alexander, Jan 10, 2006
    #1
    1. Advertising

  2. Alexander

    Jonas Raoni Guest

    Alexander escreveu:
    > So I need to write a javascript-function to check if the callto: or phoneto:
    > protocol is available on the client.
    > ANY IDEAS???


    Call both url's with an image haha, I'm not sure if it will work anyway
    :)

    Like:
    (new Image).src = "callto:lala";

    > If I just add the link for every user, the ones with no client will run into
    > an error message on every click:
    > "Protocol not supported" in firefox
    > "Page cannot be displayed" in IE


    So, don't use it... It's not a standard and I don't know anything like
    "hasProtocol" =/


    --
    Jonas Raoni Soares Silva
    http://www.jsfromhell.com
     
    Jonas Raoni, Jan 10, 2006
    #2
    1. Advertising

  3. Alexander

    VK Guest

    Alexander wrote:
    > Hi,
    >
    > I am developing a web-application which will start telephone-calls using a
    > special protocol (callto: or phone:)
    >
    > There will be two groups of users, one with a phone-client installed and
    > support for the protocol,
    > and one without this client.
    >
    > So I need to write a javascript-function to check if the callto: or phoneto:
    > protocol is available on the client.
    >
    > ANY IDEAS???


    Are you going to make voice calls over HTTP protocol? If not then you
    have to set new MIME type for the browser - then just check for
    registered mime types.
     
    VK, Jan 10, 2006
    #3
  4. VK wrote:

    > Alexander wrote:
    >> I am developing a web-application which will start telephone-calls using
    >> a special protocol (callto: or phone:)
    >>
    >> There will be two groups of users, one with a phone-client installed and
    >> support for the protocol,
    >> and one without this client.
    >>
    >> So I need to write a javascript-function to check if the callto: or
    >> phoneto: protocol is available on the client.
    >>
    >> ANY IDEAS???

    >
    > Are you going to make voice calls over HTTP protocol? If not then you
    > have to set new MIME type for the browser - then just check for
    > registered mime types.


    Does it not hurt you when you post such ridiculous utter nonsense? If not,
    it should. Hopefully, that will eventually provide you an incentive to
    stop doing that. Here is a hint for you: if you did not understand a thing
    that was talked about and/or you do not have any clue, just *DO* *NOT*
    *POST*!


    PointedEars
     
    Thomas 'PointedEars' Lahn, Jan 10, 2006
    #4
  5. Alexander wrote:

    > I am developing a web-application which will start telephone-calls using
    > a special protocol (callto: or phone:)


    Which is not registered at IANA and therefore unwise to use.
    tel:, as specified by RFC2806, is registered as URI scheme for
    telephone calls.

    <URL:http://www.iana.org/assignments/uri-schemes>

    > There will be two groups of users, one with a phone-client installed and
    > support for the protocol, and one without this client.
    >
    > So I need to write a javascript-function to check if the callto: or
    > phoneto: protocol is available on the client.


    And then do what? Tell the user that their configuration is not sufficient?
    I bet they already know by then.

    > [...]
    > If I just add the link for every user, the ones with no client will run
    > into an error message on every click:
    > "Protocol not supported" in firefox
    > "Page cannot be displayed" in IE


    And why is that not sufficient? If the link does not work and results in
    displaying an error document, users will use their UAs Back feature. You
    should provide additional information next to the link or in the
    documentation of your application (maybe even before you can start using
    it) what the requirements for its use or the use of its features are, what
    the error message would mean and what to do when users encounter this
    problem.

    You cannot test with unprivileged client-side scripting whether a UA has a
    working protocol handler configured for a protocol, and with privileged
    script this probably is not cross-browser compatible (you will have to
    access the UAs preferences directly for which there is no unified
    interface). Due to the Same Origin Policy and URIs not necessarily meaning
    resource retrieval -- especially it does not seem so in your case --, there
    is no use in trying host objects like Image or XMLHttpRequest as the result
    are but false positives regarding missing support.

    So ISTM that what you want is simply not possible and you will either have
    to rely on UA's behavior and your documentation to provide sufficient
    information to the user or provide a user agent along with your "Web
    application" that can handle this type of URIs.


    PointedEars
     
    Thomas 'PointedEars' Lahn, Jan 10, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    448
    Victor Bazarov
    Jan 16, 2008
  2. Nicolas Desprès

    robots.txt protocol support for Ruby

    Nicolas Desprès, Oct 13, 2006, in forum: Ruby
    Replies:
    0
    Views:
    126
    Nicolas Desprès
    Oct 13, 2006
  3. Suresh
    Replies:
    2
    Views:
    416
    Suresh
    Apr 22, 2004
  4. Nikos
    Replies:
    4
    Views:
    184
    Fabian Pilkowski
    Apr 28, 2005
  5. Nikos
    Replies:
    3
    Views:
    102
    Sisyphus
    Apr 29, 2005
Loading...

Share This Page