mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 16:58:35 +00:00
Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch
This commit is contained in:
commit
e7da47445a
@ -274,7 +274,15 @@
|
||||
|
||||
<extension name="Local_Extension_Skinny">
|
||||
<condition field="destination_number" expression="^(11[01][0-9])$">
|
||||
<action application="set" data="dialed_extension=$1"/>
|
||||
<action application="export" data="dialed_extension=$1"/>
|
||||
<action application="set" data="call_timeout=30"/>
|
||||
<action application="set" data="hangup_after_bridge=true"/>
|
||||
<action application="set" data="continue_on_fail=true"/>
|
||||
<action application="bridge" data="skinny/internal/${destination_number}"/>
|
||||
<action application="answer"/>
|
||||
<action application="sleep" data="1000"/>
|
||||
<action application="bridge" data="loopback/app=voicemail:default ${domain_name} ${dialed_extension}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
This context is used for skinny to match dialed number
|
||||
|
||||
The special applications:
|
||||
- skinny-route tells skinny to route the call
|
||||
- skinny-process tells skinny to process the call (route, set call forwarding, ...)
|
||||
- skinny-drop tells skinny to drop the call
|
||||
- skinny-wait tells skinny to wait 'data' seconds for more numbers before drop
|
||||
-->
|
||||
|
@ -1,7 +1,7 @@
|
||||
<include>
|
||||
<extension name="Demo">
|
||||
<condition field="destination_number" expression="^(9[0-9]{3})$">
|
||||
<action application="skinny-route"/>
|
||||
<action application="skinny-process"/>
|
||||
</condition>
|
||||
</extension>
|
||||
</include>
|
||||
|
@ -1,12 +1,12 @@
|
||||
<include>
|
||||
<extension name="Local_Extension">
|
||||
<condition field="destination_number" expression="^(10[01][0-9])$">
|
||||
<action application="skinny-route"/>
|
||||
<action application="skinny-process"/>
|
||||
</condition>
|
||||
</extension>
|
||||
<extension name="Local_Extension_Skinny">
|
||||
<condition field="destination_number" expression="^(11[01][0-9])$">
|
||||
<action application="skinny-route"/>
|
||||
<action application="skinny-process"/>
|
||||
</condition>
|
||||
</extension>
|
||||
</include>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<include>
|
||||
<extension name="External">
|
||||
<condition field="destination_number" expression="^(0[0-9]{10,})$">
|
||||
<action application="skinny-route"/>
|
||||
<action application="skinny-process"/>
|
||||
</condition>
|
||||
</extension>
|
||||
</include>
|
||||
|
@ -272,6 +272,7 @@ static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_r
|
||||
}
|
||||
|
||||
rtp_port = (switch_port_t)(long)*rtp_fd;
|
||||
*rtp_fd = NULL;
|
||||
|
||||
codec_req_leg->host_udp_port = rtp_port;
|
||||
|
||||
@ -307,6 +308,9 @@ static int sangoma_destroy_rtp(void *usr_priv, void *fd)
|
||||
{
|
||||
switch_memory_pool_t *sesspool;
|
||||
switch_rtp_t *rtp = fd;
|
||||
if (!rtp) {
|
||||
return 0;
|
||||
}
|
||||
sesspool = switch_rtp_get_private(rtp);
|
||||
switch_rtp_destroy(&rtp);
|
||||
switch_core_destroy_memory_pool(&sesspool);
|
||||
|
@ -673,12 +673,12 @@ switch_status_t channel_on_routing(switch_core_session_t *session)
|
||||
struct channel_on_routing_helper helper = {0};
|
||||
|
||||
if(switch_test_flag(tech_pvt, TFLAG_FORCE_ROUTE)) {
|
||||
action = SKINNY_ACTION_ROUTE;
|
||||
action = SKINNY_ACTION_PROCESS;
|
||||
} else {
|
||||
action = skinny_session_dest_match_pattern(session, &data);
|
||||
}
|
||||
switch(action) {
|
||||
case SKINNY_ACTION_ROUTE:
|
||||
case SKINNY_ACTION_PROCESS:
|
||||
skinny_profile_find_listener_by_device_name_and_instance(tech_pvt->profile,
|
||||
switch_channel_get_variable(channel, "skinny_device_name"),
|
||||
atoi(switch_channel_get_variable(channel, "skinny_device_instance")), &listener);
|
||||
|
@ -117,7 +117,7 @@ struct skinny_device_type_params {
|
||||
typedef struct skinny_device_type_params skinny_device_type_params_t;
|
||||
|
||||
typedef enum {
|
||||
SKINNY_ACTION_ROUTE,
|
||||
SKINNY_ACTION_PROCESS,
|
||||
SKINNY_ACTION_DROP,
|
||||
SKINNY_ACTION_WAIT
|
||||
} skinny_action_t;
|
||||
@ -174,12 +174,12 @@ typedef enum {
|
||||
|
||||
struct private_object {
|
||||
unsigned int flags;
|
||||
switch_mutex_t *flag_mutex;
|
||||
switch_frame_t read_frame;
|
||||
unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
||||
switch_core_session_t *session;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
switch_mutex_t *mutex;
|
||||
switch_mutex_t *flag_mutex;
|
||||
|
||||
/* identification */
|
||||
skinny_profile_t *profile;
|
||||
|
@ -238,8 +238,8 @@ found:
|
||||
|
||||
extension->current_application = extension->current_application->next;
|
||||
|
||||
if (!strcmp(current_application->application_name, "skinny-route")) {
|
||||
action = SKINNY_ACTION_ROUTE;
|
||||
if (!strcmp(current_application->application_name, "skinny-route") || !strcmp(current_application->application_name, "skinny-process")) {
|
||||
action = SKINNY_ACTION_PROCESS;
|
||||
} else if (!strcmp(current_application->application_name, "skinny-drop")) {
|
||||
action = SKINNY_ACTION_DROP;
|
||||
} else if (!strcmp(current_application->application_name, "skinny-wait")) {
|
||||
@ -290,8 +290,7 @@ switch_status_t skinny_session_process_dest(switch_core_session_t *session, list
|
||||
SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT, 0xffff);
|
||||
}
|
||||
} else {
|
||||
tech_pvt->caller_profile->destination_number = switch_core_strdup(tech_pvt->caller_profile->pool,
|
||||
dest);
|
||||
tech_pvt->caller_profile->destination_number = switch_core_strdup(tech_pvt->caller_profile->pool, dest);
|
||||
switch_set_flag_locked(tech_pvt, TFLAG_FORCE_ROUTE);
|
||||
}
|
||||
|
||||
@ -598,10 +597,8 @@ switch_status_t skinny_session_ring_out(switch_core_session_t *session, listener
|
||||
|
||||
send_start_tone(listener, SKINNY_TONE_ALERT, 0, line_instance, tech_pvt->call_id);
|
||||
skinny_line_set_state(listener, line_instance, tech_pvt->call_id, SKINNY_RING_OUT);
|
||||
send_select_soft_keys(listener, line_instance, tech_pvt->call_id,
|
||||
SKINNY_KEY_SET_RING_OUT, 0xffff);
|
||||
send_display_prompt_status(listener, 0, SKINNY_DISP_RING_OUT,
|
||||
line_instance, tech_pvt->call_id);
|
||||
send_select_soft_keys(listener, line_instance, tech_pvt->call_id, SKINNY_KEY_SET_RING_OUT, 0xffff);
|
||||
send_display_prompt_status(listener, 0, SKINNY_DISP_RING_OUT, line_instance, tech_pvt->call_id);
|
||||
skinny_session_send_call_info(session, listener, line_instance);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@ -1776,17 +1773,14 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
|
||||
switch(request->data.soft_key_event.event) {
|
||||
case SOFTKEY_REDIAL:
|
||||
status = skinny_create_incoming_session(listener, &line_instance, &session);
|
||||
|
||||
skinny_session_process_dest(session, listener, line_instance, "redial", '\0', 0);
|
||||
break;
|
||||
case SOFTKEY_NEWCALL:
|
||||
status = skinny_create_incoming_session(listener, &line_instance, &session);
|
||||
|
||||
skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0);
|
||||
break;
|
||||
case SOFTKEY_HOLD:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
status = skinny_session_hold_line(session, listener, line_instance);
|
||||
}
|
||||
@ -1800,30 +1794,25 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
|
||||
break;
|
||||
case SOFTKEY_BACKSPACE:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 1);
|
||||
}
|
||||
break;
|
||||
case SOFTKEY_ENDCALL:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
channel = switch_core_session_get_channel(session);
|
||||
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
|
||||
}
|
||||
break;
|
||||
case SOFTKEY_RESUME:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
status = skinny_session_unhold_line(session, listener, line_instance);
|
||||
}
|
||||
break;
|
||||
case SOFTKEY_ANSWER:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
status = skinny_session_answer(session, listener, line_instance);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user