Ringback (sponsored by Front Logic)

This addition lets you set artifical ringback on a channel
that is waiting for an originated call to be answered.

the syntax is 

<action application="set" data="ringback=[data]"/>

where data is either the full path to an audio file
or a teletone generation script..


syntax of teletone scripts

LEGEND:

0-9,a-d,*,# (standard dtmf tones)

variables: c,r,d,v,>,<,+,w,l,L,%

c (channels)        - Sets the number of channels.
r (rate)            - Sets the sample rate.
d (duration)        - Sets the default tone duration.
v (volume)          - Sets the default volume.
> (decrease vol)    - factor to decrease volume by per frame (0 for even decrease across duration).
< (increase vol)    - factor to increase volume by per frame (0 for even increase across duration).
+ (step)            - factor to step by used by < and >.
w (wait)            - default silence after each tone.
l (loops)           - number of times to repeat each tone in the script.
L (LOOPS)           - number of times to repeat the the whole script.
% (manual tone)     - a generic tone specified by a duration, a wait and a list of frequencies.

standard tones can have custom duration per use with the () modifier
7(1000, 500) to generate DTMF 7 for 1 second then pause .5 seconds

EXAMPLES

UK Ring Tone [400+450 hz on for 400ms off for 200ms then 400+450 hz on for 400ms off for 2200ms]
%(400,200,400,450);%(400,2200,400,450)

US Ring Tone [440+480 hz on for 2000ms off for 4000ms]
%(2000,4000,440,480)

ATT BONG [volume level 4000, even decay, step by 2, # key for 60ms with no wait, volume level 2000, 350+440hz {us dialtone} for 940ms
v=4000;>=0;+=2;#(60,0);v=2000;%(940,0,350,440)

SIT Tone 913.8 hz for 274 ms with no wait, 1370.6 hz for 274 ms with no wait, 1776.7 hz for 380ms with no wait
%(274,0,913.8);%(274,0,1370.6);%(380,0,1776.7)

ATTN TONE (phone's off the hook!) 1400+2060+2450+2600 hz for 100ms with 100ms wait
%(100,100,1400,2060,2450,2600)



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3408 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2006-11-19 01:05:06 +00:00
1 parent 0984933c36
commit d7baa16132
12 files changed
+273 -50

No files matched your search

+20
View File
@@ -120,6 +120,7 @@ struct switch_core_runtime {
uint32_t session_id;
apr_pool_t *memory_pool;
switch_hash_t *session_table;
switch_hash_t *global_vars;
switch_mutex_t *session_table_mutex;
#ifdef CRASH_PROT
switch_hash_t *stack_table;
@@ -558,6 +559,11 @@ SWITCH_DECLARE(void) switch_core_session_rwunlock(switch_core_session_t *session
}
SWITCH_DECLARE(char *) switch_core_get_variable(char *varname)
{
return (char *) switch_core_hash_find(runtime.global_vars, varname);
}
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(char *uuid_str)
{
switch_core_session_t *session;
@@ -3849,6 +3855,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(char *console, const char **err
return SWITCH_STATUS_MEMERR;
}
switch_core_hash_init(&runtime.global_vars, runtime.memory_pool);
if (switch_xml_init(runtime.memory_pool, err) != SWITCH_STATUS_SUCCESS) {
apr_terminate();
return SWITCH_STATUS_MEMERR;
@@ -3868,6 +3876,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(char *console, const char **err
}
}
}
if ((settings = switch_xml_child(cfg, "variables"))) {
for (param = switch_xml_child(settings, "variable"); param; param = param->next) {
char *var = (char *) switch_xml_attr_soft(param, "name");
char *val = (char *) switch_xml_attr_soft(param, "value");
char *varr = NULL, *vall = NULL;
varr = switch_core_strdup(runtime.memory_pool, var);
vall = switch_core_strdup(runtime.memory_pool, val);
switch_core_hash_insert(runtime.global_vars, varr, vall);
}
}
switch_xml_free(xml);
}