@babblevoice/babble-drachtio-callmanager 2.3.25 → 2.3.27
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 +41 -0
- package/package.json +1 -1
package/lib/call.js
CHANGED
|
@@ -2858,6 +2858,44 @@ class call {
|
|
|
2858
2858
|
return { user, realm }
|
|
2859
2859
|
}
|
|
2860
2860
|
|
|
2861
|
+
/**
|
|
2862
|
+
* Some phones require a NOTIFY to complete the auto-answer process - send it here
|
|
2863
|
+
* @param { object } res
|
|
2864
|
+
*/
|
|
2865
|
+
#notifytalk( res ) {
|
|
2866
|
+
|
|
2867
|
+
if( 180 != res.status && 183 != res.status ) return
|
|
2868
|
+
if( !this.options.autoanswer ) return
|
|
2869
|
+
|
|
2870
|
+
console.log("res", res)
|
|
2871
|
+
const opts = {
|
|
2872
|
+
"method": "NOTIFY",
|
|
2873
|
+
"headers": {
|
|
2874
|
+
"Event": "talk",
|
|
2875
|
+
"Subscription-State": "terminated;reason=noresource",
|
|
2876
|
+
"Allow-Events": "talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer",
|
|
2877
|
+
"Content-Length": "0",
|
|
2878
|
+
"Call-ID": res.getParsedHeader( "call-id" ),
|
|
2879
|
+
"To": res.get( "to" ),
|
|
2880
|
+
"From": res.get( "from" ),
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
console.log(opts)
|
|
2885
|
+
|
|
2886
|
+
callmanager.options.srf.request( this.options.contact + this.options.contactparams, opts, ( err, req ) => {
|
|
2887
|
+
if( err ) {
|
|
2888
|
+
console.error( err )
|
|
2889
|
+
return
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
// req is the SIP request that went out over the wire
|
|
2893
|
+
req.on( "response", (/*res*/) => {
|
|
2894
|
+
//console.log(`received ${res.status} response to our OPTIONS request`)
|
|
2895
|
+
} )
|
|
2896
|
+
} )
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2861
2899
|
/**
|
|
2862
2900
|
*
|
|
2863
2901
|
* @param { string } contactstr
|
|
@@ -2993,6 +3031,7 @@ class call {
|
|
|
2993
3031
|
|
|
2994
3032
|
newcall.options.headers[ "Allow-Events" ] = "talk, hold, presence, as-feature-event, dialog, call-info, sla, include-session-description, message-summary, refer"
|
|
2995
3033
|
newcall.options.headers[ "Allow" ] = "INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE"
|
|
3034
|
+
newcall.options.headers[ "Supported" ] = "timer, path, replaces"
|
|
2996
3035
|
|
|
2997
3036
|
newcall.#confignetwork( options )
|
|
2998
3037
|
await newcall.#openchannelsfornewuac()
|
|
@@ -3044,6 +3083,8 @@ class call {
|
|
|
3044
3083
|
await newcall._onearly()
|
|
3045
3084
|
}
|
|
3046
3085
|
|
|
3086
|
+
newcall.#notifytalk( res )
|
|
3087
|
+
|
|
3047
3088
|
if( newcall.canceled ) {
|
|
3048
3089
|
newcall.hangup()
|
|
3049
3090
|
}
|