Skip to content

Commit

Permalink
Added feature to configure rtcp_mux for sip calls via resources gatew…
Browse files Browse the repository at this point in the history
…ay (2600hz#3888)

* Added feature to configure rtcp_mux for sip calls via resources gateway

* make apis for rtc_mux stepswitch feature
  • Loading branch information
sergey-safarov authored and k-anderson committed Jul 10, 2017
1 parent 901635c commit 4878c7a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions applications/crossbar/doc/ref/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Key | Description | Type | Default | Required
`gateways.[].from_uri_realm` | When formating SIP From on outbound requests this can be used to override the realm | `string()` | | `false`
`gateways.[].invite_format` | The format of the DID needed by the underlying hardware/gateway | `string('route' | 'username' | 'e164' | 'npan' | '1npan')` | `route` | `false`
`gateways.[].media.fax_option` | Is T.38 Supported? | `boolean()` | | `false`
`gateways.[].media.rtcp_mux` | RTCP protocol messages mixed with RTP data | `boolean()` | | `false`
`gateways.[].media` | The media parameters for the resource gateway | `object()` | | `false`
`gateways.[].password` | SIP authentication password | `string(0..32)` | | `false`
`gateways.[].port` | This resource gateway port | `integer()` | `5060` | `false`
Expand Down
1 change: 1 addition & 0 deletions applications/crossbar/doc/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Key | Description | Type | Default | Required
`gateways.[].from_uri_realm` | When formating SIP From on outbound requests this can be used to override the realm | `string()` | | `false`
`gateways.[].invite_format` | The format of the DID needed by the underlying hardware/gateway | `string('route' | 'username' | 'e164' | 'npan' | '1npan')` | `route` | `false`
`gateways.[].media.fax_option` | Is T.38 Supported? | `boolean()` | | `false`
`gateways.[].media.rtcp_mux` | RTCP protocol messages mixed with RTP data | `boolean()` | | `false`
`gateways.[].media` | The media parameters for the resource gateway | `object()` | | `false`
`gateways.[].password` | SIP authentication password | `string(0..32)` | | `false`
`gateways.[].port` | This resource gateway port | `integer()` | `5060` | `false`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@
"stepswitch.default_prefix": "stepswitch default prefix",
"stepswitch.default_progress_timeout": "stepswitch default progress timeout",
"stepswitch.default_route": "stepswitch default route",
"stepswitch.default_rtcp_mux": "RTCP protocol messages mixed with RTP data",
"stepswitch.default_suffix": "stepswitch default suffix",
"stepswitch.default_video_codecs": "stepswitch default video codecs",
"stepswitch.default_weight": "stepswitch default weight",
Expand Down
8 changes: 8 additions & 0 deletions applications/crossbar/priv/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -23180,6 +23180,10 @@
"fax_option": {
"description": "Is T.38 Supported?",
"type": "boolean"
},
"rtcp_mux": {
"description": "RTCP protocol messages mixed with RTP data",
"type": "boolean"
}
},
"type": "object"
Expand Down Expand Up @@ -28221,6 +28225,10 @@
"description": "stepswitch default route",
"type": "string"
},
"default_rtcp_mux": {
"description": "RTCP protocol messages mixed with RTP data",
"type": "string"
},
"default_suffix": {
"default": "",
"description": "stepswitch default suffix",
Expand Down
4 changes: 4 additions & 0 deletions applications/crossbar/priv/couchdb/schemas/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
"fax_option": {
"description": "Is T.38 Supported?",
"type": "boolean"
},
"rtcp_mux": {
"description": "RTCP protocol messages mixed with RTP data",
"type": "boolean"
}
},
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
"description": "stepswitch default route",
"type": "string"
},
"default_rtcp_mux": {
"description": "RTCP protocol messages mixed with RTP data",
"type": "string"
},
"default_suffix": {
"default": "",
"description": "stepswitch default suffix",
Expand Down
7 changes: 6 additions & 1 deletion applications/stepswitch/src/stepswitch_resources.erl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
kapps_config:get_integer(?SS_CONFIG_CAT, <<"default_progress_timeout">>, 8)).
-define(DEFAULT_WEIGHT,
kapps_config:get_integer(?SS_CONFIG_CAT, <<"default_weight">>, 3)).
-define(DEFAULT_RTCP_MUX, kapps_config:get_binary(?SS_CONFIG_CAT, <<"default_rtcp_mux">>)).

-record(gateway, {server :: api_binary()
,port :: api_integer()
Expand All @@ -94,6 +95,7 @@
,suffix = <<>> :: binary()
,codecs = [] :: ne_binaries()
,bypass_media = 'false' :: boolean()
,rtcp_mux = <<>> :: binary()
,caller_id_type = <<"external">> :: ne_binary()
,fax_option :: ne_binary() | boolean()
,sip_headers :: api_object()
Expand Down Expand Up @@ -656,6 +658,7 @@ gateway_to_endpoint(DestinationNumber
,#gateway{invite_format=InviteFormat
,caller_id_type=CallerIdType
,bypass_media=BypassMedia
,rtcp_mux=RTCP_MUX
,codecs=Codecs
,username=Username
,password=Password
Expand All @@ -672,9 +675,10 @@ gateway_to_endpoint(DestinationNumber
IsEmergency = gateway_emergency_resource(Gateway),
{CIDName, CIDNumber} = gateway_cid(OffnetJObj, IsEmergency, PrivacyMode),

CCVs = props:filter_empty(
CCVs = props:filter_undefined(
[{<<"Emergency-Resource">>, IsEmergency}
,{<<"Matched-Number">>, DestinationNumber}
,{<<"RTCP-MUX">>, RTCP_MUX}
| gateway_from_uri_settings(Gateway)
]),
kz_json:from_list(
Expand Down Expand Up @@ -1138,6 +1142,7 @@ gateway_from_jobj(JObj, #resrc{is_emergency=IsEmergency
,route = kz_json:get_ne_value(<<"route">>, JObj, ?DEFAULT_ROUTE)
,prefix = kz_json:get_binary_value(<<"prefix">>, JObj, ?DEFAULT_PREFIX)
,suffix = kz_json:get_binary_value(<<"suffix">>, JObj, ?DEFAULT_SUFFIX)
,rtcp_mux = kz_json:get_binary_value([<<"media">>, <<"rtcp_mux">>], JObj, ?DEFAULT_RTCP_MUX)
,caller_id_type = kz_json:get_ne_value(<<"caller_id_type">>, JObj, ?DEFAULT_CALLER_ID_TYPE)
,progress_timeout = kz_json:get_integer_value(<<"progress_timeout">>, JObj, ?DEFAULT_PROGRESS_TIMEOUT)
,endpoint_options = endpoint_options(JObj, EndpointType)
Expand Down

0 comments on commit 4878c7a

Please sign in to comment.