@babblevoice/babble-drachtio-callmanager 2.3.11 → 2.3.13
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.
- package/lib/call.js +13 -1
- package/package.json +1 -1
package/lib/call.js
CHANGED
|
@@ -2779,6 +2779,7 @@ class call {
|
|
|
2779
2779
|
*
|
|
2780
2780
|
* @param { object } options
|
|
2781
2781
|
*/
|
|
2782
|
+
// eslint-disable-next-line complexity
|
|
2782
2783
|
#configcalleridfornewuac( options ) {
|
|
2783
2784
|
let name = ""
|
|
2784
2785
|
let user = "0000000000"
|
|
@@ -2799,6 +2800,10 @@ class call {
|
|
|
2799
2800
|
if( this.parent.calleridname ) {
|
|
2800
2801
|
name = this.parent.calleridname
|
|
2801
2802
|
}
|
|
2803
|
+
} else {
|
|
2804
|
+
if( this._entity.username ) user = this._entity.username
|
|
2805
|
+
if( this._entity.realm ) realm = this._entity.realm
|
|
2806
|
+
if( this._entity.display ) name = this._entity.display
|
|
2802
2807
|
}
|
|
2803
2808
|
|
|
2804
2809
|
/* oveide caller id */
|
|
@@ -2828,10 +2833,15 @@ class call {
|
|
|
2828
2833
|
* @param { object } u
|
|
2829
2834
|
*/
|
|
2830
2835
|
#configautoanswerfornewuac( options, u ) {
|
|
2836
|
+
|
|
2837
|
+
if( !options.contactparams ) options.contactparams = ""
|
|
2838
|
+
|
|
2831
2839
|
if( true === options.autoanswer ) {
|
|
2832
2840
|
this.options.headers[ "Call-Info" ] = `<sip:${u.user}@${u.realm}>;answer-after=0`
|
|
2841
|
+
options.contactparams += ";intercom=true"
|
|
2833
2842
|
} else if ( "number" == typeof options.autoanswer ) {
|
|
2834
2843
|
this.options.headers[ "Call-Info" ] = `<sip:${u.user}@${u.realm}>;answer-after=${options.autoanswer}`
|
|
2844
|
+
options.contactparams += ";intercom=true"
|
|
2835
2845
|
}
|
|
2836
2846
|
}
|
|
2837
2847
|
|
|
@@ -2850,6 +2860,7 @@ class call {
|
|
|
2850
2860
|
@param { object } [ options ] - Options object. See default_options in index.js for more details.
|
|
2851
2861
|
@param { call } [ options.parent ] - the parent call object
|
|
2852
2862
|
@param { string } [ options.contact ] - The contact string
|
|
2863
|
+
@param { string } [ options.contactparams ] - additional params to add to the contact string in the invite
|
|
2853
2864
|
@param { object } [ options.auth ]
|
|
2854
2865
|
@param { string } [ options.auth.username ] - If SIP auth required username
|
|
2855
2866
|
@param { string } [ options.auth.password ] - If SIP auth required password
|
|
@@ -2907,6 +2918,7 @@ class call {
|
|
|
2907
2918
|
const u = newcall.#configcalleridfornewuac( options )
|
|
2908
2919
|
newcall.#configautoanswerfornewuac( options, u )
|
|
2909
2920
|
|
|
2921
|
+
|
|
2910
2922
|
// Polycom
|
|
2911
2923
|
// Alert-Info: <https://www.babblevoice.com/polycom/LoudRing.wav>
|
|
2912
2924
|
// Vtech
|
|
@@ -2923,7 +2935,7 @@ class call {
|
|
|
2923
2935
|
|
|
2924
2936
|
let newdialog
|
|
2925
2937
|
try {
|
|
2926
|
-
newdialog = await callmanager.options.srf.createUAC( options.contact, newcall.options, {
|
|
2938
|
+
newdialog = await callmanager.options.srf.createUAC( options.contact + options.contactparams, newcall.options, {
|
|
2927
2939
|
cbRequest: ( err, req ) => {
|
|
2928
2940
|
|
|
2929
2941
|
if( !req ) {
|