]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6605 add support for automatic dialing when off-hook/ringdown --resolve
authorNathan Neulinger <nneul@neulinger.org>
Wed, 18 Jun 2014 13:40:20 +0000 (08:40 -0500)
committerNathan Neulinger <nneul@neulinger.org>
Wed, 18 Jun 2014 13:40:28 +0000 (08:40 -0500)
src/mod/endpoints/mod_skinny/conf/directory/default/skinny-example.xml
src/mod/endpoints/mod_skinny/mod_skinny.h
src/mod/endpoints/mod_skinny/skinny_server.c

index c51b5ce9cfde684cb8650baa798756bc8a067263..9227a7e7f7637d707be8470b26bedddc7c601d3d 100644 (file)
@@ -7,6 +7,7 @@
     <param name="ext-voicemail" value="voicemail">
     <param name="ext-redial" value="redial">
     <param name="ext-meetme" value="conference">
+    <param name="ext-autodial" value="operator">
     -->
 
     <!-- if you define an extension that runs 'pickup' application with 'key' as the data
index 09641452ce1db140de19d3472dd1c4e257fcbf5d..60616020cf3839ca44108ce9ba8757a6cf4454d3 100644 (file)
@@ -203,6 +203,7 @@ struct listener {
        char *ext_meetme;
        char *ext_pickup;
        char *ext_cfwdall;
+       char *ext_autodial;
 };
 
 typedef struct listener listener_t;
index af73b1978a656274a4a4d714e5f0b6138c5cd73d..897e57fd45a05f467c228fb78ecd218eb092ba42 100644 (file)
@@ -285,7 +285,15 @@ switch_status_t skinny_session_process_dest(switch_core_session_t *session, list
        channel = switch_core_session_get_channel(session);
        tech_pvt = switch_core_session_get_private(session);
 
-       if (!dest) {
+       // get listener profile setting for ringdown/autodial
+       // if initial offhook - and we have a ringdown/autodial configured, just dial it in one shot
+       if (!dest && append_dest == '\0' && listener->ext_autodial ) {
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, 
+                       "triggering auto dial to (%s)\n", listener->ext_autodial);
+
+               tech_pvt->caller_profile->destination_number = switch_core_strdup(tech_pvt->caller_profile->pool, listener->ext_autodial);
+               switch_set_flag_locked(tech_pvt, TFLAG_FORCE_ROUTE);
+       } else if (!dest) {
                if (strlen(tech_pvt->caller_profile->destination_number) == 0) {/* no digit yet */
                        send_start_tone(listener, SKINNY_TONE_DIALTONE, 0, line_instance, tech_pvt->call_id);
                }
@@ -1128,6 +1136,10 @@ switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *r
                                        if (!listener->ext_cfwdall || strcmp(value,listener->ext_cfwdall)) {
                                                listener->ext_cfwdall = switch_core_strdup(profile->pool, value);
                                        }
+                               } else if (!strcasecmp(name, "ext-autodial")) {
+                                       if (!listener->ext_autodial || strcmp(value,listener->ext_autodial)) {
+                                               listener->ext_autodial = switch_core_strdup(profile->pool, value);
+                                       }
                                }
                        }
                }