本文整理汇总了C#中FreeSWITCH.Native.CoreSession类的典型用法代码示例。如果您正苦于以下问题:C# CoreSession类的具体用法?C# CoreSession怎么用?C# CoreSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CoreSession类属于FreeSWITCH.Native命名空间,在下文中一共展示了CoreSession类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: originate
protected int originate(CoreSession a_leg_session, string dest, int timeout, switch_state_handler_table handlers)
{
int ret = freeswitchPINVOKE.CoreSession_originate(swigCPtr, CoreSession.getCPtr(a_leg_session), dest, timeout, switch_state_handler_table.getCPtr(handlers));
return ret;
}
示例2: waitForAnswer
public void waitForAnswer(CoreSession calling_session)
{
freeswitchPINVOKE.CoreSession_waitForAnswer(swigCPtr, CoreSession.getCPtr(calling_session));
}
示例3: getCPtr
internal static HandleRef getCPtr(CoreSession obj)
{
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
示例4: Execute
public void Execute(CoreSession session, string name)
{
freeswitchPINVOKE.IvrMenu_Execute(swigCPtr, CoreSession.getCPtr(session), name);
}
示例5: bridge
public static void bridge(CoreSession session_a, CoreSession session_b)
{
freeswitchPINVOKE.bridge(CoreSession.getCPtr(session_a), CoreSession.getCPtr(session_b));
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
}
示例6: Api
public Api(CoreSession s) : this(freeswitchPINVOKE.new_Api(CoreSession.getCPtr(s)), true) {
}
示例7: OriginateHandleHangup
/// <summary>
/// Performs originate. Returns ManagedSession on success, null on failure.
/// onHangup is called as a state handler, after the channel is truly hungup (CS_REPORTING).
/// </summary>
public static ManagedSession OriginateHandleHangup(CoreSession aLegSession, string destination, TimeSpan timeout, Action<ManagedSession> onHangup) {
var bleg = new ManagedSession();
bleg.originate_ondestroy_delegate = bleg.originate_ondestroy_method;
bleg.originate_onhangup_delegate = CreateStateHandlerDelegate(sess_b => {
if (onHangup != null) {
onHangup(sess_b);
}
});
bleg.originate_table = new switch_state_handler_table();
bleg.originate_table.on_reporting = WrapStateHandlerDelegate(bleg.originate_onhangup_delegate);
bleg.originate_table.on_destroy = WrapStateHandlerDelegate(bleg.originate_ondestroy_delegate);
bleg.originate_table.flags = (int)switch_state_handler_flag_t.SSH_FLAG_STICKY;
var res = 0 == bleg.originate(aLegSession, destination, (int)timeout.TotalSeconds, bleg.originate_table);
bleg.originate_keepalive_handle = GCHandle.Alloc(bleg, GCHandleType.Normal); // Prevent GC from eating the bleg
if (res) {
bleg.Initialize();
return bleg;
} else {
// Dispose to free the lock
// The bleg lives on with its unmanaged memory freed
// Until CS_DESTROY gets called
bleg.Dispose();
return null;
}
}
示例8: Originate
public bool Originate(CoreSession aLegSession, string destination, TimeSpan timeout) {
var res = 0 == this.originate(aLegSession, destination, (int)timeout.TotalMilliseconds, null);
if (res) {
this.Initialize();
}
return res;
}