linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] Cannot establish multiple sip call


From: Mostafa Farzane
Subject: Re: [Linphone-developers] Cannot establish multiple sip call
Date: Mon, 26 Jul 2021 19:42:55 +0430

Figured it out!
I need to use "core->setVideoPort(-1)" to allocate the local port randomly. Without this, Linphone always uses 9078 port number for UDP local port in the video stream.

On Mon, Jul 26, 2021 at 11:41 AM Mostafa Farzane <farzanemostafa@gmail.com> wrote:
I am using `linphone-sdk` c++. I have written a simple server that gets a SIP address and calls it. Then it starts to get images from the sip call.

My code does work fine when only calls to one SIP address. But when I call the second address, it starts showing weird behavior. Sometimes it works fine but often it does not work properly. Most of the time it freezes when it calls a second address.
here is the main part of my code:

    core = linphone::Factory::get()->createCore("", "" ,nullptr);
    core->addListener(listeners);
    core->enableDnsSrv(true);
    core->setAvpfMode(linphone::AVPFMode::Enabled);
    core->enableVideoDisplay(true);
    core->enableVideoPreview(false);
    core->enableVideoAdaptiveJittcomp(true);
    core->setMediaEncryption(linphone::MediaEncryption::None);

    core->enableConferenceServer(false);

    auto transports = core->getTransports();
    transports->setTcpPort(LC_SIP_TRANSPORT_DONTBIND);
    transports->setTlsPort(LC_SIP_TRANSPORT_DISABLED);
    transports->setDtlsPort(LC_SIP_TRANSPORT_DISABLED);
    transports->setUdpPort(LC_SIP_TRANSPORT_DISABLED);
    core->setTransports(transports);

    auto address = core->createPrimaryContactParsed();
    address->setDisplayName(<client name>);
    address->setUsername(<client name>);
    address->setDomain("127.0.0.1");
    core->setPrimaryContact(address->asString());

    core->start();

    //Setup Call
    std::shared_ptr<linphone::CallParams> call_params = core->createCallParams(nullptr);
    call_params->enableAvpf(true);
    call_params->enableAudio(false);
    call_params->setSessionName(client_email);
    call_params->setVideoDirection(linphone::MediaDirection::RecvOnly);

    call = core->inviteWithParams(uri, call_params);
    call->enableCamera(false);

    VideoStream *vstream = nullptr;
    auto call_cptr = call->cPtr();
    vstream = (VideoStream *)linphone_call_get_stream(call_cptr, LinphoneStreamTypeVideo);
    if (vstream) {
        video_stream_set_render_callback(vstream, SipClient::video_stream_render_cb, this);
    }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]