发送DTMF相关配置
在sip profile的配置里面:
<param name="dtmf-type" value="info"/>
or
<param name="dtmf-type" value="rfc2833"/>
or
<param name="dtmf-type" value="none"/>
这个参数用于该profile对外协商的时候,可以提供的dtmf类型。
接收DTMF相关
- 上述event格式和被叫fs的dtmf模式(dtmf/info/inbound)无关,是由来电里的dtmf格式决定:
1.1 如果inboud call的dtmf是rfc2833模式,则接收端的fs产生的Event-Name:DTMF
1.2 如果inboud call的dtmf是info模式, 则接收端的fs产生的Event-Name:RECV_INFO
1.3 如果inboud call的dtmf是inbound模式,则接收端fs产生的Event-Name: DTMF(和1.1的不同见上面示例) - 在inband dtmf模式的时候,拨号计划要启动start_dtmf,才可以解析出dtmf信号
DTMF相关事件
通过info收到的dtmf
Event-Name: RECV_INFO
Core-UUID: fb33a974-82bd-11e9-9e45-b3355e160db7
FreeSWITCH-Hostname: fstest
FreeSWITCH-Switchname: fstest
FreeSWITCH-IPv4: 172.17.0.9
FreeSWITCH-IPv6: %3A%3A1
Event-Date-Local: 2019-06-03%2016%3A37%3A11
Event-Date-GMT: Mon,%2003%20Jun%202019%2008%3A37%3A11%20GMT
Event-Date-Timestamp: 1559551031188496
Event-Calling-File: sofia.c
Event-Calling-Function: create_info_event
Event-Calling-Line-Number: 9224
Event-Sequence: 165591472
SIP-Content-Type: application/dtmf-relay
SIP-From-User: 0000000000
SIP-From-Host: 172.17.0.11
SIP-To-User: 18652003060
SIP-To-Host: 172.17.0.9
SIP-Contact-User: mod_sofia
SIP-Contact-Host: 172.17.0.11
Channel-State: CS_EXECUTE
Channel-Call-State: EARLY
Channel-State-Number: 4
Channel-Name: sofia/internal1/0000000000%40172.17.0.11
Unique-ID: c08fb2ca-85da-11e9-ae54-b3355e160db7
Call-Direction: inbound
Presence-Call-Direction: inbound
Channel-HIT-Dialplan: true
Channel-Presence-ID: 0000000000%40172.17.0.11
Channel-Call-UUID: c08fb2ca-85da-11e9-ae54-b3355e160db7
Answer-State: early
Channel-Read-Codec-Name: PCMU
Channel-Read-Codec-Rate: 8000
Channel-Read-Codec-Bit-Rate: 64000
Channel-Write-Codec-Name: PCMU
Channel-Write-Codec-Rate: 8000
Channel-Write-Codec-Bit-Rate: 64000
Content-Length: 24
Signal=9
Duration=250通过2833收到的事件
Event-Name: DTMF
Channel-State: CS_EXCHANGE_MEDIA
Channel-Call-State: ACTIVE
Channel-State-Number: 5
Channel-Name: sofia/external/18721861839
Unique-ID: bb264dc6-85cb-11e9-99e8-8749f74e398f
Call-Direction: outbound
Presence-Call-Direction: outbound
Channel-HIT-Dialplan: false
Channel-Call-UUID: bb25f4ca-85cb-11e9-99de-8749f74e398f
Answer-State: answered
Channel-Read-Codec-Name: PCMA
Channel-Read-Codec-Rate: 8000
Channel-Read-Codec-Bit-Rate: 64000
Channel-Write-Codec-Name: PCMA
Channel-Write-Codec-Rate: 8000
Channel-Write-Codec-Bit-Rate: 64000
DTMF-Digit: 2
DTMF-Duration: 640
DTMF-Source: RTP通过inband收到的事件
Event-Name: DTMF
Core-UUID: fb33a974-82bd-11e9-9e45-b3355e160db7
FreeSWITCH-Hostname: fstest
FreeSWITCH-Switchname: fstest
FreeSWITCH-IPv4: 172.17.0.9
FreeSWITCH-IPv6: %3A%3A1
Event-Date-Local: 2019-06-03%2018%3A24%3A58
Event-Date-GMT: Mon,%2003%20Jun%202019%2010%3A24%3A58%20GMT
Event-Date-Timestamp: 1559557498168495
Event-Calling-File: switch_channel.c
Event-Calling-Function: switch_channel_dequeue_dtmf
Event-Calling-Line-Number: 660
Event-Sequence: 165592741
Channel-State: CS_EXECUTE
Channel-Call-State: ACTIVE
Channel-State-Number: 4
Channel-Name: sofia/internal1/0000000000%40172.17.0.11
Unique-ID: d015af74-85e9-11e9-aea5-b3355e160db7
Call-Direction: inbound
Presence-Call-Direction: inbound
Channel-HIT-Dialplan: true
Channel-Presence-ID: 0000000000%40172.17.0.11
Channel-Call-UUID: d015af74-85e9-11e9-aea5-b3355e160db7
Answer-State: answered
Channel-Read-Codec-Name: PCMU
Channel-Read-Codec-Rate: 8000
DTMF-Digit: 3
DTMF-Duration: 480
DTMF-Source: INBAND_AUDIO