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

does support Freeswitch 1.10.6 ? #11

Closed lonelyxmas closed 2 years ago

lonelyxmas commented 2 years ago

some code like these : using (var socket = await InboundSocket.Connect("192.168.1.100", 8021, "123456789")) {

                //Tell FreeSwitch which events we are interested in
              //  await socket.SubscribeEvents(EventName.All);
                 await socket.SubscribeEvents(EventName.ChannelAnswer,EventName.ChannelCreate);
                //Handle events as they come in using Rx
                socket.ChannelEvents.Where(x => (x.EventName == EventName.ChannelAnswer
                || x.EventName == EventName.ChannelCreate
                    || x.EventName == EventName.ChannelHangup
                       || x.EventName == EventName.ChannelHangupComplete
                || EventName.ChannelOriginate == x.EventName
                || x.EventName == EventName.ChannelDestroy))
                          .Subscribe(async x =>
                      {
                          Console.WriteLine("Channel Answer Event " + x.UUID);

                          //we have a channel id, now we can control it
                          await socket.Play(x.UUID, "misc/8000/misc-freeswitch_is_state_of_the_art.wav");
                      });

                var apiResponse = await socket.SendApi("status");
                Console.WriteLine(apiResponse.BodyText);
                Console.WriteLine((await socket.SendApi("status")).BodyText);
                Console.WriteLine();
                Console.WriteLine((await socket.SendApi("invalid_api_command")).BodyText);
                Console.WriteLine();
                Console.WriteLine((await socket.SendApi("sofia status")).BodyText);
                Console.WriteLine();
                Console.WriteLine((await socket.SendApi("show bridged_calls")).BodyText);

                Console.WriteLine("Press [Enter] to exit.");
                Console.ReadLine();
            }

SendApi(...) looks ok . but xxxxx. .Subscribe(async x =>..... nothing happen at all when i use microsip for some dials . i need some help for my question . please.. .

lonelyxmas commented 2 years ago

the problem looks in Console Application . and fine in WorkerService.