How to connect Risip in Qt



  • Hi!
    Good afternoon. Found the Risip library - this, as I understand it, PJSIP collected for Qt. Please tell me how to connect Risip to the project? On the issue tracker, write "How to start using Radio in my project? Using Sip in your Qt / QML project is very easy and straightforward. Make sure you have Qt installed and running properly. Create your project with Qt Creator Inside your project folder, clone the ri sipvoipsdk repo. Edit the .profile of your project and add the following this line include(ri sipvoipsdk/ri sipvoipsdk.pri) on top."

    I created a project, named the folder with Risip rusip and placed it in the folder with the project. The project included r i sipvoipsdk.pri, but it didn't help. Here is my pro file:

    include(risip/risip-voipsdk.pri)
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = voipPjsipTest
    TEMPLATE = app
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which has been marked as deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    CONFIG += c++11
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp
    
    HEADERS += \
            mainwindow.h
    
    FORMS += \
            mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    

  • Moderators

    @Mikeeeeee said in How to connect Risip in Qt:

    The project included r i sipvoipsdk.pri, but it didn't help.

    Any warnings or error messages from qmake? Or during compilation?



  • Can't find file pjsua2.hp. There are 4 such files in the library.


  • Moderators

    Looks like their bug, then - get in touch with the author or try to fix yourself. Repo has no stable branch, no stable tags, so there is no safe commit to try out.



  • The author was asked this question, but he did not answer.


  • Lifetime Qt Champion

    Hi,

    Did you saw that there's a Qt app already available from the same folks ?



  • I saw. It doesn't compile either. Seems to be the case in Windows.


  • Lifetime Qt Champion

    So the backend hasn't been implemented on Windows ?


  • Lifetime Qt Champion

    Hi
    well there seems not to have that missing file for windows anyway

    alt text

    However, PJSIP itself (the backbone) have download for windows but the Risip (the Qt wrapper+)
    seems to have very little under the platforms/win folder and generally the docs
    do not mention Win platform at all.



  • Tried on MacOS, too didn't work.
    There is an archive class QTelephonyService .
    Is there a working analogue?


  • Lifetime Qt Champion

    @Mikeeeeee
    Hi
    as far as i know, nothing replaced QTelephonyService .

    https://www.pjsip.org/ is available for windows but only builds with visual studio as
    as a dynamic library (it seems) and must be from the visual studio IDE and not Creator.



  • Is it possible to use QTelephonyService somehow?
    I don't know how to work in Visual Studio. Can this library be connected to Qt?


  • Lifetime Qt Champion

    Hi
    QTelephonyService is very old and unmaintained, so im not sure it still works.
    Yes, any c++ library can be used with Qt, including PJSIP.



  • Here man already faced with this and decided to. I have a library in the project folder in the pjsip folder . Please tell me how to adapt this code.

    TEMPLATE = app
    QT += qml quick
    QMAKE_CXXFLAGS += -std=c++11 -lstdc++ -m32 -O2 -fPIC -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1
    CONFIG += c++11 -m32
    SOURCES += main.cpp \
        message.cpp
    RESOURCES += qml.qrc
    include(deployment.pri)
    HEADERS += \
        message.h
    DEFINES -= UNICODE
    PKGCONFIG =
    LIBS += -L$$PWD/../../../pjproject-2.5/pj/pjproject-2.5/pjsip/lib/ \
    -lpjsua2-i686-pc-mingw32 \
    -lstdc++ \
    -lpjsua-i686-pc-mingw32 \
    -lpjsip-ua-i686-pc-mingw32 \
    -lpjsip-simple-i686-pc-mingw32 \
    -lpjsip-i686-pc-mingw32 \
    -lpjmedia-codec-i686-pc-mingw32 \
    -lpjmedia-i686-pc-mingw32 \
    -lpjmedia-videodev-i686-pc-mingw32 \
    -lpjmedia-audiodev-i686-pc-mingw32 \
    -lpjmedia-i686-pc-mingw32 \
    -lpjnath-i686-pc-mingw32 \
    -lpjlib-util-i686-pc-mingw32 \
    -lsrtp-i686-pc-mingw32 \
    -lresample-i686-pc-mingw32 \
    -lgsmcodec-i686-pc-mingw32 \
    -lspeex-i686-pc-mingw32 \
    -lilbccodec-i686-pc-mingw32 \
    -lg7221codec-i686-pc-mingw32 \
    -lpj-i686-pc-mingw32 \
    -lm \
    -lwinmm \
    -lole32 \
    -lws2_32 \
    -lwsock32
    
    INCLUDEPATH += $$PWD/../../../pjproject-2.5/pj/pjproject-2.5/pjsip/include \
    $$PWD/../../../pjproject-2.5/pj/pjproject-2.5/pjlib/include \
    $$PWD/../../../pjproject-2.5/pj/pjproject-2.5/pjlib-util/include \
    $$PWD/../../../pjproject-2.5/pj/pjproject-2.5/pjmedia/include \
    $$PWD/../../../pjproject-2.5/pj/pjproject-2.5/pjnath/include 
    
    DEPENDPATH += $$PWD/../../../pjproject-2.5/pj/pjproject-2.5/pjsip/include
    
    

  • Lifetime Qt Champion

    Hi
    As minumum, you must make sure path is correct.
    LIBS += -L$$PWD/../../../pjproject-2.5/pj/pjproject-2.5/pjsip/lib/
    should be set to how you extract and build the library..

    He build it with mingw so that seems possible also, besides visual studio.



  • I have a library in the project folder in the pjsip folder .
    How do I change the folder path correctly?
    Or how to do it with mingw ?


  • Lifetime Qt Champion

    @Mikeeeeee
    I dont know your structure so its hard to say.
    You have to change this path to point to where you have all the files
    from the build. ( like pjsip-ua-i686-pc etc )
    LIBS += -L$$PWD/../../../pjproject-2.5/pj/pjproject-2.5/pjsip/lib/



  • Strange, but all of the lib folder I have is empty. Do I need another version of PJSIP?




  • Lifetime Qt Champion

    @Mikeeeeee
    Those are clients so they should just run.
    It is for the Asterisk IP PBX system/server so you need such installation to talk to.



  • But none of these projects are compiled. You don't know how to fix it?


  • Lifetime Qt Champion

    @Mikeeeeee
    hi
    Nope. You are not showing any error so its impossible to guess at.



  • Qt-Asterisk-Desktop-master generates an error when compiling: :No rule to make target 'phonon/seekslider.h', needed by 'tmp/ui/ui_admvoicemailwidget.h'. Stop.
    Asterisk Manager-master generates an error when compiling:
    error: Owner/Downloads/AsteriskManager-master/test/": No such file or directory
    error: Owner/Downloads/AsteriskManager-master/test/": No such file or directory


  • Lifetime Qt Champion

    @Mikeeeeee
    Sorry. i dont know.
    i download the zip file and it just compiled. no errros.
    With visual studio compiler.
    What are you using ?



  • MinGW 32
    MSVC 2019 32 and 64 bit also give an error



  • Do you know why the same compiler might not compile the project?
    Maybe You know how to connect this:
    https://github.com/qTox/qTox
    [https://github.com/tychosoft/sipwitchqt](link url)


  • Qt Champions 2018

    @Mikeeeeee said in How to connect Risip in Qt:

    Do you know why the same compiler might not compile the project?

    No, you forgot to mention what problems you face when building...



  • Maybe it's the debugger, I only have these:!
    0_1560427300816_1.png
    error js AsteriskManager-master:: No rule to make target 'C:/Users/New Owner/Downloads/AsteriskManager-master/build-test-Desktop_Qt_5_12_3_MinGW_64_bit-Debug/../src/debug/libasteriskmanager.a', needed by 'debug/tst_loginactiontest.exe'. Stop.
    error of Qt-Asterisk-Desktop-master: dependent 'phonon\seekslider.h' does not exist.
    error qt-asterisk-code-r100 : Unknown module(s) in QT: webkit
    errors of metasec: C:\Users\New Owner\Downloads\MetaVoIP1\pjproject-2.4\pjlib\include\pj\config.h:278: error: C1189: #error: "Please specify target machine."
    C:\Users\New Owner\Downloads\MetaVoIP1\pjproject-2.4\pjlib\include\pj\config.h:278: error: C1189: #error: "Please specify target machine."
    C:\Users\New Owner\Downloads\MetaVoIP1\pjproject-2.4\pjlib\include\pj\config.h:278: error: C1189: #error: "Please specify target machine."
    C:\Users\New Owner\Downloads\MetaVoIP1\pjproject-2.4\pjlib\include\pj\config.h:278: error: C1189: #error: "Please specify target machine."
    C:\Users\New Owner\Downloads\MetaVoIP1\pjproject-2.4\pjlib\include\pj\config.h:278: error: C1189: #error: "Please specify target machine."


  • Qt Champions 2018

    @Mikeeeeee Selecting GDB when using Microsoft compiler is not going to work.
    You need to install "Debugging Tools for Windows" as described here: https://doc.qt.io/qtcreator/creator-debugger-engines.html



  • But i have SDK for Windows 10 (10.0.18362.0) from MSVC2019 and I instal this https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
    Qt does not automatically detect the debugger. How do I add a new debugger?


  • Moderators



  • There is no cdb file on my computer.exe. What do I need to download?



  • Here . say that this component is available when you install Visual Studio.
    I have SDK for Windows 10 (10.0.18362.0) .
    But I haven't installed the profiling Tools .NET. It is necessary for the debugger or not? And you need to set the debugger for Qt?


  • Moderators

    @Mikeeeeee said in How to connect Risip in Qt:

    Here . say that this component is available when you install Visual Studio.

    No, CDB is not available in the Visual Studio installer.

    You must install CDB separately: https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/



  • I configured the debugging, but still get the old error.
    0_1560493540752_1.png


  • Qt Champions 2018

    @Mikeeeeee That error is unrelated to the debugger.
    Delete the build directory, run qmake and build again.



  • I have tried to do so, the error remained.


  • Qt Champions 2018

    @Mikeeeeee Please post your pro file



  • AsteriskManager:

    TEMPLATE = subdirs
    
    SUBDIRS += \
        src \
        test
    
    
    QT       += network
    
    QT       -= gui
    
    TARGET = asteriskmanager
    TEMPLATE = lib
    CONFIG += staticlib c++11
    
    SOURCES += asteriskmanager.cpp \
        packet.cpp \
        action.cpp \
        loginaction.cpp \
        logoffaction.cpp \
        tcppackettransport.cpp
    
    HEADERS += asteriskmanager.h \
        packettransport.h \
        packet.h \
        action.h \
        loginaction.h \
        logoffaction.h \
        tcppackettransport.h
    unix {
        target.path = /usr/lib
        INSTALLS += target
    }
    
    
    QT       += testlib
    
    QT       -= gui
    
    TARGET = tst_loginactiontest
    CONFIG   += console c++11
    CONFIG   -= app_bundle
    
    TEMPLATE = app
    
    
    SOURCES += \
        main.cpp \
        loginactiontest.cpp \
        logoffactiontest.cpp \
        packettransportmock.cpp
    DEFINES += SRCDIR=\\\"$$PWD/\\\"
    
    HEADERS += \
        loginactiontest.h \
        logoffactiontest.h \
        packettransportmock.h
    
    win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../src/release/ -lasteriskmanager
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../src/debug/ -lasteriskmanager
    else:unix: LIBS += -L$$OUT_PWD/../src/ -lasteriskmanager
    
    INCLUDEPATH += $$PWD/../src
    DEPENDPATH += $$PWD/../src
    
    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../src/release/libasteriskmanager.a
    else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../src/debug/libasteriskmanager.a
    else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../src/release/asteriskmanager.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../src/debug/asteriskmanager.lib
    else:unix: PRE_TARGETDEPS += $$OUT_PWD/../src/libasteriskmanager.a
    
    

  • Moderators

    @Mikeeeeee said in How to connect Risip in Qt:

    Maybe it's the debugger

    Actually, none of the errors you listed are caused by the debugger.

    error of Qt-Asterisk-Desktop-master: dependent 'phonon\seekslider.h' does not exist.

    This error tells you that the project is looking for a header file called seekslider.h, but it cannot find the header.

    error qt-asterisk-code-r100 : Unknown module(s) in QT: webkit

    This error tells you that Qt WebKit is not installed.

    The Qt WebKit module was deprecated and removed from Qt 5.6.

    You have 2 options:

    errors of metasec: C:\Users\New Owner\Downloads\MetaVoIP1\pjproject-2.4\pjlib\include\pj\config.h:278: error: C1189: #error: "Please specify target machine."

    config.h requires you to #define a macro so that #ifdef logic will not lead to an #error.

    Read config.h, especially the lines above line #278 to figure out what you need to do.

    error js AsteriskManager-master:: No rule to make target 'C:/Users/New Owner/Downloads/AsteriskManager-master/build-test-Desktop_Qt_5_12_3_MinGW_64_bit-Debug/../src/debug/libasteriskmanager.a', needed by 'debug/tst_loginactiontest.exe'. Stop.

    I'm not sure about this error. Fix the others first, then come back to this one.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.