iamkinetic / NEventSocket

A reactive FreeSwitch eventsocket library for .Net/.Net Framework (.net standard 2)
Mozilla Public License 2.0
26 stars 11 forks source link

ChannelData.UUID from InboundSocket.Originate returns null #12

Open DanieleGhianda opened 2 years ago

DanieleGhianda commented 2 years ago

I was following the Demo https://github.com/iamkinetic/NEventSocket/blob/master/NEventSocket.Examples/Examples/DtmfExample.cs But the program crashes since ChannelData.UUID is null. I am using Freeswitch 1.10.6, with default configuration For the softphones I used MicroSip and PhonerLite the OS is Windows10

To Reproduce Steps to reproduce the behavior:

  1. Download Freeswitch,softphones and setup visual studio
  2. Create new solution/project (and install NEventSocket using NuGet)
  3. In Program.cs put this code: `using Microsoft.Extensions.Logging; using NEventSocket; using NEventSocket.FreeSwitch; using System; using System.Collections.Generic; using System.Reactive.Linq; using System.Threading.Tasks;

namespace Test_FSw { class Program { static async Task Main(string[] args) { NEventSocket.Logging.Logger.Configure(new LoggerFactory()); InboundSocket client; client = await InboundSocket.Connect("localhost", 8021, "ClueCon", TimeSpan.FromSeconds(20));

        var originate = await client.Originate("user/1001", new OriginateOptions
        {
            CallerIdNumber = "123456789",
            CallerIdName = "test2",
            HangupAfterBridge = false,
            TimeoutSeconds = 20
        });

        if (!originate.Success)
        {
            Console.WriteLine("Failed");
            Console.WriteLine(originate.HangupCause.ToString());
            await client.Exit();
        }
        else
        {
            Console.WriteLine(originate.ChannelData.UUID);/*UUID or ChannelData is null*/
            var uuid = originate.ChannelData.UUID;
            /*unreached code*/
            await client.SubscribeEvents(EventName.Dtmf);
        }
        Console.WriteLine("Exit[Enter]");
        Console.ReadLine();

    }

}

}

`

  1. Execute
jes1pan commented 1 year ago

The problem has not been solved yet,You don't have this problem with the framework version。