{"action":"created","issue":{"url":"https://api.github.com/repos/danbarua/NEventSocket/issues/35","repository_url":"https://api.github.com/repos/danbarua/NEventSocket","labels_url":"https://api.github.com/repos/danbarua/NEventSocket/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/danbarua/NEventSocket/issues/35/comments","events_url":"https://api.github.com/repos/danbarua/NEventSocket/issues/35/events","html_url":"https://github.com/danbarua/NEventSocket/issues/35","id":155007319,"number":35,"title":"using InBoundSocket auto outcall problem.","user":{"login":"yojinjin","id":4043717,"avatar_url":"https://avatars.githubusercontent.com/u/4043717?v=3","gravatar_id":"","url":"https://api.github.com/users/yojinjin","html_url":"https://github.com/yojinjin","followers_url":"https://api.github.com/users/yojinjin/followers","following_url":"https://api.github.com/users/yojinjin/following{/other_user}","gists_url":"https://api.github.com/users/yojinjin/gists{/gist_id}","starred_url":"https://api.github.com/users/yojinjin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yojinjin/subscriptions","organizations_url":"https://api.github.com/users/yojinjin/orgs","repos_url":"https://api.github.com/users/yojinjin/repos","events_url":"https://api.github.com/users/yojinjin/events{/privacy}","received_events_url":"https://api.github.com/users/yojinjin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-16T11:02:01Z","updated_at":"2016-05-17T02:58:17Z","closed_at":null,"body":"here is the main code.\r\n\r\n///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n'\r\n// using static socket.\r\npublic static InboundSocket socket;\r\n\r\nstatic void Main(string[] args)\r\n{\r\n\r\n\tsocket = await InboundSocket.Connect(\"127.0.0.1\", 8021, \"ClueCon\", 0);\r\n\t\r\n\t//subscribe events......\r\n\tsocket.Events.Where(x => x.EventName == EventName.ChannelAnswer).Subscribe(async y =>\r\n                {\r\n\t\t\t\t});\r\n}\r\n\r\n//in thread auto out call\r\nwhile (true)\r\n{\r\n.....\r\n\r\nInBoundAutoCall(list_ky[j], m_num.Tele, m_num.Id, op);\r\n\r\nThread.Sleep(50);\r\n.....\r\n\r\n}\r\n\r\n\r\npublic static async void InBoundAutoCall(string callerno, string tele, int pool_id, OriginateOptions op)\r\n{\r\n\ttry\r\n\t{\r\n\t\top.CallerIdNumber =  callerno;\r\n\t\top.CallerIdName = callerno;\r\n\t\top.HangupAfterBridge = true;\r\n\t\top.TimeoutSeconds = 20;\r\n\t\top.ReturnRingReady = true;\r\n\t\top.ChannelVariables.Add(\"callerno\", callerno);\r\n\t\top.ChannelVariables.Add(\"calledno\", tele);\r\n\r\n\r\n\t\tvar result = await socket.Originate(\"sofia/gateway/\" + callerno + \"/\" + tele, op);\r\n\t\tif (result.Success)\r\n\t\t{\r\n\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}\r\n\tcatch (Exception ex)\r\n\t{\r\n\t\r\n\t}\r\n}`\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\nWhen the number of concurrent calls, at around 100, there will be a socket problem. Originate returns false. Then I look at the number of freeswitch channels, but the number of channels has been 0. After we close the program, reopen the socket connection, socket can work for a while, but once the amount reached 100 or so, it will appear the above situation.Is something error with us?\r\n\r\nregards."},"comment":{"url":"https://api.github.com/repos/danbarua/NEventSocket/issues/comments/219607271","html_url":"https://github.com/danbarua/NEventSocket/issues/35#issuecomment-219607271","issue_url":"https://api.github.com/repos/danbarua/NEventSocket/issues/35","id":219607271,"user":{"login":"yojinjin","id":4043717,"avatar_url":"https://avatars.githubusercontent.com/u/4043717?v=3","gravatar_id":"","url":"https://api.github.com/users/yojinjin","html_url":"https://github.com/yojinjin","followers_url":"https://api.github.com/users/yojinjin/followers","following_url":"https://api.github.com/users/yojinjin/following{/other_user}","gists_url":"https://api.github.com/users/yojinjin/gists{/gist_id}","starred_url":"https://api.github.com/users/yojinjin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yojinjin/subscriptions","organizations_url":"https://api.github.com/users/yojinjin/orgs","repos_url":"https://api.github.com/users/yojinjin/repos","events_url":"https://api.github.com/users/yojinjin/events{/privacy}","received_events_url":"https://api.github.com/users/yojinjin/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T02:58:17Z","updated_at":"2016-05-17T02:58:17Z","body":"![calls count 0 not work](https://cloud.githubusercontent.com/assets/4043717/15309942/fd0c9134-1c1d-11e6-8d08-059fe0981602.jpg)\r\n[calls count 0 not work.txt](https://github.com/danbarua/NEventSocket/files/267343/calls.count.0.not.work.txt)\r\n![calls count about 600 work fine](https://cloud.githubusercontent.com/assets/4043717/15309943/fd639f9c-1c1d-11e6-9da8-724e91de3673.png)\r\n[calls count about 600 work fine.txt](https://github.com/danbarua/NEventSocket/files/267344/calls.count.about.600.work.fine.txt)\r\n\r\n\r\ncalls count 0 not work  using Originate method.\r\ncalls count about 600  using SendCommand like this.\r\n\r\nvar originateString = string.Format(\"{0}{1} {2}\", op, \"sofia/gateway/88165450/15311111111\", \"'&park()'\");\r\n\r\n                Guid jobUUID = Guid.NewGuid();\r\n\r\n                var backgroundApiCommand = originateString != null\r\n                                               ? \"bgapi {0} {1}\\nJob-UUID: {2}\".Fmt(\"originate\", originateString, jobUUID)\r\n                                               : \"bgapi {0}\\nJob-UUID: {1}\".Fmt(\"originate\", jobUUID);\r\n\r\n                await socket.SendCommand(backgroundApiCommand);"}}