void bwRegisterSIPUser_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { try { TimeCounterCollection = new Hashtable(); for (int i = 0; i < 6; i++) { TimeCounterCollection.Add(i, "0:00:00"); } VMuktiService.BasicHttpClient bhcSuperNode = new VMuktiService.BasicHttpClient(); SNChannel = (IService)bhcSuperNode.OpenClient<IService>("http://" + VMuktiAPI.VMuktiInfo.CurrentPeer.SuperNodeIP + ":80/SNService"); //**creating Supernode channel for SIP Numbers and SIP Conferencees string strSIPServerIP = VMuktiInfo.CurrentPeer.SuperNodeIP; string strSIPNumber = SNChannel.svcAddSIPUser(); strSoftPhoneSIPNumber = strSIPNumber; strSoftPhoneSIPPassword = strSIPNumber; strSoftPhoneSIPServer = strSIPServerIP; } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncRegister()", "Audio\\ctlDialer.xaml.cs"); } }
void FncOpenClinet(object lstParameters) { try { System.Collections.Generic.List<object> lstTempObj = (System.Collections.Generic.List<object>)lstParameters; strUri = lstTempObj[1].ToString(); if ((VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.NodeWithNetP2P || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.SuperNode) { VMuktiService.NetPeerClient ncpAudio = new VMuktiService.NetPeerClient(); ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PJoin += new Audio.Business.Service.NetP2P.clsNetTcpAudio.DelsvcP2PJoin(ctlDialer_EntsvcP2PJoin); ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PStartConference += new Audio.Business.Service.NetP2P.clsNetTcpAudio.DelsvcP2PStartConference(ctlDialer_EntsvcP2PStartConference); ((clsNetTcpAudio)objNetTcpAudio).EntsvcGetUserList += new clsNetTcpAudio.DelsvcGetUserList(ctlDialer_EntsvcGetUserList); ((clsNetTcpAudio)objNetTcpAudio).EntsvcSetUserList += new clsNetTcpAudio.DelsvcSetUserList(ctlDialer_EntsvcSetUserList); ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PUnJoin += new Audio.Business.Service.NetP2P.clsNetTcpAudio.DelsvcP2PUnJoin(ctlDialer_EntsvcP2PUnJoin); NetP2PChannel = (INetTcpAudioChannel)ncpAudio.OpenClient<INetTcpAudioChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpAudio); while (temp < 20) { try { ClsException.WriteToLogFile("Going to call svcJoin"); NetP2PChannel.svcP2PJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName); ClsException.WriteToLogFile("svcJoin has been called."); temp = 20; this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, objDelStartIntitialConfrence); if (strMyRole == "Host") { NetP2PChannel.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, strDefaultConfNumber); } else { NetP2PChannel.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, ""); } } catch { temp++; System.Threading.Thread.Sleep(1000); } } } else { VMuktiService.BasicHttpClient bhcAudio = new VMuktiService.BasicHttpClient(); Httpchannel = (IHttpAudio)bhcAudio.OpenClient<IHttpAudio>(strUri); while (tempcounter < 20) { try { Httpchannel.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName); tempcounter = 20; this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, objDelStartIntitialConfrence); if (strMyRole == "Host") { Httpchannel.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, strDefaultConfNumber); } else { Httpchannel.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, ""); } } catch { tempcounter++; System.Threading.Thread.Sleep(1000); } } dtGetConference.Interval = TimeSpan.FromSeconds(2); dtGetConference.Tick += new EventHandler(dtGetConference_Tick); dtGetConference.Start(); } ClsException.WriteToLogFile("Opening client Completed successfully"); } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncOpenClient()", "Audio\\ctlDialer.xaml.cs"); } }