diff --git a/src/dotnet/Marshaling/Types/ApiInterfaceMarshal.cs b/src/dotnet/Marshaling/Types/ApiInterfaceMarshal.cs index fe84690312..950b83c908 100755 --- a/src/dotnet/Marshaling/Types/ApiInterfaceMarshal.cs +++ b/src/dotnet/Marshaling/Types/ApiInterfaceMarshal.cs @@ -42,7 +42,8 @@ namespace FreeSwitch.Marshaling.Types internal IntPtr interface_name; //[MarshalAs(UnmanagedType.LPStr)] internal IntPtr desc; - internal ApiFunction function; + internal ApiFunction function; + internal IntPtr syntax; internal IntPtr next; } } diff --git a/src/dotnet/Module.cs b/src/dotnet/Module.cs index 59078ecedd..b1f4f81394 100644 --- a/src/dotnet/Module.cs +++ b/src/dotnet/Module.cs @@ -130,6 +130,7 @@ namespace FreeSwitch /* Allocate umanaged mem to to interface fields so GC doesn't disturb them */ apiInterfaceMarshal.interface_name = Marshal.StringToHGlobalAnsi(apiInterface.Name); apiInterfaceMarshal.desc = Marshal.StringToHGlobalAnsi(apiInterface.Description); + apiInterfaceMarshal.syntax = Marshal.StringToHGlobalAnsi(apiInterface.Syntax); apiInterfaceMarshal.function = new ApiFunction(apiInterface.ApiFunction); /* Set the handle of the managed object */ diff --git a/src/dotnet/Modules/Api.cs b/src/dotnet/Modules/Api.cs index 88b89634f1..cacd6acbe7 100755 --- a/src/dotnet/Modules/Api.cs +++ b/src/dotnet/Modules/Api.cs @@ -41,6 +41,7 @@ namespace FreeSwitch.Modules { private string name; private string description; + private string syntax; private ApiFunction apiFunction; public HandleRef handle; @@ -56,6 +57,12 @@ namespace FreeSwitch.Modules get { return description; } } + public string Syntax + { + set { syntax = value; } + get { return syntax; } + } + public ApiFunction ApiFunction { set { apiFunction = value; } diff --git a/src/include/switch_module_interfaces.h b/src/include/switch_module_interfaces.h index 703a982a9b..d7df94948e 100644 --- a/src/include/switch_module_interfaces.h +++ b/src/include/switch_module_interfaces.h @@ -537,6 +537,8 @@ struct switch_api_interface { const char *desc; /*! function the api call uses */ switch_api_function_t function; + /*! an example of the application syntax */ + const char *syntax; const struct switch_api_interface *next; }; diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 1444308ae7..699e0b8b5e 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -491,6 +491,7 @@ static switch_api_interface_t ctl_api_interface = { /*.interface_name */ "fsctl", /*.desc */ "control messages", /*.function */ ctl_function, + /*.syntax */ NULL, /*.next */ }; @@ -498,6 +499,7 @@ static switch_api_interface_t uuid_bridge_api_interface = { /*.interface_name */ "uuid_bridge", /*.desc */ "uuid_bridge", /*.function */ uuid_bridge_function, + /*.syntax */ NULL, /*.next */ &ctl_api_interface }; @@ -505,6 +507,7 @@ static switch_api_interface_t status_api_interface = { /*.interface_name */ "status", /*.desc */ "status", /*.function */ status_function, + /*.syntax */ NULL, /*.next */ &uuid_bridge_api_interface }; @@ -512,6 +515,7 @@ static switch_api_interface_t show_api_interface = { /*.interface_name */ "show", /*.desc */ "Show", /*.function */ show_function, + /*.syntax */ NULL, /*.next */ &status_api_interface }; @@ -519,6 +523,7 @@ static switch_api_interface_t pause_api_interface = { /*.interface_name */ "pause", /*.desc */ "Pause", /*.function */ pause_function, + /*.syntax */ NULL, /*.next */ &show_api_interface }; @@ -526,6 +531,7 @@ static switch_api_interface_t transfer_api_interface = { /*.interface_name */ "transfer", /*.desc */ "Transfer", /*.function */ transfer_function, + /*.syntax */ NULL, /*.next */ &pause_api_interface }; @@ -533,6 +539,7 @@ static switch_api_interface_t load_api_interface = { /*.interface_name */ "load", /*.desc */ "Load Module", /*.function */ load_function, + /*.syntax */ NULL, /*.next */ &transfer_api_interface }; @@ -540,6 +547,7 @@ static switch_api_interface_t reload_api_interface = { /*.interface_name */ "reloadxml", /*.desc */ "Reload XML", /*.function */ reload_function, + /*.syntax */ NULL, /*.next */ &load_api_interface, }; @@ -548,6 +556,7 @@ static switch_api_interface_t commands_api_interface = { /*.interface_name */ "killchan", /*.desc */ "Kill Channel", /*.function */ kill_function, + /*.syntax */ NULL, /*.next */ &reload_api_interface }; @@ -555,6 +564,7 @@ static switch_api_interface_t originate_api_interface = { /*.interface_name */ "originate", /*.desc */ "Originate a Call", /*.function */ originate_function, + /*.syntax */ NULL, /*.next */ &commands_api_interface }; diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index a957b0f5e9..e8675af609 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -2665,7 +2665,8 @@ static const switch_application_interface_t conference_application_interface = { static switch_api_interface_t conf_api_interface = { /*.interface_name */ "conference", /*.desc */ "Conference", - /*.function */ conf_function + /*.function */ conf_function, + /*.syntax */ NULL, /*.next */ }; diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 33b653818e..710d5236fb 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -133,6 +133,7 @@ static switch_api_interface_t dptools_api_interface = { /*.interface_name */ "strftime", /*.desc */ "strftime", /*.function */ strftime_api_function, + /*.syntax */ NULL, /*.next */ NULL }; diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 8ed2788285..753532ec5b 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -1071,6 +1071,7 @@ static switch_api_interface_t logout_api_interface = { /*.interface_name */ "dl_logout", /*.desc */ "DingaLing Logout", /*.function */ dl_logout, + /*.syntax */ NULL, /*.next */ NULL }; @@ -1078,6 +1079,7 @@ static switch_api_interface_t login_api_interface = { /*.interface_name */ "dl_login", /*.desc */ "DingaLing Login", /*.function */ dl_login, + /*.syntax */ NULL, /*.next */ &logout_api_interface }; diff --git a/src/mod/endpoints/mod_portaudio/mod_portaudio.c b/src/mod/endpoints/mod_portaudio/mod_portaudio.c index 0b6660163b..983187269f 100644 --- a/src/mod/endpoints/mod_portaudio/mod_portaudio.c +++ b/src/mod/endpoints/mod_portaudio/mod_portaudio.c @@ -440,6 +440,7 @@ static switch_api_interface_t send_dtmf_interface = { /*.interface_name */ "padtmf", /*.desc */ "PortAudio Dial DTMF", /*.function */ send_dtmf, + /*.syntax */ NULL, /*.next */ NULL }; @@ -447,6 +448,7 @@ static switch_api_interface_t answer_call_interface = { /*.interface_name */ "paoffhook", /*.desc */ "PortAudio Answer Call", /*.function */ answer_call, + /*.syntax */ NULL, /*.next */ &send_dtmf_interface }; @@ -454,6 +456,7 @@ static switch_api_interface_t channel_info_interface = { /*.interface_name */ "painfo", /*.desc */ "PortAudio Call Info", /*.function */ call_info, + /*.syntax */ NULL, /*.next */ &answer_call_interface }; @@ -461,6 +464,7 @@ static switch_api_interface_t channel_hup_interface = { /*.interface_name */ "pahup", /*.desc */ "PortAudio Hangup Call", /*.function */ hup_call, + /*.syntax */ NULL, /*.next */ &channel_info_interface }; @@ -468,6 +472,7 @@ static switch_api_interface_t channel_api_interface = { /*.interface_name */ "pacall", /*.desc */ "PortAudio Call", /*.function */ place_call, + /*.syntax */ NULL, /*.next */ &channel_hup_interface }; diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 179f11f365..70aa0756d8 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -2696,6 +2696,7 @@ static switch_api_interface_t js_run_interface = { /*.interface_name */ "jsrun", /*.desc */ "run a script", /*.function */ launch_async, + /*.syntax */ NULL, /*.next */ NULL };