QT for Symbian, PJSIP - How to assign connection to pj_symbianos_params ->rconnection & rsocketserv

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

 



Hi,
I am testing QT for Symbian with very basic PJSIP dialing. I realize by
going through symbian_ua sample, that
struct pj_symbianos_params's rconnection & rsocketserv fields needs to be
filled with Symbian RConnection and RSocketServ respectively or otherwise
these will be created in pj_init(). So, I am not assigning anything to these
as these RConnection and RSocketServ are not available in QT. So, pj_init()
is called with setting these parameters but application crashes. So, I
figured that this is the only thing that I am not setting in code. Although,
the same code is running fine on Windows and Mac versions. What should be
assigned to these parameters in QT? I also tried using Q_OS_SYMBIAN macro
and copy/pasted the relavent symbian_ua sample code which allow connection
selection and then sets up pj_symbianos_params before calling pj_init(), but
then app crashes on startup on E71 saying, "Error, Unable to execute file
for Security Reason". Below is the relavent code, though ideally it should
not be used and there should be some other simple way of assigning the
socket and connection to the struct. I need to help in getting it runnable
via either way. Tine from this URL
http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2010-November/012104.htmlseems
to have it working, if someone can help me fix it, it will be realy
helpful!

#ifdef Q_OS_SYMBIAN

 #include <apdatahandler.h>

 inline void ForceUseFirstIAP()

{

    TUint32 rank = 1;

    TUint32 bearers;

    TUint32 prompt;

    TUint32 iap;

     CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);

    CleanupStack::PushL(commDb);

     CApDataHandler* apDataHandler = CApDataHandler::NewLC(*commDb);

     TCommDbConnectionDirection direction = ECommDbConnectionDirectionOutgoing;

    apDataHandler->GetPreferredIfDbIapTypeL(rank, direction, bearers,
prompt, iap);

    prompt = ECommDbDialogPrefDoNotPrompt;

    apDataHandler->SetPreferredIfDbIapTypeL(rank, direction, bearers,
(TCommDbDialogPref)prompt, iap, ETrue);

    CleanupStack::PopAndDestroy(2); // apDataHandler, commDb

}

#endif

#if defined(Q_OS_SYMBIAN)

    RSocketServ aSocketServer;

       RConnection aConn;

       TInt err1;

       pj_symbianos_params sym_params;

        ForceUseFirstIAP();

        // Initialize RSocketServ

           if ((err1=aSocketServer.Connect(32)) != KErrNone)

               return PJ_STATUS_FROM_OS(err1);

            // Open up a connection

           if ((err1=aConn.Open(aSocketServer)) != KErrNone) {

               aSocketServer.Close();

               return PJ_STATUS_FROM_OS(err1);

           }

            if ((err1=aConn.Start()) != KErrNone) {

               aSocketServer.Close();

               return PJ_STATUS_FROM_OS(err1);

           }

        pj_bzero(&sym_params, sizeof(sym_params));

           sym_params.rsocketserv = &aSocketServer;

           sym_params.rconnection = &aConn;

           pj_symbianos_set_params(&sym_params);

 #endif

     status = pjsua_create();

    if (status != PJ_SUCCESS) {

        error("Error in pjsua_create()", status);

        pjsua_destroy();

        return -1;

    }



Regards,
Ibrahim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110217/2ff82f4f/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux