This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ChatControl | |
{ | |
private void client_LoginStateChanged(object sender, EventArgs e) | |
{ | |
if (client.LoginState == LoginStateEnum.Logon) | |
client.Messanger.IncomingMessage += Messanger_IncomingMessage; | |
if ((client.LoginState == LoginStateEnum.Logoff || client.LoginState == LoginStateEnum.LoginError) | |
&& client.Messanger != null) | |
client.Messanger.IncomingMessage -= Messanger_IncomingMessage; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void ua_Log(object sender, LogEventArgs e) | |
{ | |
if (e.Data.Contains("TCP transport destroyed with reason 70016: End of file (PJ_EEOF)")) | |
{ | |
System.Console.WriteLine("SNAP, SERVER WENT DOWN"); | |
ua.AccountManager.Accounts.All(x => x.Unregister()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Main(string[] args) | |
{ | |
//Initialization skipped | |
ua.CallManager.IncomingCall += CallManager_IncomingCall; | |
ua.CallManager.Ring += CallManager_Ring; | |
//Loop is skipped | |
static void CallManager_Ring(object sender, RingEventArgs e) | |
{ | |
System.Console.WriteLine("Call {0} ring event.", e.CallId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlayFileCommand : ICommand | |
{ | |
private readonly ISipUserAgent _userAgent; | |
private readonly IContainer _container; | |
public PlayFileCommand(ISipUserAgent userAgent, IContainer container) | |
{ | |
_userAgent = userAgent; | |
_container = container; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlayFileCommand : ICommand | |
{ | |
private readonly ISipUserAgent _userAgent; | |
private readonly IContainer _container; | |
public PlayFileCommand(ISipUserAgent userAgent, IContainer container) | |
{ | |
_userAgent = userAgent; | |
_container = container; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var container = new WindsorContainer(); | |
var ua = Configure.Pjsip4Net().With_CastleContainer(container).Build().Start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configure.Pjsip4Net() | |
.With(x => x.Config.AutoAnswer = false) | |
.With(x => x.Config.OutboundProxies.Add("sip:192.168.1.1:5060")) | |
.Build() | |
.Start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configure.Pjsip4Net().WithVersion_1_4().Build().Start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<configSections> | |
<section name="sipua" type="pjsip4net.Configuration.SipUserAgentSettingsSection, pjsip4net, Culture=neutral, PublicKeyToken=null"/> | |
<sectionGroup name="common"> | |
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> | |
</sectionGroup> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821"/> | |
</configSections> | |
<sipua> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<configSections> | |
<section name="sipua" type="pjsip4net.Configuration.SipUserAgentSettingsSection, pjsip4net, Culture=neutral, PublicKeyToken=null"/> | |
</configSections> | |
<sipua srtp="Disabled" secureSignaling="0" logMessages="true" logLevel="5" traceAndDebug="false" autoAnswer="true" autoConference="false" maxCalls="5"> | |
<accounts> | |
<!--<account accountId="sip:1000@66.240.xxx.xx:5080" registrarUri="sip:66.240.170.79:5080" | |
userName="1000" password="1234" realm="*" isDefault="true" | |
publishPresence="false" />--> |
NewerOlder