]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5662 --resolve implement call pickup group functionality in mod_skinny. Currently...
authorNathan Neulinger <nneul@neulinger.org>
Fri, 2 Aug 2013 19:12:03 +0000 (14:12 -0500)
committerNathan Neulinger <nneul@neulinger.org>
Fri, 2 Aug 2013 19:12:03 +0000 (14:12 -0500)
src/mod/endpoints/mod_skinny/conf/directory/default/skinny-example.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 8b8fad5812fc789611d7d963dac75905e884b9cf..c51b5ce9cfde684cb8650baa798756bc8a067263 100644 (file)
@@ -8,6 +8,14 @@
     <param name="ext-redial" value="redial">
     <param name="ext-meetme" value="conference">
     -->
+
+    <!-- if you define an extension that runs 'pickup' application with 'key' as the data
+        this will cause the PickUp softkey to route to that extension. Combine with adding ",pickup/key"
+        to bridge call to implement PickUp groups -->
+
+    <!--
+    <param name="ext-pickup" value="pickup-key">
+    -->
     <param name="foo" value="bar"/>
    </params>
    <skinny>
index 18b0f3c3f534d08683099d331201d9f8cf9e79f0..ab4398a8986e40dbaf356824185e1828d97a36cb 100644 (file)
@@ -172,6 +172,7 @@ switch_status_t skinny_profile_dump(const skinny_profile_t *profile, switch_stre
        stream->write_function(stream, "Ext-Voicemail     \t%s\n", profile->ext_voicemail);
        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, "%s\n", line);
 
        return SWITCH_STATUS_SUCCESS;
@@ -1869,6 +1870,10 @@ switch_status_t skinny_profile_set(skinny_profile_t *profile, const char *var, c
                if (!profile->ext_meetme || strcmp(val, profile->ext_meetme)) {
                        profile->ext_meetme = switch_core_strdup(profile->pool, val);
                }
+       } else if (!strcasecmp(var, "ext-pickup")) {
+               if (!profile->ext_pickup || strcmp(val, profile->ext_pickup)) {
+                       profile->ext_pickup = switch_core_strdup(profile->pool, val);
+               }
        } else {
                return SWITCH_STATUS_FALSE;
        }
@@ -1965,6 +1970,10 @@ static switch_status_t load_skinny_config(void)
                                        skinny_profile_set(profile, "ext-meetme", "conference");
                                }
 
+                               if (!profile->ext_pickup) {
+                                       skinny_profile_set(profile, "ext-pickup", "pickup");
+                               }
+
                                if (profile->port == 0) {
                                        profile->port = 2000;
                                }
index 7c9dcdb314b0f6559eee830272806ee9ca6826dd..df876d0894eee5ad06e4f6b7fdf6c8e9a3dbd395 100644 (file)
@@ -124,6 +124,7 @@ struct skinny_profile {
        char *ext_voicemail;
        char *ext_redial;
        char *ext_meetme;
+       char *ext_pickup;
        /* db */
        char *dbname;
        char *odbc_dsn;
@@ -192,6 +193,7 @@ struct listener {
        char *ext_voicemail;
        char *ext_redial;
        char *ext_meetme;
+       char *ext_pickup;
 };
 
 typedef struct listener listener_t;
index 94318c8de05afb66a4157739a4dcbe1893d780a4..db9338b0002721291c2b8d2e1b21c99df9739bbf 100644 (file)
@@ -234,6 +234,7 @@ static switch_status_t skinny_api_list_settings(const char *line, const char *cu
        switch_console_push_match(&my_matches, "ext-voicemail");
        switch_console_push_match(&my_matches, "ext-redial");
        switch_console_push_match(&my_matches, "ext-meetme");
+       switch_console_push_match(&my_matches, "ext-pickup");
 
        if (my_matches) {
                *matches = my_matches;
index d648cac7e51ae9d116157fffc826fe54b2015b1c..b30a0004d60851f4fa9605e628473bdee6d95341 100644 (file)
@@ -1046,6 +1046,10 @@ switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *r
                                        if (!listener->ext_meetme || strcmp(value,listener->ext_meetme)) {
                                                listener->ext_meetme = switch_core_strdup(profile->pool, value);
                                        }
+                               } else if (!strcasecmp(name, "ext-pickup")) {
+                                       if (!listener->ext_pickup || strcmp(value,listener->ext_pickup)) {
+                                               listener->ext_pickup = switch_core_strdup(profile->pool, value);
+                                       }
                                }
                        }
                }
@@ -1949,6 +1953,12 @@ 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_meetme, listener->profile->ext_meetme), '\0', 0);
                        break;
+               case SOFTKEY_CALLPICKUP:
+               case SOFTKEY_GRPCALLPICKUP:
+                       skinny_create_incoming_session(listener, &line_instance, &session);
+                       skinny_session_process_dest(session, listener, line_instance, 
+                               empty_null2(listener->ext_pickup, listener->profile->ext_pickup), '\0', 0);
+                       break;
                default:
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
                                        "Unknown SoftKeyEvent type: %d.\n", request->data.soft_key_event.event);