]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5796 --resolve add cfwdall extension param for mod_skinny
authorNathan Neulinger <nneul@neulinger.org>
Tue, 17 Sep 2013 18:08:09 +0000 (13:08 -0500)
committerNathan Neulinger <nneul@neulinger.org>
Tue, 17 Sep 2013 18:08:09 +0000 (13:08 -0500)
src/mod/endpoints/mod_skinny/conf/skinny_profiles/internal.xml
src/mod/endpoints/mod_skinny/mod_skinny.c
src/mod/endpoints/mod_skinny/mod_skinny.h
src/mod/endpoints/mod_skinny/skinny_api.c
src/mod/endpoints/mod_skinny/skinny_server.c

index 74cb86701b763ddd68ad10c92557ef2b088981f6..b042c0553c858bbbc7a4a785a0db3717b08b59bf 100644 (file)
     <param name="ext-voicemail" value="vmain"/>
     <param name="ext-redial" value="redial"/>
     <!-- <param name="ext-meetme" value="conference"/> -->
+
+    <!-- usually place this one on the directory entry for a skinny phone and not global -->
+    <!-- <param name="ext-pickup" value="pickup"/> -->
+
+    <!-- <param name="ext-cfwdall" value="cfwdall"/> -->
   </settings>
   <soft-key-set-sets>
     <soft-key-set-set name="default">
index e329affb5c9e67d24ba3b417fb4db228823f146c..cc94f1129ffec3e72eeb65a74f9c29ad319df4c7 100644 (file)
@@ -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;
                                }
index df876d0894eee5ad06e4f6b7fdf6c8e9a3dbd395..c6e83804f7b297fe17b6130c5a420c050fe3fa2b 100644 (file)
@@ -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;
index db9338b0002721291c2b8d2e1b21c99df9739bbf..2d6c3b5275ba426266122655e7ff232373d95165 100644 (file)
@@ -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;
index 1dbf66b7b2c5301944839f14c5a6f8dff3b0c8bc..b586c96c9350495d12e593fc2002d4572bb5266e 100644 (file)
@@ -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);