Results 1 to 14 of 14

Thread: How to start a phone call

  1. #1
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Question How to start a phone call

    Hi everyone!

    I just have to start a Skype call when clicking on the PushButton related to a VoIP number.
    The question is:
    How is possible to achieve this?
    Could be to post a 'callto' an idea? If yes, how could I do it? If no...well, sorry
    Any suggestion is well accepted!

    Thank you in advance to everyone will help or not!
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to start a phone call

    Maybe QDesktopServices can help you with this.
    Otherwise, maybe you can use QProcess and start/pass a parameter to Skype to start a call. If Skype doesn't allow multiple instances, then trying to open a new instance causes all the params passed to the new instance to be passed to the old instance. I guess you should document first on skype command line parameters.

    Regards

  3. #3
    Join Date
    May 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to start a phone call

    Did you check the skype SDK? Maybe there is something as easy as calling a function
    Check out their site, there must be a link there somewhere with the documentation.

  4. #4
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to start a phone call

    Thank you for answer!

    I am going to check both of your hints, anyway some people told me that all I need is to send a "callto:+390123456789" to a browser in order to obtain an internet call that automatically uses skype to call it.
    So while I check your suggestions, could you please tell me how to post this sort of messages? (I refer to the callto ,or mailto , is the same )

    Thank you so much!
    Greetings
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  5. #5
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to start a phone call

    QDesktopServices:: openUrl("callto:+390123456789");

  6. The following user says thank you to marcel for this useful post:

    Raccoon29 (14th September 2007)

  7. #6
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to start a phone call

    Thank you marcel
    Great as ever!
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  8. #7
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to start a phone call

    Ehm, sorry marcel,
    but QDesktopServices has been introduced in Qt 4.2 and I am using Qt 3 (as the thread says) ...
    so, are there other ways to achieve this callto ?
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  9. #8
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to start a phone call

    Ehm, sorry marcel,
    but QDesktopServices has been introduced in Qt 4.2 and I am using Qt 3 (as the thread says) ...
    so, are there other ways to achieve this callto ?
    Sorry about that. I always miss it.

    The correct form of the URL is : "callto://{phonenumber}", like "callto://123456789".
    When you install Skype on Windows you have the option to associate it with the "callto://" protocol.

    To make a call, just use( not tested )
    Qt Code:
    1. ShellExecute(0, 0, "callto://123456789", 0, 0, SW_SHOWNORMAL);
    To copy to clipboard, switch view to plain text mode 

  10. The following user says thank you to marcel for this useful post:

    Raccoon29 (15th September 2007)

  11. #9
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to start a phone call

    Thank you, always so kind

    I'm going to test it and report soon.
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  12. #10
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to start a phone call

    Sorry but ShellExecute results undefined...
    so where is it defined?

    Greetings

    PS: I tried to include shellapi.h ,as suggested on the microsoft msdn site, and the compiler gave me something like over 100 errors inside "shellapi.h"... so I thougth smartly to have missed something...
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  13. #11
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to start a phone call

    Have you linked with shell32.dll?
    If you're using Visual Studio you have to import shell32.lib.

    But anyway, you can post the errors you get.

  14. #12
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Red face Re: How to start a phone call

    Have you linked with shell32.dll?
    No, I have not, because I'm not able to, I never linked a dll...

    If you're using Visual Studio you have to import shell32.lib.
    I'm using compiler Microsoft Visual C++ 2005 Express

    But anyway, you can post the errors you get.
    I don't think it could help: at 100 errors compiler stopped saying they were too much, and analysing the errors given they seems to say that that "shellapi.h" is written in some language else c++, a lot of undefined symbols and messages like:
    ''default-int'' is no longer accepted in C++ or sim.

    In this post I can't, but if you want I could post the errors in the next message.

    Thank you for your time
    Greetings
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  15. #13
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to start a phone call

    Include these instead of shellapi:

    Qt Code:
    1. #include <windows.h>
    2. #include <shlobj.h>
    To copy to clipboard, switch view to plain text mode 

  16. #14
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Smile Re: How to start a phone call

    It works!

    Thank you marcel!

    Just one note for those will follow this thread: there is needed an "L" before the number to pass, that should make it compatible with the LPCWSTR Windows type.
    Code is:
    Qt Code:
    1. #include <windows.h>
    2. #include <shlobj.h>
    3.  
    4. void callVoip()
    5. {
    6. ShellExecute(0,0,L"callto://+390123456789",0,0,SW_SHOWNORMAL);
    7. }
    To copy to clipboard, switch view to plain text mode 
    this will automatically start the voip client making this call (if configured to do it).

    Thank you all again!
    Greetings
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

Similar Threads

  1. Phone call listener
    By raulftang in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 25th April 2007, 19:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.