mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-14 23:34:13 +00:00
fold version macros into runtime functions to avoid cascade rebuilds when modifying the core
This commit is contained in:
1 parent
104ce2a35f
commit
8dfbd91a3d
22 files changed
+157
-39
No files matched your search
@@ -42,7 +42,6 @@
|
||||
*/
|
||||
#include <switch.h>
|
||||
#include <switch_stun.h>
|
||||
#include <switch_version.h>
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load);
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_commands_shutdown);
|
||||
@@ -536,7 +535,7 @@ SWITCH_STANDARD_API(version_function)
|
||||
char *mydata = NULL, *argv[2];
|
||||
|
||||
if (zstr(cmd)) {
|
||||
stream->write_function(stream, "FreeSWITCH Version %s (%s)\n", SWITCH_VERSION_FULL, SWITCH_VERSION_REVISION_HUMAN);
|
||||
stream->write_function(stream, "FreeSWITCH Version %s (%s)\n", switch_version_full(), switch_version_revision_human());
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -546,9 +545,9 @@ SWITCH_STANDARD_API(version_function)
|
||||
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
|
||||
if (argc > 0 && switch_stristr("short", argv[0])) {
|
||||
stream->write_function(stream, "%s.%s.%s\n", SWITCH_VERSION_MAJOR,SWITCH_VERSION_MINOR,SWITCH_VERSION_MICRO);
|
||||
stream->write_function(stream, "%s.%s.%s\n", switch_version_major(),switch_version_minor(),switch_version_micro());
|
||||
} else {
|
||||
stream->write_function(stream, "FreeSWITCH Version %s (%s)\n", SWITCH_VERSION_FULL, SWITCH_VERSION_FULL_HUMAN);
|
||||
stream->write_function(stream, "FreeSWITCH Version %s (%s)\n", switch_version_full(), switch_version_full_human());
|
||||
}
|
||||
|
||||
switch_safe_free(mydata);
|
||||
@@ -2106,7 +2105,7 @@ SWITCH_STANDARD_API(status_function)
|
||||
duration.sec, duration.sec == 1 ? "" : "s", duration.ms , duration.ms == 1 ? "" : "s", duration.mms,
|
||||
duration.mms == 1 ? "" : "s", nl);
|
||||
|
||||
stream->write_function(stream, "FreeSWITCH (Version %s) is %s%s", SWITCH_VERSION_FULL_HUMAN,
|
||||
stream->write_function(stream, "FreeSWITCH (Version %s) is %s%s", switch_version_full_human(),
|
||||
switch_core_ready() ? "ready" : "not ready", nl);
|
||||
|
||||
stream->write_function(stream, "%" SWITCH_SIZE_T_FMT " session(s) since startup%s", switch_core_session_id() - 1, nl);
|
||||
@@ -6268,7 +6267,7 @@ SWITCH_STANDARD_JSON_API(json_api_function)
|
||||
|
||||
}
|
||||
|
||||
#include <switch_version.h>
|
||||
|
||||
SWITCH_STANDARD_JSON_API(json_status_function)
|
||||
{
|
||||
cJSON *o, *oo, *reply = cJSON_CreateObject();
|
||||
@@ -6298,7 +6297,7 @@ SWITCH_STANDARD_JSON_API(json_status_function)
|
||||
cJSON_AddItemToObject(o, "microseconds", cJSON_CreateNumber(duration.mms));
|
||||
|
||||
cJSON_AddItemToObject(reply, "uptime", o);
|
||||
cJSON_AddItemToObject(reply, "version", cJSON_CreateString(SWITCH_VERSION_FULL_HUMAN));
|
||||
cJSON_AddItemToObject(reply, "version", cJSON_CreateString(switch_version_full_human()));
|
||||
|
||||
o = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(reply, "sessions", o);
|
||||
|
||||
@@ -76,7 +76,6 @@
|
||||
#define GSMOPEN_ALSA
|
||||
#endif // NO_ALSA
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
#ifndef WIN32
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
@@ -132,7 +131,7 @@
|
||||
//#define SAMPLES_PER_FRAME SAMPLERATE_GSMOPEN/50
|
||||
|
||||
#ifndef GSMOPEN_SVN_VERSION
|
||||
#define GSMOPEN_SVN_VERSION SWITCH_VERSION_FULL
|
||||
#define GSMOPEN_SVN_VERSION switch_version_full()
|
||||
#endif /* GSMOPEN_SVN_VERSION */
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
#define SAMPLERATE_GSMOPEN 8000
|
||||
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
#ifndef WIN32
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
@@ -104,7 +103,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef GSMOPEN_SVN_VERSION
|
||||
#define GSMOPEN_SVN_VERSION SWITCH_VERSION_FULL
|
||||
#define GSMOPEN_SVN_VERSION switch_version_full()
|
||||
#endif /* GSMOPEN_SVN_VERSION */
|
||||
|
||||
#include "ctb-0.16/ctb.h"
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
|
||||
#define HAVE_APR
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
#define MODNAME "mod_h323"
|
||||
#define OpalT38_IFP_COR GetOpalT38_IFP_COR()
|
||||
#define OpalT38_IFP_PRE GetOpalT38_IFP_PRE()
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#define _DEFS_H_
|
||||
|
||||
/* formatation macros */
|
||||
#include "switch_version.h"
|
||||
#include "revision.h"
|
||||
|
||||
#define KHOMP_LOG __FILE__, __SWITCH_FUNC__, __LINE__
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/time.h>
|
||||
@@ -85,7 +84,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef SKYPOPEN_SVN_VERSION
|
||||
#define SKYPOPEN_SVN_VERSION SWITCH_VERSION_FULL
|
||||
#define SKYPOPEN_SVN_VERSION switch_version_full()
|
||||
#endif /* SKYPOPEN_SVN_VERSION */
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#define SOFIA_QUEUE_SIZE 50000
|
||||
#define HAVE_APR
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
#define SOFIA_NAT_SESSION_TIMEOUT 90
|
||||
#define SOFIA_MAX_ACL 100
|
||||
#ifdef _MSC_VER
|
||||
@@ -96,7 +95,6 @@ typedef struct private_object private_object_t;
|
||||
|
||||
#define MULTICAST_EVENT "multicast::event"
|
||||
#define SOFIA_REPLACES_HEADER "_sofia_replaces_"
|
||||
#define SOFIA_USER_AGENT "FreeSWITCH-mod_sofia/" SWITCH_VERSION_FULL
|
||||
#define SOFIA_CHAT_PROTO "sip"
|
||||
#define SOFIA_MULTIPART_PREFIX "sip_mp_"
|
||||
#define SOFIA_MULTIPART_PREFIX_T "~sip_mp_"
|
||||
|
||||
@@ -3742,7 +3742,8 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
|
||||
profile->auto_rtp_bugs = RTP_BUG_CISCO_SKIP_MARK_BIT_2833;// | RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833;
|
||||
|
||||
profile->pool = pool;
|
||||
profile->user_agent = SOFIA_USER_AGENT;
|
||||
|
||||
profile->user_agent = switch_core_sprintf(profile->pool, "FreeSWITCH-mod_sofia/%s", switch_version_full());
|
||||
|
||||
profile->name = switch_core_strdup(profile->pool, xprofilename);
|
||||
switch_snprintf(url, sizeof(url), "sofia_reg_%s", xprofilename);
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
*
|
||||
*/
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
@@ -175,7 +174,7 @@ int handle_identity(netsnmp_mib_handler *handler, netsnmp_handler_registration *
|
||||
{
|
||||
netsnmp_request_info *request = NULL;
|
||||
oid subid;
|
||||
static char const version[] = SWITCH_VERSION_FULL;
|
||||
static char const version[] = switch_version_full();
|
||||
char uuid[40] = "";
|
||||
|
||||
switch(reqinfo->mode) {
|
||||
|
||||
@@ -14626,6 +14626,76 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_debug_pool(void * jarg1)
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_version_major() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)switch_version_major();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_version_minor() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)switch_version_minor();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_version_micro() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)switch_version_micro();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_version_revision() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)switch_version_revision();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_version_revision_human() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)switch_version_revision_human();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_version_full() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)switch_version_full();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_version_full_human() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)switch_version_full_human();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_module_name_set(void * jarg1, char * jarg2) {
|
||||
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
@@ -3150,6 +3150,41 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_core_session_debug_pool(switch_stream_handle.getCPtr(stream));
|
||||
}
|
||||
|
||||
public static string switch_version_major() {
|
||||
string ret = freeswitchPINVOKE.switch_version_major();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_version_minor() {
|
||||
string ret = freeswitchPINVOKE.switch_version_minor();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_version_micro() {
|
||||
string ret = freeswitchPINVOKE.switch_version_micro();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_version_revision() {
|
||||
string ret = freeswitchPINVOKE.switch_version_revision();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_version_revision_human() {
|
||||
string ret = freeswitchPINVOKE.switch_version_revision_human();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_version_full() {
|
||||
string ret = freeswitchPINVOKE.switch_version_full();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_version_full_human() {
|
||||
string ret = freeswitchPINVOKE.switch_version_full_human();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_loadable_module_init(switch_bool_t autoload) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_init((int)autoload);
|
||||
return ret;
|
||||
@@ -10712,6 +10747,27 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_debug_pool")]
|
||||
public static extern void switch_core_session_debug_pool(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_version_major")]
|
||||
public static extern string switch_version_major();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_version_minor")]
|
||||
public static extern string switch_version_minor();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_version_micro")]
|
||||
public static extern string switch_version_micro();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_version_revision")]
|
||||
public static extern string switch_version_revision();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_version_revision_human")]
|
||||
public static extern string switch_version_revision_human();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_version_full")]
|
||||
public static extern string switch_version_full();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_version_full_human")]
|
||||
public static extern string switch_version_full_human();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_set")]
|
||||
public static extern void switch_loadable_module_interface_module_name_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
@@ -35105,6 +35161,7 @@ namespace FreeSWITCH.Native {
|
||||
|
||||
public enum switch_rtp_flag_t {
|
||||
SWITCH_RTP_FLAG_NOBLOCK = 0,
|
||||
SWITCH_RTP_FLAG_DTMF_ON,
|
||||
SWITCH_RTP_FLAG_IO,
|
||||
SWITCH_RTP_FLAG_USE_TIMER,
|
||||
SWITCH_RTP_FLAG_RTCP_PASSTHRU,
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
*
|
||||
*/
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4142)
|
||||
#endif
|
||||
@@ -811,6 +810,7 @@ abyss_bool handler_hook(TSession * r)
|
||||
const char *uri = 0;
|
||||
TRequestInfo *info = 0;
|
||||
switch_event_t *evnt = 0; /* shortcut to stream.param_event */
|
||||
char v[256] = "";
|
||||
|
||||
if (!r || !(info = &r->requestInfo) || !(uri = info->uri)) {
|
||||
return FALSE;
|
||||
@@ -1008,7 +1008,8 @@ abyss_bool handler_hook(TSession * r)
|
||||
}
|
||||
|
||||
/* Generation of the server field */
|
||||
ResponseAddField(r, "Server", "FreeSWITCH-" SWITCH_VERSION_FULL "-mod_xml_rpc");
|
||||
switch_sprintf(v, sizeof(v), "FreeSWITCH-%s-mod_xml_rpc", switch_version_full());
|
||||
ResponseAddField(r, "Server", v);
|
||||
|
||||
if (html) {
|
||||
ResponseAddField(r, "Content-Type", "text/html");
|
||||
|
||||
Reference in new issue
Block a user