mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
P/Invoke should do all the work for us
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9797 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -74,9 +74,6 @@ ManagedSession::~ManagedSession()
|
||||
// Don't let any callbacks use this CoreSession anymore
|
||||
switch_channel_set_private(channel, "CoreSession", NULL);
|
||||
}
|
||||
// Free delegates
|
||||
hangupDelegateHandle.Free();
|
||||
dtmfDelegateHandle.Free();
|
||||
}
|
||||
|
||||
bool ManagedSession::begin_allow_threads()
|
||||
@@ -91,22 +88,23 @@ bool ManagedSession::end_allow_threads()
|
||||
|
||||
void ManagedSession::check_hangup_hook()
|
||||
{
|
||||
if (!hangupDelegateHandle.IsAllocated) {
|
||||
if (!hangupDelegate) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "hangupDelegateHandle didn't get an object.");
|
||||
return;
|
||||
}
|
||||
((HangupDelegate^)hangupDelegateHandle.Target)();
|
||||
hangupDelegate();
|
||||
}
|
||||
|
||||
switch_status_t ManagedSession::run_dtmf_callback(void *input, switch_input_type_t itype)
|
||||
{
|
||||
if (!dtmfDelegateHandle.IsAllocated) {
|
||||
if (!dtmfDelegate) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "dtmfDelegateHandle didn't get an object.");
|
||||
return SWITCH_STATUS_FALSE;;
|
||||
}
|
||||
char *result = ((InputDelegate^)dtmfDelegateHandle.Target)(input, itype);
|
||||
char *result = dtmfDelegate(input, itype);
|
||||
|
||||
switch_status_t status = process_callback_result(result);
|
||||
Marshal::FreeHGlobal(IntPtr(result)); // I think this is right
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user