shimaore/esl

how can i catch CUSTOM event

Opened this issue · 2 comments

Event-Subclass: google_transcribe%3A%3Atranscription
Event-Name: CUSTOM
Core-UUID: 45f427c0-01c0-4ae5-a133-e3d52bb9ff9c
FreeSWITCH-Hostname: debian-s-2vcpu-4gb-sgp1-01
FreeSWITCH-Switchname: debian-s-2vcpu-4gb-sgp1-01
FreeSWITCH-IPv4: 165.232.161.156
FreeSWITCH-IPv6: %3A%3A1
Event-Date-Local: 2021-06-01%2013%3A49%3A24
Event-Date-GMT: Tue,%2001%20Jun%202021%2013%3A49%3A24%20GMT
Event-Date-Timestamp: 1622555364406124
Event-Calling-File: mod_google_transcribe.c
Event-Calling-Function: responseHandler
Event-Calling-Line-Number: 67
Event-Sequence: 24625
Channel-State: CS_EXECUTE
Channel-Call-State: ACTIVE
Channel-State-Number: 4
Channel-Name: sofia/internal/1002%40165.232.161.156%3A13556
Unique-ID: 90b4f6bc-2c33-4ec1-b989-a9f211b331d3
Call-Direction: inbound
Presence-Call-Direction: inbound
Channel-HIT-Dialplan: true
Channel-Presence-ID: 1002%40165.232.161.156
Channel-Call-UUID: 90b4f6bc-2c33-4ec1-b989-a9f211b331d3
Answer-State: answered
Channel-Read-Codec-Name: PCMA

i try on fs_cli console by /event CUSTOM google_transcribe::transcription, it can return result,but

this.onceAsync('CUSTOM google_transcribe::transcription').then( function () {
util.log('google_transcribe');
});

this.event_json('CUSTOM google_transcribe::transcription');
it can't work

Please check https://github.com/shimaore/esl/issues/56#issuecomment-851045691#35
But basically you need to subscribe for the CUSTOM event then filter on the Event-Subclass.