sip-lab 1.28.12 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/DEV.md +55 -0
  2. package/README.md +8 -2
  3. package/binding.gyp +1 -0
  4. package/build_deps.sh +2 -1
  5. package/index.js +7 -0
  6. package/package.json +1 -1
  7. package/prebuilds/linux-x64/node.abi102.node +0 -0
  8. package/prebuilds/linux-x64/node.abi108.node +0 -0
  9. package/prebuilds/linux-x64/node.abi111.node +0 -0
  10. package/prebuilds/linux-x64/node.abi115.node +0 -0
  11. package/prebuilds/linux-x64/node.abi120.node +0 -0
  12. package/prebuilds/linux-x64/node.abi88.node +0 -0
  13. package/prebuilds/linux-x64/node.abi93.node +0 -0
  14. package/samples/100_calls.js +4 -0
  15. package/samples/16_audio_streams.js +2 -0
  16. package/samples/183_session_progress.js +2 -0
  17. package/samples/delayed_media.js +2 -0
  18. package/samples/four_audio_streams_two_refused.js +7 -4
  19. package/samples/mrcp_and_audio.simplified_media.js +2 -0
  20. package/samples/multiple_audio_streams.js +2 -0
  21. package/samples/refuse_telephone_event.js +3 -0
  22. package/samples/reinvite_and_dtmf.js +3 -0
  23. package/samples/reinvite_audio_audio.js +2 -0
  24. package/samples/reinvite_with_hold_unhold.js +2 -0
  25. package/samples/rtp_and_srtp.js +3 -0
  26. package/samples/rtp_and_srtp.rtp_refused.js +3 -0
  27. package/samples/send_and_receive_bfsk.js.future +171 -0
  28. package/samples/srtp.js +3 -0
  29. package/samples/tcp.js +2 -0
  30. package/samples/text_to_speech.js +3 -0
  31. package/samples/two_audio_streams.js +4 -0
  32. package/samples/two_audio_streams.port_zero.js +4 -0
  33. package/samples_extra/ws_speech_server.bfsk.js +154 -0
  34. package/samples_extra/ws_speech_server.dtmf.js +5 -21
  35. package/samples_extra/ws_speech_server.google.js +8 -10
  36. package/samples_extra/ws_speech_server.send_bfsk.js +156 -0
  37. package/samples_extra/ws_speech_server.start_bfsk_detection.js.future +164 -0
  38. package/src/addon.cpp +180 -10
  39. package/src/event_templates.cpp +8 -0
  40. package/src/event_templates.hpp +3 -0
  41. package/src/pjmedia/include/pjmedia/bfsk_det.h +23 -0
  42. package/src/pjmedia/include/pjmedia/ws_speech_port.h +1 -0
  43. package/src/pjmedia/src/pjmedia/bfsk_det.c +289 -0
  44. package/src/pjmedia/src/pjmedia/ws_speech_port.cpp +8 -0
  45. package/src/sip.cpp +552 -35
  46. package/src/sip.cpp.old +9236 -0
  47. package/src/sip.hpp +11 -0
