@babblevoice/babble-drachtio-callmanager 2.3.26 → 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.
Files changed (2) hide show
  1. package/lib/call.js +40 -0
  2. 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
@@ -3045,6 +3083,8 @@ class call {
3045
3083
  await newcall._onearly()
3046
3084
  }
3047
3085
 
3086
+ newcall.#notifytalk( res )
3087
+
3048
3088
  if( newcall.canceled ) {
3049
3089
  newcall.hangup()
3050
3090
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/babble-drachtio-callmanager",
3
- "version": "2.3.26",
3
+ "version": "2.3.27",
4
4
  "description": "Call processing to create a PBX",
5
5
  "main": "index.js",
6
6
  "scripts": {