From 1fa0c8b31289b46b8d6528279697776d5b0b7fec Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Tue, 17 Sep 2013 13:08:09 -0500 Subject: [PATCH] FS-5796 --resolve add cfwdall extension param for mod_skinny --- .../mod_skinny/conf/skinny_profiles/internal.xml | 5 +++++ src/mod/endpoints/mod_skinny/mod_skinny.c | 9 +++++++++ src/mod/endpoints/mod_skinny/mod_skinny.h | 2 ++ src/mod/endpoints/mod_skinny/skinny_api.c | 1 + src/mod/endpoints/mod_skinny/skinny_server.c | 9 +++++++++ 5 files changed, 26 insertions(+) diff --git a/src/mod/endpoints/mod_skinny/conf/skinny_profiles/internal.xml b/src/mod/endpoints/mod_skinny/conf/skinny_profiles/internal.xml index 74cb86701b..b042c0553c 100644 --- a/src/mod/endpoints/mod_skinny/conf/skinny_profiles/internal.xml +++ b/src/mod/endpoints/mod_skinny/conf/skinny_profiles/internal.xml @@ -15,6 +15,11 @@ + + + + + diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c index e329affb5c..cc94f1129f 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.c +++ b/src/mod/endpoints/mod_skinny/mod_skinny.c @@ -173,6 +173,7 @@ switch_status_t skinny_profile_dump(const skinny_profile_t *profile, switch_stre stream->write_function(stream, "Ext-Redial \t%s\n", profile->ext_redial); stream->write_function(stream, "Ext-MeetMe \t%s\n", profile->ext_meetme); stream->write_function(stream, "Ext-PickUp \t%s\n", profile->ext_pickup); + stream->write_function(stream, "Ext-CFwdAll \t%s\n", profile->ext_cfwdall); stream->write_function(stream, "%s\n", line); return SWITCH_STATUS_SUCCESS; @@ -1939,6 +1940,10 @@ switch_status_t skinny_profile_set(skinny_profile_t *profile, const char *var, c if (!profile->ext_pickup || strcmp(val, profile->ext_pickup)) { profile->ext_pickup = switch_core_strdup(profile->pool, val); } + } else if (!strcasecmp(var, "ext-cfwdall")) { + if (!profile->ext_cfwdall || strcmp(val, profile->ext_cfwdall)) { + profile->ext_cfwdall = switch_core_strdup(profile->pool, val); + } } else { return SWITCH_STATUS_FALSE; } @@ -2039,6 +2044,10 @@ static switch_status_t load_skinny_config(void) skinny_profile_set(profile, "ext-pickup", "pickup"); } + if (!profile->ext_cfwdall) { + skinny_profile_set(profile, "ext-pickup", "cfwdall"); + } + if (profile->port == 0) { profile->port = 2000; } diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.h b/src/mod/endpoints/mod_skinny/mod_skinny.h index df876d0894..c6e83804f7 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.h +++ b/src/mod/endpoints/mod_skinny/mod_skinny.h @@ -125,6 +125,7 @@ struct skinny_profile { char *ext_redial; char *ext_meetme; char *ext_pickup; + char *ext_cfwdall; /* db */ char *dbname; char *odbc_dsn; @@ -194,6 +195,7 @@ struct listener { char *ext_redial; char *ext_meetme; char *ext_pickup; + char *ext_cfwdall; }; typedef struct listener listener_t; diff --git a/src/mod/endpoints/mod_skinny/skinny_api.c b/src/mod/endpoints/mod_skinny/skinny_api.c index db9338b000..2d6c3b5275 100644 --- a/src/mod/endpoints/mod_skinny/skinny_api.c +++ b/src/mod/endpoints/mod_skinny/skinny_api.c @@ -235,6 +235,7 @@ static switch_status_t skinny_api_list_settings(const char *line, const char *cu switch_console_push_match(&my_matches, "ext-redial"); switch_console_push_match(&my_matches, "ext-meetme"); switch_console_push_match(&my_matches, "ext-pickup"); + switch_console_push_match(&my_matches, "ext-cfwdall"); if (my_matches) { *matches = my_matches; diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index 1dbf66b7b2..b586c96c93 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -1097,6 +1097,10 @@ switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *r if (!listener->ext_pickup || strcmp(value,listener->ext_pickup)) { listener->ext_pickup = switch_core_strdup(profile->pool, value); } + } else if (!strcasecmp(name, "ext-cfwdall")) { + if (!listener->ext_cfwdall || strcmp(value,listener->ext_cfwdall)) { + listener->ext_cfwdall = switch_core_strdup(profile->pool, value); + } } } } @@ -2001,6 +2005,11 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn skinny_session_process_dest(session, listener, line_instance, empty_null2(listener->ext_pickup, listener->profile->ext_pickup), '\0', 0); break; + case SOFTKEY_CFWDALL: + skinny_create_incoming_session(listener, &line_instance, &session); + skinny_session_process_dest(session, listener, line_instance, + empty_null2(listener->ext_cfwdall, listener->profile->ext_cfwdall), '\0', 0); + break; default: switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unknown SoftKeyEvent type: %d.\n", request->data.soft_key_event.event);