mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-21 18:54:14 +00:00
Start adding some strongly-typed accessors to common channel vars
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14774 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
2a3be1dc98
commit
f22a237b44
3 files changed
+237
-7
No files matched your search
@@ -52,6 +52,9 @@ namespace FreeSWITCH.Native
|
||||
/// <summary>Initializes the native ManagedSession. Must be called after Originate.</summary>
|
||||
public void Initialize()
|
||||
{
|
||||
if (allocated == 0) {
|
||||
Log.WriteLine(LogLevel.Critical, "Cannot initialize a ManagedSession until it is allocated (originated successfully).");
|
||||
}
|
||||
// P/Invoke generated function pointers stick around until the delegate is collected
|
||||
// By sticking the delegates in fields, their lifetime won't be less than the session
|
||||
// So we don't need to worry about GCHandles and all that....
|
||||
@@ -59,6 +62,7 @@ namespace FreeSWITCH.Native
|
||||
this._inputCallbackRef = inputCallback;
|
||||
this._hangupCallbackRef = hangupCallback;
|
||||
InitManagedSession(ManagedSession.getCPtr(this).Handle, this._inputCallbackRef, this._hangupCallbackRef);
|
||||
this._variables = new ChannelVariables(this);
|
||||
}
|
||||
DtmfCallback _inputCallbackRef;
|
||||
CdeclAction _hangupCallbackRef;
|
||||
@@ -122,15 +126,9 @@ namespace FreeSWITCH.Native
|
||||
get { return this.Ready(); }
|
||||
}
|
||||
|
||||
Guid _uuid;
|
||||
bool _uuidSet;
|
||||
public Guid Uuid {
|
||||
get {
|
||||
if (!_uuidSet) {
|
||||
_uuid = new Guid(this.GetUuid());
|
||||
_uuidSet = true;
|
||||
}
|
||||
return _uuid;
|
||||
return new Guid(this.GetUuid());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user