package/DEV.md CHANGED
@@ -80,6 +80,61 @@ npx prebuildify-cross -i mayamatakeshi/sip-lab-debian11:latest -t 15.0.0 -t 16.0
80
80
  ```
81
81
  Obs: however the above will fail if you are behind proxy (solution pending).
82
82
 
83
+ #### Checking build using docker container
84
+
85
+ A quick check of the build can be done this way:
86
+ ```
87
+ docker run -it debian:bookworm-slim /bin/bash
88
+
89
+ # then inside the container
90
+
91
+ apt update
92
+ apt install curl
93
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
94
+ . ~/.nvm/nvm.sh
95
+ nvm i 19
96
+ mkdir -p /root/tmp/t1
97
+ cd /root/tmp/t1
98
+ npm init -y
99
+ apt install -y build-essential automake autoconf libtool libspeex-dev libopus-dev libsdl2-dev libavdevice-dev libswscale-dev libv4l-dev libopencore-amrnb-dev libopencore-amrwb-dev libvo-amrwbenc-dev libvo-amrwbenc-dev libboost-dev libtiff-dev libpcap-dev libssl-dev uuid-dev flite-dev cmake git wget
100
+ npm i sip-lab
101
+ ```
102
+
103
+ Sample build:
104
+ ```
105
+ root@636c5c5b0748:~/tmp/t2# nvm use 19
106
+ Now using node v19.9.0 (npm v9.6.3)
107
+
108
+ root@636c5c5b0748:~/tmp/t2# time npm i sip-lab
109
+ npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
110
+ npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
111
+ npm WARN deprecated npmlog@6.0.2: This package is no longer supported.
112
+ npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
113
+ npm WARN deprecated are-we-there-yet@3.0.1: This package is no longer supported.
114
+ npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
115
+ npm WARN deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
116
+ npm WARN deprecated gauge@4.0.4: This package is no longer supported.
117
+
118
+ added 165 packages, and audited 166 packages in 6m
119
+
120
+ 11 packages are looking for funding
121
+ run `npm fund` for details
122
+
123
+ 4 moderate severity vulnerabilities
124
+
125
+ To address all issues, run:
126
+ npm audit fix
127
+
128
+ Run `npm audit` for details.
129
+
130
+ real 5m54.904s
131
+ user 4m32.643s
132
+ sys 0m54.272s
133
+
134
+ ```
135
+
136
+ So it is taking aboult 6 minutes to build the addon on a docker container.
137
+
83
138
  #### Running tests
84
139
  ```
85
140
  npm test
package/README.md CHANGED
@@ -25,8 +25,9 @@ TODO:
25
25
 
26
26
  ### Installation
27
27
 
28
- This is a node.js addon and it is known to work on Debian 11, Debian 10, Ubuntu 22.04 and Ubuntu 20.04.
29
- It is distributed with prebuild binaries for node.js 15.0.0 and above (but built for Debian 11. For other Debian versions or for Ubuntu a local build of the addon will be executed. Being the case, be patient as the build process will take several minutes to complete).
28
+ This is a node.js addon and it is known to work on Debian 11.
29
+
30
+ It is distributed with prebuild binaries for node.js 15.0.0 and above (but built for Debian 11. For other Debian versions or for Ubuntu a local build of the addon will be executed. Being the case, be patient as the build process will take several minutes to complete (about 6 minutes on a docker container)).
30
31
 
31
32
  To install it, first install build dependencies:
