Skip to content

Commit

Permalink
Route to "kazoo" endpoints in FreeSWITCH (2600hz#6123)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo authored and jamesaimonetti committed Nov 7, 2019
1 parent 9449261 commit 00be699
Show file tree
Hide file tree
Showing 30 changed files with 4,762 additions and 2,068 deletions.
3 changes: 2 additions & 1 deletion applications/callflow/src/cf_exe.erl
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,10 @@ update_actions(Action, Call) ->
%% @end
%%------------------------------------------------------------------------------
-spec spawn_cf_module(atom(), kz_json:object(), kapps_call:call()) -> kz_term:pid_ref().
spawn_cf_module(CFModule, Data, Call) ->
spawn_cf_module(CFModule, Data, Call0) ->
AMQPConsumer = kz_amqp_channel:consumer_pid(),
AMQPChannel = kz_amqp_channel:consumer_channel(),
Call = kapps_call:kvs_store('context-source', CFModule, Call0),
kz_process:spawn_monitor(fun cf_module_task/5, [CFModule, Data, Call, AMQPConsumer, AMQPChannel]).

-spec cf_module_task(atom(), kz_json:object(), kapps_call:call(), pid(), pid()) -> any().
Expand Down
5 changes: 3 additions & 2 deletions applications/callflow/src/module/cf_user.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ maybe_bridge(Data, Call, Endpoints) ->

-spec bridge(kz_json:object(), kapps_call:call(), kz_json:objects()) -> 'ok'.
bridge(Data, Call, Endpoints) ->
FailOnSingleReject = kz_json:is_true(<<"fail_on_single_reject">>, Data, 'undefined'),
FailOnSingleReject = kz_json:is_true(<<"fail_on_single_reject">>, Data, kapps_call:custom_channel_var(<<"Require-Fail-On-Single-Reject">>, Call)),
Timeout = kz_json:get_integer_value(<<"timeout">>, Data, ?DEFAULT_TIMEOUT_S),
Strategy = kz_json:get_ne_binary_value(<<"strategy">>, Data, <<"simultaneous">>),
IgnoreEarlyMedia = kz_endpoints:ignore_early_media(Endpoints),
IgnoreEarlyMedia = Strategy =:= <<"simultaneous">>
orelse kz_endpoints:ignore_early_media(Endpoints),
CustomSIPHeaders = kz_json:get_ne_json_value(<<"custom_sip_headers">>, Data),

lager:info("attempting ~b user devices with strategy ~s", [length(Endpoints), Strategy]),
Expand Down
63 changes: 63 additions & 0 deletions applications/crossbar/priv/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -12482,6 +12482,9 @@
"Bridge-Actions": {
"type": "object"
},
"Call-Context": {
"type": "string"
},
"Call-ID": {
"type": "string"
},
Expand Down Expand Up @@ -12731,6 +12734,9 @@
"kapi.dialplan.bridge_endpoint_headers": {
"description": "AMQP API for dialplan.bridge_endpoint_headers",
"properties": {
"Account-ID": {
"type": "string"
},
"Auth-Password": {
"type": "string"
},
Expand All @@ -12743,6 +12749,9 @@
"Bypass-Media": {
"type": "string"
},
"Call-Context": {
"type": "string"
},
"Callee-ID-Name": {
"type": "string"
},
Expand Down Expand Up @@ -12785,6 +12794,9 @@
"Endpoint-Delay": {
"type": "string"
},
"Endpoint-ID": {
"type": "string"
},
"Endpoint-Options": {
"type": "string"
},
Expand All @@ -12797,6 +12809,9 @@
"Endpoint-Type": {
"type": "string"
},
"Endpoint-URI": {
"type": "string"
},
"Failover": {
"type": "string"
},
Expand Down Expand Up @@ -22179,6 +22194,9 @@
"Bridge-Actions": {
"type": "object"
},
"Call-Context": {
"type": "string"
},
"Call-Restrictions-Enabled": {
"type": "string"
},
Expand Down Expand Up @@ -22436,6 +22454,9 @@
"Bridge-Actions": {
"type": "object"
},
"Call-Context": {
"type": "string"
},
"Call-Restrictions-Enabled": {
"type": "string"
},
Expand Down Expand Up @@ -22678,6 +22699,9 @@
"kapi.resource.originate_req_endpoint_headers": {
"description": "AMQP API for resource.originate_req_endpoint_headers",
"properties": {
"Account-ID": {
"type": "string"
},
"Auth-Password": {
"type": "string"
},
Expand All @@ -22690,6 +22714,9 @@
"Bypass-Media": {
"type": "string"
},
"Call-Context": {
"type": "string"
},
"Callee-ID-Name": {
"type": "string"
},
Expand Down Expand Up @@ -22732,6 +22759,9 @@
"Endpoint-Delay": {
"type": "string"
},
"Endpoint-ID": {
"type": "string"
},
"Endpoint-Options": {
"type": "string"
},
Expand All @@ -22744,6 +22774,9 @@
"Endpoint-Type": {
"type": "string"
},
"Endpoint-URI": {
"type": "string"
},
"Failover": {
"type": "string"
},
Expand Down Expand Up @@ -24093,6 +24126,9 @@
"Bridge-Actions": {
"type": "object"
},
"Call-Context": {
"type": "string"
},
"Call-ID": {
"type": "string"
},
Expand Down Expand Up @@ -24318,6 +24354,9 @@
"kapi.sms.message_endpoint_headers": {
"description": "AMQP API for sms.message_endpoint_headers",
"properties": {
"Account-ID": {
"type": "string"
},
"Auth-Password": {
"type": "string"
},
Expand All @@ -24330,6 +24369,9 @@
"Bypass-Media": {
"type": "string"
},
"Call-Context": {
"type": "string"
},
"Callee-ID-Name": {
"type": "string"
},
Expand Down Expand Up @@ -24372,6 +24414,9 @@
"Endpoint-Delay": {
"type": "string"
},
"Endpoint-ID": {
"type": "string"
},
"Endpoint-Options": {
"type": "string"
},
Expand All @@ -24384,6 +24429,9 @@
"Endpoint-Type": {
"type": "string"
},
"Endpoint-URI": {
"type": "string"
},
"Failover": {
"type": "string"
},
Expand Down Expand Up @@ -32680,6 +32728,11 @@
"system_config.kazoo_directory": {
"description": "Schema for kazoo_directory system_config",
"properties": {
"default_ignore_completed_elsewhere": {
"default": true,
"description": "kazoo_directory default_ignore_completed_elsewhere",
"type": "boolean"
},
"restrict_to_known_types": {
"default": false,
"description": "kazoo_directory restrict_to_known_types",
Expand All @@ -32691,6 +32744,11 @@
"system_config.kazoo_endpoint": {
"description": "Schema for kazoo_endpoint system_config",
"properties": {
"build_metaflows": {
"default": false,
"description": "kazoo_endpoint build_metaflows",
"type": "boolean"
},
"custom_sip_interface": {
"description": "kazoo_endpoint custom sip interface",
"type": "string"
Expand All @@ -32713,6 +32771,11 @@
"description": "kazoo_endpoint default ignore completed elsewhere",
"type": "boolean"
},
"endpoint_module": {
"default": "kz_endpoint_v5",
"description": "kazoo_endpoint endpoint_module",
"type": "string"
},
"restrict_to_known_types": {
"default": false,
"description": "kazoo_endpoint restrict to known types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
"Bridge-Actions": {
"type": "object"
},
"Call-Context": {
"type": "string"
},
"Call-ID": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"_id": "kapi.dialplan.bridge_endpoint_headers",
"description": "AMQP API for dialplan.bridge_endpoint_headers",
"properties": {
"Account-ID": {
"type": "string"
},
"Auth-Password": {
"type": "string"
},
Expand All @@ -15,6 +18,9 @@
"Bypass-Media": {
"type": "string"
},
"Call-Context": {
"type": "string"
},
"Callee-ID-Name": {
"type": "string"
},
Expand Down Expand Up @@ -57,6 +63,9 @@
"Endpoint-Delay": {
"type": "string"
},
"Endpoint-ID": {
"type": "string"
},
"Endpoint-Options": {
"type": "string"
},
Expand All @@ -69,6 +78,9 @@
"Endpoint-Type": {
"type": "string"
},
"Endpoint-URI": {
"type": "string"
},
"Failover": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"Bridge-Actions": {
"type": "object"
},
"Call-Context": {
"type": "string"
},
"Call-Restrictions-Enabled": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"Bridge-Actions": {
"type": "object"
},
"Call-Context": {
"type": "string"
},
"Call-Restrictions-Enabled": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"_id": "kapi.resource.originate_req_endpoint_headers",
"description": "AMQP API for resource.originate_req_endpoint_headers",
"properties": {
"Account-ID": {
"type": "string"
},
"Auth-Password": {
"type": "string"
},
Expand All @@ -15,6 +18,9 @@
"Bypass-Media": {
"type": "string"
},
"Call-Context": {
"type": "string"
},
"Callee-ID-Name": {
"type": "string"
},
Expand Down Expand Up @@ -57,6 +63,9 @@
"Endpoint-Delay": {
"type": "string"
},
"Endpoint-ID": {
"type": "string"
},
"Endpoint-Options": {
"type": "string"
},
Expand All @@ -69,6 +78,9 @@
"Endpoint-Type": {
"type": "string"
},
"Endpoint-URI": {
"type": "string"
},
"Failover": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"Bridge-Actions": {
"type": "object"
},
"Call-Context": {
"type": "string"
},
"Call-ID": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"_id": "kapi.sms.message_endpoint_headers",
"description": "AMQP API for sms.message_endpoint_headers",
"properties": {
"Account-ID": {
"type": "string"
},
"Auth-Password": {
"type": "string"
},
Expand All @@ -15,6 +18,9 @@
"Bypass-Media": {
"type": "string"
},
"Call-Context": {
"type": "string"
},
"Callee-ID-Name": {
"type": "string"
},
Expand Down Expand Up @@ -57,6 +63,9 @@
"Endpoint-Delay": {
"type": "string"
},
"Endpoint-ID": {
"type": "string"
},
"Endpoint-Options": {
"type": "string"
},
Expand All @@ -69,6 +78,9 @@
"Endpoint-Type": {
"type": "string"
},
"Endpoint-URI": {
"type": "string"
},
"Failover": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"_id": "system_config.kazoo_directory",
"description": "Schema for kazoo_directory system_config",
"properties": {
"default_ignore_completed_elsewhere": {
"default": true,
"description": "kazoo_directory default_ignore_completed_elsewhere",
"type": "boolean"
},
"restrict_to_known_types": {
"default": false,
"description": "kazoo_directory restrict_to_known_types",
Expand Down
Loading

0 comments on commit 00be699

Please sign in to comment.