[Freeswitch-dev] Issue while creating a session for an incoming call in managed application
Hi, I am having a third party VoIP client which exposes API in .NET to communicate with my application. I want to use this client as an endpoint in Freeswitch (like how it is implemented in "mod_skypopen" module), so that calls coming to this client can be handled at Freeswitch and (if required) bridge calls to clients connected to Freeswitch. To implement this, I have written a managed module in which "ILoadNotificationPlugin" is implemented where config (client's interface config) is loaded. When there is an incoming call (ringing state) to the client, I get handle in managed module and trying to establish a session at freeswitch. While doing this I am getting exception as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Here is the code that I am using... Could someone guide me if I am doing this correctly. Note: I am following "mod_skypopen" as an example... public static int new_inbound_channel(private_object pobject) { SWIGTYPE_p_switch_core_session session = null; SWIGTYPE_p_switch_channel channel = null; switch_endpoint_interface intf = new switch_endpoint_interface(); intf.interface_name = "NET_interface"; intf.io_routines = io_routines; intf.state_handler = state_handlers; freeswitch.switch_core_set_globals(); Api fsApi = new Api(); String uuid = fsApi.ExecuteString("create_uuid"); try { session = freeswitch.switch_core_session_request_uuid(intf, switch_call_direction_t.SWITCH_CALL_DIRECTION_INBOUND, 0, null, uuid); //I am getting the above issue here.... if (session != null) { freeswitch.switch_core_session_add_stream(session, null); channel = freeswitch.switch_core_session_get_channel(session); if (channel == null) { freeswitch.switch_core_session_destroy_state(session); return 0; } freeswitch.switch_channel_set_variable_name_printf(channel, "waste", "false"); pobject.caller_profile = freeswitch.switch_caller_profile_new(freeswitch.switch_core_session_get_pool(session), "NETClient", "dialplan", "callid_name", "callid_number", null, null, null, null, "mod_netclient", "context", "destination"); if (pobject.caller_profile != null) { freeswitch.switch_channel_set_name(channel, "name"); freeswitch.switch_channel_set_caller_profile(channel, pobject.caller_profile); } freeswitch.switch_channel_set_state_flag(channel, switch_channel_flag_t.CF_GEN_RINGBACK); switch_status_t session_status = freeswitch.switch_core_session_thread_launch(session); if (session_status != switch_status_t.SWITCH_STATUS_SUCCESS) { freeswitch.switch_core_session_destroy_state(session); return 0; } } } catch (Exception exp) { string expstring = exp.Message; } return 0; } Thanks & Regards Suneel
I suggest writing the same code in C, just to troubleshoot and make sure you're calling the switch_core_session_request_uuid function properly. That exception means "access violation" aka segfault. You can also turn on the debugger and step into the native code and see where it's failing. (I'm not sure if you break on exception if it'll show you.) Basically, you have to troubleshoot it like a normal C app. -Michael From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Papineni, Suneel Sent: Wednesday, June 13, 2012 9:29 AM To: freeswitch-dev@lists.freeswitch.org Subject: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application Hi, I am having a third party VoIP client which exposes API in .NET to communicate with my application. I want to use this client as an endpoint in Freeswitch (like how it is implemented in "mod_skypopen" module), so that calls coming to this client can be handled at Freeswitch and (if required) bridge calls to clients connected to Freeswitch. To implement this, I have written a managed module in which "ILoadNotificationPlugin" is implemented where config (client's interface config) is loaded. When there is an incoming call (ringing state) to the client, I get handle in managed module and trying to establish a session at freeswitch. While doing this I am getting exception as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Here is the code that I am using... Could someone guide me if I am doing this correctly. Note: I am following "mod_skypopen" as an example... public static int new_inbound_channel(private_object pobject) { SWIGTYPE_p_switch_core_session session = null; SWIGTYPE_p_switch_channel channel = null; switch_endpoint_interface intf = new switch_endpoint_interface(); intf.interface_name = "NET_interface"; intf.io_routines = io_routines; intf.state_handler = state_handlers; freeswitch.switch_core_set_globals(); Api fsApi = new Api(); String uuid = fsApi.ExecuteString("create_uuid"); try { session = freeswitch.switch_core_session_request_uuid(intf, switch_call_direction_t.SWITCH_CALL_DIRECTION_INBOUND, 0, null, uuid); //I am getting the above issue here.... if (session != null) { freeswitch.switch_core_session_add_stream(session, null); channel = freeswitch.switch_core_session_get_channel(session); if (channel == null) { freeswitch.switch_core_session_destroy_state(session); return 0; } freeswitch.switch_channel_set_variable_name_printf(channel, "waste", "false"); pobject.caller_profile = freeswitch.switch_caller_profile_new(freeswitch.switch_core_session_get_pool(session), "NETClient", "dialplan", "callid_name", "callid_number", null, null, null, null, "mod_netclient", "context", "destination"); if (pobject.caller_profile != null) { freeswitch.switch_channel_set_name(channel, "name"); freeswitch.switch_channel_set_caller_profile(channel, pobject.caller_profile); } freeswitch.switch_channel_set_state_flag(channel, switch_channel_flag_t.CF_GEN_RINGBACK); switch_status_t session_status = freeswitch.switch_core_session_thread_launch(session); if (session_status != switch_status_t.SWITCH_STATUS_SUCCESS) { freeswitch.switch_core_session_destroy_state(session); return 0; } } } catch (Exception exp) { string expstring = exp.Message; } return 0; } Thanks & Regards Suneel
Seems strange to create a new endpoint interface on each new incoming call. That interface is something you usually create using switch_loadable_module_create_module_interface(), and that is something you do when the module is loaded (that interface is valid until the modules is unloaded again). I've never used the managed stuff myself, so I say as Michael, first try using C to get basic stuff working, and then try to port that to managed code. /Peter ________________________________ Från: freeswitch-dev-bounces@lists.freeswitch.org [freeswitch-dev-bounces@lists.freeswitch.org] för Michael Giagnocavo [mgg@giagnocavo.net] Skickat: den 13 juni 2012 17:33 Till: freeswitch-dev@lists.freeswitch.org Ämne: Re: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application I suggest writing the same code in C, just to troubleshoot and make sure you’re calling the switch_core_session_request_uuid function properly. That exception means “access violation” aka segfault. You can also turn on the debugger and step into the native code and see where it’s failing. (I’m not sure if you break on exception if it’ll show you.) Basically, you have to troubleshoot it like a normal C app. -Michael From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Papineni, Suneel Sent: Wednesday, June 13, 2012 9:29 AM To: freeswitch-dev@lists.freeswitch.org Subject: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application Hi, I am having a third party VoIP client which exposes API in .NET to communicate with my application. I want to use this client as an endpoint in Freeswitch (like how it is implemented in “mod_skypopen” module), so that calls coming to this client can be handled at Freeswitch and (if required) bridge calls to clients connected to Freeswitch. To implement this, I have written a managed module in which “ILoadNotificationPlugin” is implemented where config (client’s interface config) is loaded. When there is an incoming call (ringing state) to the client, I get handle in managed module and trying to establish a session at freeswitch. While doing this I am getting exception as “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” Here is the code that I am using… Could someone guide me if I am doing this correctly. Note: I am following “mod_skypopen” as an example… public static int new_inbound_channel(private_object pobject) { SWIGTYPE_p_switch_core_session session = null; SWIGTYPE_p_switch_channel channel = null; switch_endpoint_interface intf = new switch_endpoint_interface(); intf.interface_name = "NET_interface"; intf.io_routines = io_routines; intf.state_handler = state_handlers; freeswitch.switch_core_set_globals(); Api fsApi = new Api(); String uuid = fsApi.ExecuteString("create_uuid"); try { session = freeswitch.switch_core_session_request_uuid(intf, switch_call_direction_t.SWITCH_CALL_DIRECTION_INBOUND, 0, null, uuid); //I am getting the above issue here…. if (session != null) { freeswitch.switch_core_session_add_stream(session, null); channel = freeswitch.switch_core_session_get_channel(session); if (channel == null) { freeswitch.switch_core_session_destroy_state(session); return 0; } freeswitch.switch_channel_set_variable_name_printf(channel, "waste", "false"); pobject.caller_profile = freeswitch.switch_caller_profile_new(freeswitch.switch_core_session_get_pool(session), "NETClient", "dialplan", "callid_name", "callid_number", null, null, null, null, "mod_netclient", "context", "destination"); if (pobject.caller_profile != null) { freeswitch.switch_channel_set_name(channel, "name"); freeswitch.switch_channel_set_caller_profile(channel, pobject.caller_profile); } freeswitch.switch_channel_set_state_flag(channel, switch_channel_flag_t.CF_GEN_RINGBACK); switch_status_t session_status = freeswitch.switch_core_session_thread_launch(session); if (session_status != switch_status_t.SWITCH_STATUS_SUCCESS) { freeswitch.switch_core_session_destroy_state(session); return 0; } } } catch (Exception exp) { string expstring = exp.Message; } return 0; } Thanks & Regards Suneel !DSPAM:4fd8b07c32761759318328!
Hi Peter, Yes, you are right. According to the code specified here for each call there is a new interface is created. I put this here only to display less code in the mail. In fact in my application I have only one interface which is created in configLoad function. Thanks & Regards Suneel -----Original Message----- From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Peter Olsson Sent: 13 June 2012 17:58 To: freeswitch-dev@lists.freeswitch.org Subject: Re: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application Seems strange to create a new endpoint interface on each new incoming call. That interface is something you usually create using switch_loadable_module_create_module_interface(), and that is something you do when the module is loaded (that interface is valid until the modules is unloaded again). I've never used the managed stuff myself, so I say as Michael, first try using C to get basic stuff working, and then try to port that to managed code. /Peter ________________________________ Från: freeswitch-dev-bounces@lists.freeswitch.org [freeswitch-dev-bounces@lists.freeswitch.org] för Michael Giagnocavo [mgg@giagnocavo.net] Skickat: den 13 juni 2012 17:33 Till: freeswitch-dev@lists.freeswitch.org Ämne: Re: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application I suggest writing the same code in C, just to troubleshoot and make sure you're calling the switch_core_session_request_uuid function properly. That exception means "access violation" aka segfault. You can also turn on the debugger and step into the native code and see where it's failing. (I'm not sure if you break on exception if it'll show you.) Basically, you have to troubleshoot it like a normal C app. -Michael From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Papineni, Suneel Sent: Wednesday, June 13, 2012 9:29 AM To: freeswitch-dev@lists.freeswitch.org Subject: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application Hi, I am having a third party VoIP client which exposes API in .NET to communicate with my application. I want to use this client as an endpoint in Freeswitch (like how it is implemented in "mod_skypopen" module), so that calls coming to this client can be handled at Freeswitch and (if required) bridge calls to clients connected to Freeswitch. To implement this, I have written a managed module in which "ILoadNotificationPlugin" is implemented where config (client's interface config) is loaded. When there is an incoming call (ringing state) to the client, I get handle in managed module and trying to establish a session at freeswitch. While doing this I am getting exception as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Here is the code that I am using. Could someone guide me if I am doing this correctly. Note: I am following "mod_skypopen" as an example. public static int new_inbound_channel(private_object pobject) { SWIGTYPE_p_switch_core_session session = null; SWIGTYPE_p_switch_channel channel = null; switch_endpoint_interface intf = new switch_endpoint_interface(); intf.interface_name = "NET_interface"; intf.io_routines = io_routines; intf.state_handler = state_handlers; freeswitch.switch_core_set_globals(); Api fsApi = new Api(); String uuid = fsApi.ExecuteString("create_uuid"); try { session = freeswitch.switch_core_session_request_uuid(intf, switch_call_direction_t.SWITCH_CALL_DIRECTION_INBOUND, 0, null, uuid); //I am getting the above issue here.. if (session != null) { freeswitch.switch_core_session_add_stream(session, null); channel = freeswitch.switch_core_session_get_channel(session); if (channel == null) { freeswitch.switch_core_session_destroy_state(session); return 0; } freeswitch.switch_channel_set_variable_name_printf(channel, "waste", "false"); pobject.caller_profile = freeswitch.switch_caller_profile_new(freeswitch.switch_core_session_get_pool(session), "NETClient", "dialplan", "callid_name", "callid_number", null, null, null, null, "mod_netclient", "context", "destination"); if (pobject.caller_profile != null) { freeswitch.switch_channel_set_name(channel, "name"); freeswitch.switch_channel_set_caller_profile(channel, pobject.caller_profile); } freeswitch.switch_channel_set_state_flag(channel, switch_channel_flag_t.CF_GEN_RINGBACK); switch_status_t session_status = freeswitch.switch_core_session_thread_launch(session); if (session_status != switch_status_t.SWITCH_STATUS_SUCCESS) { freeswitch.switch_core_session_destroy_state(session); return 0; } } } catch (Exception exp) { string expstring = exp.Message; } return 0; } Thanks & Regards Suneel !DSPAM:4fd8b07c32761759318328! _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com Join Us At ClueCon - Aug 7-9, 2012 FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
I've never tried exactly this scenario but I think you can use uuid_break to stop the playback of the current call. Use the "all" flag to discard the playback of all sound files that are currently queued up to be played to the channel. http://wiki.freeswitch.org/wiki/Mod_commands#uuid_break Let us know if that works... and welcome to FreeSWITCH, btw! Oh, and be sure to send future questions like this to the freeswitch-users list because you'll have a wider audience and will probably get a quicker response. The -dev list is more for digging deeper into the code, like the C code, etc. :) -MC On Mon, Jul 2, 2012 at 12:55 PM, Leonardo <leonardo@daitangroup.com> wrote:
Hi. I'm newbie in FreeSwitch and I'm trying to develop an application using mod_socket interface. First, I configured the FreeSwitch to answer any call coming from my gateway:
(dialplan/public.xml) <include> <extension name="from_my_gateway"> <condition field="network_addr" expression="192\.231\.7\.123" > <action application="answer"/> <action application="sleep" data="50000"/> </condition> </extension> </include>
After that I could play an audio in a call via mod_socket interface:
api uuid_broadcast b5bd30fb-cd3e-4f13-a975-5be0aef6a0f7 /usr/local/freeswitch/sounds/music/8000/danza-espanola-op-37-h-142-xii-arabesca.wav both
So far so good ... Than I would like to stop the current audio file and play something else. How could I do that?
I already tried to play another audio file before the first one stop. Nothing happened. I tried to stop the current audio using: api uuid_fileman b5bd30fb-cd3e-4f13-a975-5be0aef6a0f7 stop but the call was HANGUP
Thanks in advance, Leo
Hi Michael, Thanks for your quick reply. I tried same function in C code and it worked fine. Also as you said, I tried to debug and the problem appears to be at "SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_session_request_uuid(void * jarg1, int jarg2, unsigned long jarg3, void * jarg4, char * jarg5){ }" function present in "freeswitch_wrap.2010.cxx" file in "mod_managed" project. In this function exception is thrown from "return jresult;" line. In this jarg4 shown as <undefined value> and other parameters are having values (in debug mode). I was unable to debug line by line in this function. I was unable to figure out why it is throwing this error at this function. Will it comes if interface does not exist or interface config is not loaded properly? Thanks & Regards Suneel From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Michael Giagnocavo Sent: 13 June 2012 16:34 To: freeswitch-dev@lists.freeswitch.org Subject: Re: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application I suggest writing the same code in C, just to troubleshoot and make sure you're calling the switch_core_session_request_uuid function properly. That exception means "access violation" aka segfault. You can also turn on the debugger and step into the native code and see where it's failing. (I'm not sure if you break on exception if it'll show you.) Basically, you have to troubleshoot it like a normal C app. -Michael From: freeswitch-dev-bounces@lists.freeswitch.org<mailto:freeswitch-dev-bounces@lists.freeswitch.org> [mailto:freeswitch-dev-bounces@lists.freeswitch.org]<mailto:[mailto:freeswitch-dev-bounces@lists.freeswitch.org]> On Behalf Of Papineni, Suneel Sent: Wednesday, June 13, 2012 9:29 AM To: freeswitch-dev@lists.freeswitch.org<mailto:freeswitch-dev@lists.freeswitch.org> Subject: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application Hi, I am having a third party VoIP client which exposes API in .NET to communicate with my application. I want to use this client as an endpoint in Freeswitch (like how it is implemented in "mod_skypopen" module), so that calls coming to this client can be handled at Freeswitch and (if required) bridge calls to clients connected to Freeswitch. To implement this, I have written a managed module in which "ILoadNotificationPlugin" is implemented where config (client's interface config) is loaded. When there is an incoming call (ringing state) to the client, I get handle in managed module and trying to establish a session at freeswitch. While doing this I am getting exception as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Here is the code that I am using... Could someone guide me if I am doing this correctly. Note: I am following "mod_skypopen" as an example... public static int new_inbound_channel(private_object pobject) { SWIGTYPE_p_switch_core_session session = null; SWIGTYPE_p_switch_channel channel = null; switch_endpoint_interface intf = new switch_endpoint_interface(); intf.interface_name = "NET_interface"; intf.io_routines = io_routines; intf.state_handler = state_handlers; freeswitch.switch_core_set_globals(); Api fsApi = new Api(); String uuid = fsApi.ExecuteString("create_uuid"); try { session = freeswitch.switch_core_session_request_uuid(intf, switch_call_direction_t.SWITCH_CALL_DIRECTION_INBOUND, 0, null, uuid); //I am getting the above issue here.... if (session != null) { freeswitch.switch_core_session_add_stream(session, null); channel = freeswitch.switch_core_session_get_channel(session); if (channel == null) { freeswitch.switch_core_session_destroy_state(session); return 0; } freeswitch.switch_channel_set_variable_name_printf(channel, "waste", "false"); pobject.caller_profile = freeswitch.switch_caller_profile_new(freeswitch.switch_core_session_get_pool(session), "NETClient", "dialplan", "callid_name", "callid_number", null, null, null, null, "mod_netclient", "context", "destination"); if (pobject.caller_profile != null) { freeswitch.switch_channel_set_name(channel, "name"); freeswitch.switch_channel_set_caller_profile(channel, pobject.caller_profile); } freeswitch.switch_channel_set_state_flag(channel, switch_channel_flag_t.CF_GEN_RINGBACK); switch_status_t session_status = freeswitch.switch_core_session_thread_launch(session); if (session_status != switch_status_t.SWITCH_STATUS_SUCCESS) { freeswitch.switch_core_session_destroy_state(session); return 0; } } } catch (Exception exp) { string expstring = exp.Message; } return 0; } Thanks & Regards Suneel
You may need to switch to assembly debugging to really find out where it's AV'ing. It's also possible that the SWIG glue code is incorrect, so keep that in mind when you're looking at the codegen. -Michael From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Papineni, Suneel Sent: Wednesday, June 13, 2012 11:04 AM To: freeswitch-dev@lists.freeswitch.org Subject: Re: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application Hi Michael, Thanks for your quick reply. I tried same function in C code and it worked fine. Also as you said, I tried to debug and the problem appears to be at "SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_session_request_uuid(void * jarg1, int jarg2, unsigned long jarg3, void * jarg4, char * jarg5){ }" function present in "freeswitch_wrap.2010.cxx" file in "mod_managed" project. In this function exception is thrown from "return jresult;" line. In this jarg4 shown as <undefined value> and other parameters are having values (in debug mode). I was unable to debug line by line in this function. I was unable to figure out why it is throwing this error at this function. Will it comes if interface does not exist or interface config is not loaded properly? Thanks & Regards Suneel From: freeswitch-dev-bounces@lists.freeswitch.org<mailto:freeswitch-dev-bounces@lists.freeswitch.org> [mailto:freeswitch-dev-bounces@lists.freeswitch.org]<mailto:[mailto:freeswitch-dev-bounces@lists.freeswitch.org]> On Behalf Of Michael Giagnocavo Sent: 13 June 2012 16:34 To: freeswitch-dev@lists.freeswitch.org<mailto:freeswitch-dev@lists.freeswitch.org> Subject: Re: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application I suggest writing the same code in C, just to troubleshoot and make sure you're calling the switch_core_session_request_uuid function properly. That exception means "access violation" aka segfault. You can also turn on the debugger and step into the native code and see where it's failing. (I'm not sure if you break on exception if it'll show you.) Basically, you have to troubleshoot it like a normal C app. -Michael From: freeswitch-dev-bounces@lists.freeswitch.org<mailto:freeswitch-dev-bounces@lists.freeswitch.org> [mailto:freeswitch-dev-bounces@lists.freeswitch.org]<mailto:[mailto:freeswitch-dev-bounces@lists.freeswitch.org]> On Behalf Of Papineni, Suneel Sent: Wednesday, June 13, 2012 9:29 AM To: freeswitch-dev@lists.freeswitch.org<mailto:freeswitch-dev@lists.freeswitch.org> Subject: [Freeswitch-dev] Issue while creating a session for an incoming call in managed application Hi, I am having a third party VoIP client which exposes API in .NET to communicate with my application. I want to use this client as an endpoint in Freeswitch (like how it is implemented in "mod_skypopen" module), so that calls coming to this client can be handled at Freeswitch and (if required) bridge calls to clients connected to Freeswitch. To implement this, I have written a managed module in which "ILoadNotificationPlugin" is implemented where config (client's interface config) is loaded. When there is an incoming call (ringing state) to the client, I get handle in managed module and trying to establish a session at freeswitch. While doing this I am getting exception as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Here is the code that I am using... Could someone guide me if I am doing this correctly. Note: I am following "mod_skypopen" as an example... public static int new_inbound_channel(private_object pobject) { SWIGTYPE_p_switch_core_session session = null; SWIGTYPE_p_switch_channel channel = null; switch_endpoint_interface intf = new switch_endpoint_interface(); intf.interface_name = "NET_interface"; intf.io_routines = io_routines; intf.state_handler = state_handlers; freeswitch.switch_core_set_globals(); Api fsApi = new Api(); String uuid = fsApi.ExecuteString("create_uuid"); try { session = freeswitch.switch_core_session_request_uuid(intf, switch_call_direction_t.SWITCH_CALL_DIRECTION_INBOUND, 0, null, uuid); //I am getting the above issue here.... if (session != null) { freeswitch.switch_core_session_add_stream(session, null); channel = freeswitch.switch_core_session_get_channel(session); if (channel == null) { freeswitch.switch_core_session_destroy_state(session); return 0; } freeswitch.switch_channel_set_variable_name_printf(channel, "waste", "false"); pobject.caller_profile = freeswitch.switch_caller_profile_new(freeswitch.switch_core_session_get_pool(session), "NETClient", "dialplan", "callid_name", "callid_number", null, null, null, null, "mod_netclient", "context", "destination"); if (pobject.caller_profile != null) { freeswitch.switch_channel_set_name(channel, "name"); freeswitch.switch_channel_set_caller_profile(channel, pobject.caller_profile); } freeswitch.switch_channel_set_state_flag(channel, switch_channel_flag_t.CF_GEN_RINGBACK); switch_status_t session_status = freeswitch.switch_core_session_thread_launch(session); if (session_status != switch_status_t.SWITCH_STATUS_SUCCESS) { freeswitch.switch_core_session_destroy_state(session); return 0; } } } catch (Exception exp) { string expstring = exp.Message; } return 0; } Thanks & Regards Suneel
participants (5)
-
Leonardo
-
Michael Collins
-
Michael Giagnocavo
-
Papineni, Suneel
-
Peter Olsson