@babblevoice/babble-drachtio-callmanager 3.7.6 → 3.7.7

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 (2) hide show
  1. package/lib/call.js +28 -3
  2. package/package.json +1 -1
package/lib/call.js CHANGED
@@ -162,6 +162,7 @@ class call {
162
162
  #seexpire = callmanager.options.seexpire
163
163
  #refresher = "uac"
164
164
  #expirelasttouch = +new Date()
165
+ #timer = true
165
166
 
166
167
  /**
167
168
  * Construct our call object with all defaults, including a default UUID.
@@ -1868,9 +1869,12 @@ class call {
1868
1869
 
1869
1870
  const headers = {
1870
1871
  "User-Agent": "project",
1871
- "Supported": "replaces, timer",
1872
- "Require": "timer",
1873
- "Session-Expires": `${this.#seexpire/1000};refresher=${this.#refresher}`
1872
+ "Supported": "replaces"
1873
+ }
1874
+
1875
+ if( this.#timer ) {
1876
+ headers[ "Supported" ] = "replaces, timer"
1877
+ headers[ "Session-Expires" ] = `${this.#seexpire/1000};refresher=${this.#refresher}`
1874
1878
  }
1875
1879
 
1876
1880
  const dialog = await callmanager.options.srf.createUAS( this._req, this._res, {
@@ -4067,6 +4071,26 @@ class call {
4067
4071
  }
4068
4072
  }
4069
4073
 
4074
+ /**
4075
+ * If we are not called - we will assume we support timers - if we are called
4076
+ * then we check to see if it is supported to included required in our responce.
4077
+ * @param { object } req
4078
+ * @returns
4079
+ */
4080
+ #parsetimer( req ) {
4081
+ if( !req || !req.get ) return
4082
+
4083
+ this.#timer = false
4084
+
4085
+ let supported = req.get( "Supported" )
4086
+ if( "string" !== typeof supported ) return
4087
+
4088
+ supported = supported.toLocaleLowerCase()
4089
+ if( -1 === supported.indexOf( "timer" ) ) return
4090
+
4091
+ this.#timer = true
4092
+ }
4093
+
4070
4094
  /**
4071
4095
  Create a new object when we receive an INVITE request.
4072
4096
 
@@ -4110,6 +4134,7 @@ class call {
4110
4134
 
4111
4135
  c.#parsesessionexpires( req )
4112
4136
  c.parseallow( req )
4137
+ c.#parsetimer( req )
4113
4138
 
4114
4139
  await callstore.set( c )
4115
4140
  callmanager.options.em.emit( "call.new", c )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/babble-drachtio-callmanager",
3
- "version": "3.7.6",
3
+ "version": "3.7.7",
4
4
  "description": "Call processing to create a PBX",
5
5
  "main": "index.js",
6
6
  "scripts": {