32
33
  ```
@@ -47,6 +48,11 @@ The above script has detailed comments.
47
48
 
48
49
  Please read it to undestand how to write your own test scripts.
49
50
 
51
+ Notes:
52
+ - It will not work on Debian 10 as cmake version is older than required.
53
+ - It will work on Debian 12 but a build process will be required. But you need to build using node v19 or older. Building with node v20 or v21 will fail (https://github.com/MayamaTakeshi/sip-lab/issues/107). But once you have it built, you can switch to a newer version of node.
54
+
55
+ So basically, if you stick with Debian 11 and any node version from 15 to 21, istallation should be smooth.
50
56
 
51
57
  ### Samples
52
58
 
package/binding.gyp CHANGED
@@ -119,6 +119,7 @@
119
119
  'src/sip.cpp',
120
120
  'src/addon.cpp',
121
121
  'src/pjmedia/src/pjmedia/dtmfdet.c',
122
+ 'src/pjmedia/src/pjmedia/bfsk_det.c',
122
123
  'src/pjmedia/src/pjmedia/fax_port.c',
123
124
  'src/pjmedia/src/pjmedia/flite_port.c',
124
125
  'src/pjmedia/src/pjmedia/pocketsphinx_port.c',
package/build_deps.sh CHANGED
@@ -56,7 +56,8 @@ then
56
56
  #git checkout 797088ed133c98492519b7d042b75735f6f9388c # updated as part of #21
57
57
  #git checkout 651df5b50129b7c5a5feec8336dda4468d53d2b0 # updated to latest to see of crash issues improve
58
58
  #git checkout 043926a5846963a2c99378e8daa495230923eaab # updated to try to solve #49 (but issue remains)
59
- git checkout c36802585ddefb3ca477d1f6d773d179510c5412 # updated to try to solve #83 (but issue remains)
59
+ #git checkout c36802585ddefb3ca477d1f6d773d179510c5412 # updated to try to solve #83 (but issue remains)
60
+ git checkout 9543a1bcf50be721d030be99afeeb63bd8cf2013 # updated to latest commit to permit to report https://github.com/pjsip/pjproject/issues/4082
60
61
 
61
62
  cat > user.mak <<EOF
62
63
  export CFLAGS += -fPIC -g
package/index.js CHANGED
@@ -58,6 +58,7 @@ addon.call = {
58
58
  respond: (c_id, params) => { return addon.call_respond(c_id, JSON.stringify(params)) },
59
59
  terminate: (c_id, params) => { return addon.call_terminate(c_id, JSON.stringify(params ? params : {})) },
60
60
  send_dtmf: (c_id, params) => { return addon.call_send_dtmf(c_id, JSON.stringify(params)) },
61
+ send_bfsk: (c_id, params) => { return addon.call_send_bfsk(c_id, JSON.stringify(params)) },
61
62
  reinvite: (c_id, params) => { return addon.call_reinvite(c_id, JSON.stringify(params ? params : {})) },
62
63
  send_request: (c_id, params) => { return addon.call_send_request(c_id, JSON.stringify(params)) },
63
64
  start_record_wav: (c_id, params) => { return addon.call_start_record_wav(c_id, JSON.stringify(params)) },
@@ -69,6 +70,12 @@ addon.call = {
69
70
  start_speech_synth: (c_id, params) => { return addon.call_start_speech_synth(c_id, JSON.stringify(params)) },
70
71
  stop_speech_synth: (c_id, params) => { return addon.call_stop_speech_synth(c_id, JSON.stringify(params ? params : {})) },
71
72
 
73
+ start_inband_dtmf_detection: (c_id, params) => { return addon.call_start_inband_dtmf_detection(c_id, JSON.stringify(params ? params : {})) },
74
+ stop_inband_dtmf_detection: (c_id, params) => { return addon.call_stop_inband_dtmf_detection(c_id, JSON.stringify(params ? params : {})) },
75
+
76
+ start_bfsk_detection: (c_id, params) => { return addon.call_start_bfsk_detection(c_id, JSON.stringify(params ? params : {})) },
77
+ stop_bfsk_dtmf_detection: (c_id, params) => { return addon.call_stop_bfsk_detection(c_id, JSON.stringify(params ? params : {})) },
78
+
72
79
  start_speech_recog: (c_id, params) => {
73
80
  var ps = {}
74
81
  if(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sip-lab",
3
- "version": "1.28.12",
3
+ "version": "1.30.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "engines": {
Binary file
Binary file
@@ -92,6 +92,10 @@ async function test() {
92
92
  media_id: 0,
93
93
  })).value(), 50000)
94
94
 
95
+ ocs.forEach(oc => {
96
+ sip.call.start_inband_dtmf_detection(oc.id)
97
+ })
98
+
95
99
  z.store.ic_ids.forEach(ic_id => {
96
100
  sip.call.send_dtmf(ic_id, {digits: '4321', mode: 1})
97
101
  })
@@ -100,6 +100,8 @@ async function test() {
100
100
  media_id: n,
101
101
  })).value(), 3000)
102
102
 
103
+ sip.call.start_inband_dtmf_detection(oc.id)
104
+
103
105
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
104
106
 
105
107
  await z.wait(_.chain(_.range(16)).map(n => ({
@@ -86,6 +86,8 @@ async function test() {
86
86
  },
87
87
  ], 1000)
88
88
 
89
+ sip.call.start_inband_dtmf_detection(oc.id)
90
+
89
91
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
90
92
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
91
93
 
@@ -107,6 +107,8 @@ async function test() {
107
107
 
108
108
  ], 1000)
109
109
 
110
+ sip.call.start_inband_dtmf_detection(oc.id)
111
+
110
112
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
111
113
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
112
114
 
@@ -38,8 +38,8 @@ async function test() {
38
38
  type: "audio",
39
39
  port: 0, // it means not in use
40
40
  },
41
- "audio",
42
- {
41
+ "audio",
42
+ {
43
43
  type: "audio",
44
44
  port: 0, // it means not in use
45
45
  }
@@ -63,8 +63,8 @@ async function test() {
63
63
  type: "audio",
64
64
  port: 0, // it means not in use
65
65
  },
66
- "audio",
67
- {
66
+ "audio",
67
+ {
68
68
  type: "audio",
69
69
  port: 0, // it means not in use
70
70
  }
@@ -128,6 +128,9 @@ async function test() {
128
128
  },
129
129
  ], 1000)
130
130
 
131
+ sip.call.start_inband_dtmf_detection(oc.id, {media_id: 0})
132
+ sip.call.start_inband_dtmf_detection(oc.id, {media_id: 2})
133
+
131
134
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
132
135
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
133
136
 
@@ -118,6 +118,8 @@ async function test() {
118
118
  },
119
119
  ], 1000)
120
120
 
121
+ sip.call.start_inband_dtmf_detection(oc.id)
122
+
121
123
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
122
124
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
123
125
 
@@ -103,6 +103,8 @@ async function test() {
103
103
  media_id: n,
104
104
  })).value(), 3000)
105
105
 
106
+ sip.call.start_inband_dtmf_detection(oc.id)
107
+
106
108
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
107
109
 
108
110
  await z.wait(_.chain(_.range(NUM_AUDIO_STREAMS)).map(n => ({
@@ -100,6 +100,9 @@ async function test() {
100
100
  },
101
101
  ], 1000)
102
102
 
103
+ sip.call.start_inband_dtmf_detection(oc.id)
104
+ sip.call.start_inband_dtmf_detection(ic.id)
105
+
103
106
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 1})
104
107
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
105
108
 
@@ -111,6 +111,9 @@ async function test() {
111
111
  },
112
112
  ], 1000)
113
113
 
114
+ sip.call.start_inband_dtmf_detection(oc.id)
115
+ sip.call.start_inband_dtmf_detection(ic.id)
116
+
114
117
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
115
118
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
116
119
 
@@ -88,6 +88,8 @@ async function test() {
88
88
  },
89
89
  ], 1000)
90
90
 
91
+ sip.call.start_inband_dtmf_detection(oc.id)
92
+
91
93
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
92
94
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
93
95
 
@@ -98,6 +98,8 @@ async function test() {
98
98
  },
99
99
  ], 1000)
100
100
 
101
+ sip.call.start_inband_dtmf_detection(oc.id)
102
+
101
103
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
102
104
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
103
105
 
@@ -89,6 +89,9 @@ async function test() {
89
89
  },
90
90
  ], 1000)
91
91
 
92
+ sip.call.start_inband_dtmf_detection(oc.id)
93
+ sip.call.start_inband_dtmf_detection(ic.id)
94
+
92
95
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 1})
93
96
  sip.call.send_dtmf(ic.id, {digits: '1234', mode: 1})
94
97
 
@@ -131,6 +131,9 @@ async function test() {
131
131
  },
132
132
  ], 1000)
133
133
 
134
+ sip.call.start_inband_dtmf_detection(oc.id, {media_id: 1})
135
+ sip.call.start_inband_dtmf_detection(ic.id, {media_id: 1})
136
+
134
137
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 1})
135
138
  sip.call.send_dtmf(ic.id, {digits: '1234', mode: 1})
136
139
 
@@ -0,0 +1,171 @@
1
+ var sip = require ('../index.js')
2
+ var Zeq = require('@mayama/zeq')
3
+ var z = new Zeq()
4
+ var m = require('data-matching')
5
+ var sip_msg = require('sip-matching')
6
+ var sdp = require('sdp-matching')
7
+
8
+ async function test() {
9
+ //sip.set_log_level(9)
10
+
11
+ //sip.set_log_level(6)
12
+ sip.dtmf_aggregation_on(500)
13
+
14
+ z.trap_events(sip.event_source, 'event', (evt) => {
15
+ var e = evt.args[0]
16
+ return e
17
+ })
18
+
19
+ //sip.set_codecs("pcmu/8000/1:128,pcma/8000/1:128,gsm/8000/1:128")
20
+ sip.set_codecs("pcma/8000/1:128")
21
+
22
+ console.log(sip.start((data) => { console.log(data)} ))
23
+
24
+ t1 = sip.transport.create({address: "127.0.0.1", type: 'udp'})
25
+ t2 = sip.transport.create({address: "127.0.0.1", type: 'udp'})
26
+
27
+ console.log("t1", t1)
28
+ console.log("t2", t2)
29
+
30
+ oc = sip.call.create(t1.id, {from_uri: 'sip:alice@test.com', to_uri: `sip:bob@${t2.address}:${t2.port}`})
31
+
32
+ await z.wait([
33
+ {
34
+ event: "incoming_call",
35
+ call_id: m.collect("call_id"),
36
+ },
37
+ {
38
+ event: 'response',
39
+ call_id: oc.id,
40
+ method: 'INVITE',
41
+ msg: sip_msg({
42
+ $rs: '100',
43
+ $rr: 'Trying',
44
+ '$hdr(call-id)': m.collect('sip_call_id'),
45
+ }),
46
+ },
47
+ ], 1000)
48
+
49
+ ic = {
50
+ id: z.store.call_id,
51
+ sip_call_id: z.store.sip_call_id,
52
+ }
53
+
54
+ sip.call.respond(ic.id, {code: 200, reason: 'OK'})
55
+
56
+ await z.wait([
57
+ {
58
+ event: 'response',
59
+ call_id: oc.id,
60
+ method: 'INVITE',
61
+ msg: sip_msg({
62
+ $rs: '200',
63
+ $rr: 'OK',
64
+ }),
65
+ },
66
+ {
67
+ event: 'media_update',
68
+ call_id: oc.id,
69
+ status: 'ok',
70
+ media: [
71
+ {
72
+ type: 'audio',
73
+ local: {
74
+ port: 10000,
75
+ mode: 'sendrecv'
76
+ },
77
+ remote: {
78
+ port: 10002,
79
+ mode: 'sendrecv'
80
+ },
81
+ },
82
+ ],
83
+ },
84
+ {
85
+ event: 'media_update',
86
+ call_id: ic.id,
87
+ status: 'ok',
88
+ media: [
89
+ {
90
+ type: 'audio',
91
+ local: {
92
+ port: 10002,
93
+ mode: 'sendrecv'
94
+ },
95
+ remote: {
96
+ port: 10000,
97
+ mode: 'sendrecv'
98
+ },
99
+ }
100
+ ],
101
+ },
102
+ ], 1000)
103
+
104
+ sip.call.start_record_wav(oc.id, {file: 'oc.wav'})
105
+ sip.call.start_record_wav(ic.id, {file: 'ic.wav'})
106
+
107
+ await z.sleep(100)
108
+
109
+ sip.call.start_bfsk_detection(oc.id, {freq_zero: 880, freq_one: 1280})
110
+ //sip.call.start_bfsk_detection(ic.id, {freq_zero: 880, freq_one: 1280})
111
+
112
+ oc_bits = '1010'
113
+ ic_bits = '1100'
114
+
115
+ sip.call.send_bfsk(ic.id, {bits: ic_bits, freq_zero: 880, freq_one: 1280})
116
+ //sip.call.send_bfsk(oc.id, {bits: oc_bits, freq_zero: 880, freq_one: 1280})
117
+
118
+ await z.wait([
119
+ {
120
+ event: 'bfsk',
121
+ call_id: ic.id,
122
+ bits: oc_bits,
123
+ media_id: 0
124
+ },
125
+ {
126
+ event: 'bfsk',
127
+ call_id: oc.id,
128
+ bits: ic_bits,
129
+ media_id: 0
130
+ },
131
+ ], 10000)
132
+
133
+ await z.sleep(1000)
134
+
135
+ sip.call.stop_record_wav(oc.id)
136
+ sip.call.stop_record_wav(ic.id)
137
+
138
+ sip.call.terminate(oc.id)
139
+
140
+ await z.wait([
141
+ {
142
+ event: 'call_ended',
143
+ call_id: oc.id,
144
+ },
145
+ {
146
+ event: 'call_ended',
147
+ call_id: ic.id,
148
+ },
149
+ {
150
+ event: 'response',
151
+ call_id: oc.id,
152
+ method: 'BYE',
153
+ msg: sip_msg({
154
+ $rs: '200',
155
+ $rr: 'OK',
156
+ }),
157
+ },
158
+ ], 1000)
159
+
160
+ console.log("Success")
161
+
162
+ sip.stop()
163
+ }
164
+
165
+
166
+ test()
167
+ .catch(e => {
168
+ console.error(e)
169
+ process.exit(1)
170
+ })
171
+
package/samples/srtp.js CHANGED
@@ -81,6 +81,9 @@ async function test() {
81
81
  },
82
82
  ], 1000)
83
83
 
84
+ sip.call.start_inband_dtmf_detection(oc.id)
85
+ sip.call.start_inband_dtmf_detection(ic.id)
86
+
84
87
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 1})
85
88
  sip.call.send_dtmf(ic.id, {digits: '1234', mode: 1})
86
89
 
package/samples/tcp.js CHANGED
@@ -85,6 +85,8 @@ async function test() {
85
85
  sip.call.start_record_wav(oc.id, {file: './oc.wav'})
86
86
  sip.call.start_record_wav(ic.id, {file: './ic.wav'})
87
87
 
88
+ sip.call.start_inband_dtmf_detection(oc.id)
89
+
88
90
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
89
91
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
90
92
 
@@ -87,6 +87,9 @@ async function test() {
87
87
  sip.call.start_record_wav(oc.id, {file: './oc.wav'})
88
88
  sip.call.start_record_wav(ic.id, {file: './ic.wav'})
89
89
 
90
+ sip.call.start_inband_dtmf_detection(oc.id)
91
+ sip.call.start_inband_dtmf_detection(ic.id)
92
+
90
93
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 1})
91
94
  sip.call.send_dtmf(ic.id, {digits: '1234', mode: 1})
92
95
 
@@ -95,6 +95,8 @@ async function test() {
95
95
  },
96
96
  ], 1000)
97
97
 
98
+ sip.call.start_inband_dtmf_detection(oc.id)
99
+
98
100
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
99
101
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
100
102
 
@@ -414,6 +416,8 @@ async function test() {
414
416
  },
415
417
  ], 1000)
416
418
 
419
+ sip.call.start_inband_dtmf_detection(oc.id)
420
+
417
421
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
418
422
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
419
423
 
@@ -95,6 +95,8 @@ async function test() {
95
95
  },
96
96
  ], 1000)
97
97
 
98
+ sip.call.start_inband_dtmf_detection(oc.id)
99
+
98
100
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
99
101
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
100
102
 
@@ -426,6 +428,8 @@ async function test() {
426
428
  },
427
429
  ], 1000)
428
430
 
431
+ sip.call.start_inband_dtmf_detection(oc.id)
432
+
429
433
  sip.call.send_dtmf(oc.id, {digits: '1234', mode: 0})
430
434
  sip.call.send_dtmf(ic.id, {digits: '4321', mode: 1})
431
435