ladendirekt / pjsip4net

A wrapper library exposing the pjsip library to the .NET world in a OO-friendly way.
71 stars 42 forks source link

Incomming call problem with HangUp #86

Closed bkraut closed 6 years ago

bkraut commented 6 years ago

Hi,

I'm having problems with Incomming call termination. When I click on HangUp, the call finishes, but I don't get Disconnected state, but the call is still active.

If I call again, I am put in a queue.

I'm using 0.2.0.28 version of pjsip4net.

What could be the problem?

Here is my code:


private void IncommingCall_HangUp(object sender, RoutedEventArgs e)
        {
            try
            {
                ICall call = this.vm.call;
                if (call.IsActive) { 
                    this.vm.call.Hangup();
                    btnAnswer.Visibility = Visibility.Visible;
                    btnHangUp.Visibility = Visibility.Hidden;
                }
            }
            catch (Exception ex)
            {
                log.Debug(ex);
                while (ex.InnerException != null) ex = ex.InnerException;
                MessageBox.Show(ex.Message);
            }
        }

private void CallManager_CallStateChanged(object sender, CallStateChangedEventArgs e)
        {
            using (var context = new CCContext())
            {
                try
                {
                    console(
                        "Št: {0} Status: {1} [Trajanje: {2}]",
                        this.vm.CallingNumber,
                        e.InviteState,
                        e.Duration
                    );
                    if (e.InviteState == pjsip4net.Core.Data.InviteState.Disconnected)
                    {
                        this.Dispatcher.BeginInvoke(new Action(() =>
                        {
                            btnAnswer.Visibility = Visibility.Visible;
                            btnHangUp.Visibility = Visibility.Hidden;
                        }));
                    }
                    else if (e.InviteState == pjsip4net.Core.Data.InviteState.Calling)
                    {
                        this.Dispatcher.BeginInvoke(new Action(() =>
                        {
                            btnAnswer.Visibility = Visibility.Hidden;
                            btnHangUp.Visibility = Visibility.Visible;
                        }));
                    }
                }
                catch (Exception ex)
                {
                    log.Debug(ex);
                    while (ex.InnerException != null) ex = ex.InnerException;
                    MessageBox.Show(ex.Message);
                }
            }
        }
`
Best,
 Bojan
siniypin commented 6 years ago

Kindly capture your SIP trace and post it here. You can find an example of configuration with SIP tracing enabled here: https://gist.github.com/siniypin/7860029#file-app-config-L6

siniypin commented 6 years ago

Having seen no sip traces I cannot help you with this.

bkraut commented 6 years ago

How can I get sip traces? When I run the app, an error occurs before the output is displayed to the log text field. Best, Bojan Sent from my Samsung Galaxy smartphone. -------- Original message --------From: Robert notifications@github.com Date: 14/04/2018 09:42 (GMT+01:00) To: siniypin/pjsip4net pjsip4net@noreply.github.com Cc: bkraut bojan.kraut@alcyone.si, Author author@noreply.github.com Subject: Re: [siniypin/pjsip4net] Incomming call problem with HangUp (#86) Having seen no sip traces I cannot help you with this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/siniypin/pjsip4net","title":"siniypin/pjsip4net","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/siniypin/pjsip4net"}},"updates":{"snippets":[{"icon":"PERSON","message":"@siniypin in #86: Having seen no sip traces I cannot help you with this."}],"action":{"name":"View Issue","url":"https://github.com/siniypin/pjsip4net/issues/86#issuecomment-381310941"}}}

siniypin commented 6 years ago

The startup error occurs with new version. Try running the old one.

siniypin commented 6 years ago

Hey, kindly check out this comment https://github.com/siniypin/pjsip4net/issues/88#issuecomment-397840338. It might solve your problem.