mod_rayo CPA dtmf detection added
This commit is contained in:
parent
da4690f60d
commit
5b2799284b
|
@ -26,6 +26,13 @@
|
|||
<!-- Define CPA detectors. These are sources for Rayo CPA signal events -->
|
||||
<!-- Detectors must fire an event that can be translated by mod_rayo into a CPA signal event -->
|
||||
<cpa>
|
||||
<!-- map DTMF events to CPA -->
|
||||
<detector name="core_dtmf_event">
|
||||
<event class="DTMF" value-header="DTMF-Digit" duration-header="DTMF-Duration">
|
||||
<signal-type value="dtmf"/>
|
||||
</event>
|
||||
</detector>
|
||||
|
||||
<!-- map mod_spandsp fax detector to the Rayo CPA events. Fires DETECTED_FAX_* event once and quits. -->
|
||||
<detector name="mod_spandsp_fax_ced">
|
||||
<start application="spandsp_start_fax_detect" data="event 'Event-Name=CUSTOM,Event-Subclass=DETECTED_FAX_CED' 500 ced"/>
|
||||
|
|
|
@ -26,6 +26,13 @@
|
|||
<!-- Define CPA detectors. These are sources for Rayo CPA signal events -->
|
||||
<!-- Detectors must fire an event that can be translated by mod_rayo into a CPA signal event -->
|
||||
<cpa>
|
||||
<!-- map DTMF events to CPA -->
|
||||
<detector name="core_dtmf_event">
|
||||
<event class="DTMF" value-header="DTMF-Digit" duration-header="DTMF-Duration">
|
||||
<signal-type value="dtmf"/>
|
||||
</event>
|
||||
</detector>
|
||||
|
||||
<!-- map mod_spandsp fax detector to the Rayo CPA events. Fires DETECTED_FAX_* event once and quits. -->
|
||||
<detector name="mod_spandsp_fax_ced">
|
||||
<start application="spandsp_start_fax_detect" data="event 'Event-Name=CUSTOM,Event-Subclass=DETECTED_FAX_CED' 500 ced"/>
|
||||
|
|
|
@ -79,8 +79,13 @@ struct rayo_cpa_detector_state {
|
|||
int rayo_cpa_detector_start(const char *call_uuid, const char *signal_ns, const char **error_detail)
|
||||
{
|
||||
struct rayo_cpa_detector *detector = switch_core_hash_find(globals.detectors, signal_ns);
|
||||
switch_core_session_t *session;
|
||||
if (detector) {
|
||||
switch_core_session_t *session = switch_core_session_locate(call_uuid);
|
||||
if (zstr(detector->start_app)) {
|
||||
/* nothing to do */
|
||||
return 1;
|
||||
}
|
||||
session = switch_core_session_locate(call_uuid);
|
||||
if (session) {
|
||||
struct rayo_cpa_detector_state *detector_state = switch_channel_get_private(switch_core_session_get_channel(session), detector->uuid);
|
||||
if (detector_state) {
|
||||
|
@ -114,8 +119,13 @@ int rayo_cpa_detector_start(const char *call_uuid, const char *signal_ns, const
|
|||
void rayo_cpa_detector_stop(const char *call_uuid, const char *signal_ns)
|
||||
{
|
||||
struct rayo_cpa_detector *detector = switch_core_hash_find(globals.detectors, signal_ns);
|
||||
switch_core_session_t *session;
|
||||
if (detector) {
|
||||
switch_core_session_t *session = switch_core_session_locate(call_uuid);
|
||||
if (zstr(detector->stop_app)) {
|
||||
/* nothing to do */
|
||||
return;
|
||||
}
|
||||
session = switch_core_session_locate(call_uuid);
|
||||
if (session) {
|
||||
struct rayo_cpa_detector_state *detector_state = switch_channel_get_private(switch_core_session_get_channel(session), detector->uuid);
|
||||
if (detector_state) {
|
||||
|
|
Loading…
Reference in New Issue