From 416f026f8cbdde933d629efe1bfc1cf13059f612 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Mon, 17 Sep 2012 21:26:00 +0200 Subject: [PATCH] FreeSWITCH: Add preprocessor constant for default callerid number SWITCH_DEFAULT_CLID_NUMBER and replace all occurrences in the FreeSWITCH codebase. Signed-off-by: Stefan Knoblich --- src/include/switch_types.h | 1 + src/mod/applications/mod_conference/mod_conference.c | 2 +- src/mod/endpoints/mod_rtmp/mod_rtmp.c | 2 +- src/mod/endpoints/mod_skinny/skinny_server.c | 4 ++-- src/switch_caller.c | 2 +- src/switch_ivr_originate.c | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 9ddadd1a3e..9fa47ac2b8 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -108,6 +108,7 @@ SWITCH_BEGIN_EXTERN_C #define SWITCH_SEQ_CLEARSCR SWITCH_SEQ_ESC SWITCH_SEQ_CLEARSCR_CHAR SWITCH_SEQ_HOME #endif #define SWITCH_DEFAULT_CLID_NAME "" +#define SWITCH_DEFAULT_CLID_NUMBER "0000000000" #define SWITCH_DEFAULT_DTMF_DURATION 2000 #define SWITCH_MIN_DTMF_DURATION 400 #define SWITCH_MAX_DTMF_DURATION 192000 diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index eb70d53ea2..0b1adcab57 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -8223,7 +8223,7 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c /* Caller ID Number */ if (zstr(caller_id_number)) { - caller_id_number = "0000000000"; + caller_id_number = SWITCH_DEFAULT_CLID_NUMBER; } if (!pool) { diff --git a/src/mod/endpoints/mod_rtmp/mod_rtmp.c b/src/mod/endpoints/mod_rtmp/mod_rtmp.c index d43ae73d01..0bdc4531de 100644 --- a/src/mod/endpoints/mod_rtmp/mod_rtmp.c +++ b/src/mod/endpoints/mod_rtmp/mod_rtmp.c @@ -874,7 +874,7 @@ switch_call_cause_t rtmp_session_create_call(rtmp_session_t *rsession, switch_co caller_profile = switch_caller_profile_new(pool, switch_str_nil(auth_user), dialplan, SWITCH_DEFAULT_CLID_NAME, - !zstr(auth_user) ? auth_user : "0000000000", + !zstr(auth_user) ? auth_user : SWITCH_DEFAULT_CLID_NUMBER, rsession->remote_address /* net addr */, NULL /* ani */, NULL /* anii */, diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index 95f7e6c83e..6c0e01f8a0 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -326,7 +326,7 @@ switch_status_t skinny_session_send_call_info(switch_core_session_t *session, li zstr((caller_party_number = switch_channel_get_variable(channel, "caller_id_number"))) && zstr((caller_party_number = switch_channel_get_variable_partner(channel, "effective_caller_id_number"))) && zstr((caller_party_number = switch_channel_get_variable_partner(channel, "caller_id_number")))) { - caller_party_number = "0000000000"; + caller_party_number = SWITCH_DEFAULT_CLID_NUMBER; } /* Called party */ if (zstr((called_party_name = switch_channel_get_variable(channel, "effective_callee_id_name"))) && @@ -340,7 +340,7 @@ switch_status_t skinny_session_send_call_info(switch_core_session_t *session, li zstr((called_party_number = switch_channel_get_variable_partner(channel, "effective_callee_id_number"))) && zstr((called_party_number = switch_channel_get_variable_partner(channel, "callee_id_number"))) && zstr((called_party_number = switch_channel_get_variable(channel, "destination_number")))) { - called_party_number = "0000000000"; + called_party_number = SWITCH_DEFAULT_CLID_NUMBER; } if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { call_type = SKINNY_INBOUND_CALL; diff --git a/src/switch_caller.c b/src/switch_caller.c index 021a901590..15da20bbe5 100644 --- a/src/switch_caller.c +++ b/src/switch_caller.c @@ -66,7 +66,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memor } if (zstr(caller_id_number)) { - caller_id_number = "0000000000"; + caller_id_number = SWITCH_DEFAULT_CLID_NUMBER; } profile_dup_clean(username, profile->username, pool); diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 23e4f857a2..0b02d2ba2c 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -2496,7 +2496,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess cid_name_override = SWITCH_DEFAULT_CLID_NAME; } if (!cid_num_override) { - cid_num_override = "0000000000"; + cid_num_override = SWITCH_DEFAULT_CLID_NUMBER; } new_profile = switch_caller_profile_new(oglobals.pool,