@babblevoice/babble-drachtio-callmanager 3.4.1 → 3.5.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 (2) hide show
  1. package/lib/call.js +28 -4
  2. package/package.json +1 -1
package/lib/call.js CHANGED
@@ -1912,6 +1912,25 @@ class call {
1912
1912
  return callmanager.options.engagedsoup
1913
1913
  }
1914
1914
 
1915
+ /**
1916
+ * Set the sound soup for music on unobtainable.
1917
+ * @param { object } soup - sound soup as described in projectrtp
1918
+ */
1919
+ set unobtainablesoup( soup ) {
1920
+ this.unobtainablesoup = soup
1921
+ }
1922
+
1923
+ /**
1924
+ * Return the current unobtainable
1925
+ * @returns { object } sound soup
1926
+ */
1927
+ get unobtainablesoup() {
1928
+ if( this.unobtainablesoup ) {
1929
+ return this.unobtainablesoup
1930
+ }
1931
+ return callmanager.options.unobtainablesoup
1932
+ }
1933
+
1915
1934
  /**
1916
1935
  * If we have been placed on hold (and it has been neotiated) then configure audio to match.
1917
1936
  * @param { "inactive"|"recvonly" } direction - from the other end
@@ -2780,15 +2799,20 @@ class call {
2780
2799
  }
2781
2800
 
2782
2801
  /**
2783
- * @param { object } reason - plays the apropropriate tone - TODO support other tone than USER_BUSY
2802
+ * @param { object } reason - plays the apropropriate tone
2784
2803
  * @param { boolean } tone
2785
2804
  */
2786
2805
  async #hangupestablish( reason, tone ) {
2787
- if( tone && 486 == reason.sip ) {
2788
- this.play( this.engagedsoup )
2806
+ if( undefined != reason && tone ) {
2807
+ switch( reason.sip ) {
2808
+ case 486:
2809
+ this.play( this.engagedsoup )
2810
+ break
2811
+ case 480:
2812
+ this.play( this.unobtainablesoup )
2813
+ }
2789
2814
  return true
2790
2815
  }
2791
-
2792
2816
  this._state._hangup = true
2793
2817
 
2794
2818
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/babble-drachtio-callmanager",
3
- "version": "3.4.1",
3
+ "version": "3.5.0",
4
4
  "description": "Call processing to create a PBX",
5
5
  "main": "index.js",
6
6
  "scripts": {