@babblevoice/babble-drachtio-callmanager 2.3.24 → 2.3.26
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 +6 -5
- package/package.json +1 -1
- package/test/interface/sdp.js +62 -0
package/lib/call.js
CHANGED
|
@@ -1854,7 +1854,7 @@ class call {
|
|
|
1854
1854
|
const media = sdp.getmedia()
|
|
1855
1855
|
|
|
1856
1856
|
let ip
|
|
1857
|
-
if( sdp && sdp && sdp.sdp.connection && sdp.sdp.connection.ip ) {
|
|
1857
|
+
if( sdp && sdp.sdp && sdp.sdp.connection && sdp.sdp.connection.ip ) {
|
|
1858
1858
|
ip = sdp.sdp.connection.ip
|
|
1859
1859
|
}
|
|
1860
1860
|
|
|
@@ -1869,7 +1869,7 @@ class call {
|
|
|
1869
1869
|
*/
|
|
1870
1870
|
#handlehold( direction, res ) {
|
|
1871
1871
|
|
|
1872
|
-
if(
|
|
1872
|
+
if( "inactive" !== direction && "sendonly" !== direction ) return false
|
|
1873
1873
|
|
|
1874
1874
|
if( "sendonly" === direction ) this._hold( "recvonly" )
|
|
1875
1875
|
else this._hold( direction )
|
|
@@ -1888,13 +1888,13 @@ class call {
|
|
|
1888
1888
|
}
|
|
1889
1889
|
|
|
1890
1890
|
/**
|
|
1891
|
-
* We
|
|
1892
|
-
* @param { string } direction
|
|
1891
|
+
* We receive a request to unhold.
|
|
1892
|
+
* @param { string | undefined } direction undefined is the same as "sendrecv"
|
|
1893
1893
|
* @param { object } res
|
|
1894
1894
|
* @returns { boolean }
|
|
1895
1895
|
*/
|
|
1896
1896
|
#handleoffhold( direction, res ) {
|
|
1897
|
-
if( "sendrecv" !== direction ) return false
|
|
1897
|
+
if( direction && "sendrecv" !== direction ) return false
|
|
1898
1898
|
|
|
1899
1899
|
this._unhold()
|
|
1900
1900
|
res.send( 200, {
|
|
@@ -2993,6 +2993,7 @@ class call {
|
|
|
2993
2993
|
|
|
2994
2994
|
newcall.options.headers[ "Allow-Events" ] = "talk, hold, presence, as-feature-event, dialog, call-info, sla, include-session-description, message-summary, refer"
|
|
2995
2995
|
newcall.options.headers[ "Allow" ] = "INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE"
|
|
2996
|
+
newcall.options.headers[ "Supported" ] = "timer, path, replaces"
|
|
2996
2997
|
|
|
2997
2998
|
newcall.#confignetwork( options )
|
|
2998
2999
|
await newcall.#openchannelsfornewuac()
|
package/package.json
CHANGED
package/test/interface/sdp.js
CHANGED
|
@@ -836,4 +836,66 @@ a=sendrecv
|
|
|
836
836
|
expect( sdpilbc.selected ).to.deep.equal( { name: "ilbc", pt: 97, dpt: 110 } )
|
|
837
837
|
|
|
838
838
|
} )
|
|
839
|
+
|
|
840
|
+
it( "Poly E220 hold", async () => {
|
|
841
|
+
|
|
842
|
+
const polysdp = `v=0
|
|
843
|
+
o=- 1699364340 1699364341 IN IP4 82.19.206.102
|
|
844
|
+
s=Polycom IP Phone
|
|
845
|
+
c=IN IP4 82.19.206.102
|
|
846
|
+
t=0 0
|
|
847
|
+
a=sendonly
|
|
848
|
+
m=audio 63558 RTP/AVP 9 127
|
|
849
|
+
a=rtpmap:9 G722/8000
|
|
850
|
+
a=rtpmap:127 telephone-event/8000
|
|
851
|
+
a=sendonly
|
|
852
|
+
`.replace( /\r\n/g, "\n" ).replace( /\n/g, "\r\n" )
|
|
853
|
+
|
|
854
|
+
const sdpobj = sdp.create( polysdp )
|
|
855
|
+
|
|
856
|
+
/* ref call.#getsdpformodify */
|
|
857
|
+
const media = sdpobj.getmedia()
|
|
858
|
+
|
|
859
|
+
let ip
|
|
860
|
+
if( sdpobj && sdpobj.sdp && sdpobj.sdp.connection && sdpobj.sdp.connection.ip ) {
|
|
861
|
+
ip = sdpobj.sdp.connection.ip
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
expect( ip ).to.equal( "82.19.206.102" )
|
|
865
|
+
expect( media.direction ).to.equal( "sendonly" )
|
|
866
|
+
|
|
867
|
+
} )
|
|
868
|
+
|
|
869
|
+
it( "Poly E220 unhold", async () => {
|
|
870
|
+
|
|
871
|
+
const polysdp = `v=0
|
|
872
|
+
o=- 1699364340 1699364342 IN IP4 82.19.206.102
|
|
873
|
+
s=Polycom IP Phone
|
|
874
|
+
c=IN IP4 82.19.206.102
|
|
875
|
+
t=0 0
|
|
876
|
+
a=sendrecv
|
|
877
|
+
m=audio 63558 RTP/AVP 110 9 0 8 127
|
|
878
|
+
a=rtpmap:110 iLBC/8000
|
|
879
|
+
a=fmtp:110 mode=20
|
|
880
|
+
a=rtpmap:9 G722/8000
|
|
881
|
+
a=rtpmap:0 PCMU/8000
|
|
882
|
+
a=rtpmap:8 PCMA/8000
|
|
883
|
+
a=rtpmap:127 telephone-event/8000
|
|
884
|
+
`.replace( /\r\n/g, "\n" ).replace( /\n/g, "\r\n" )
|
|
885
|
+
|
|
886
|
+
const sdpobj = sdp.create( polysdp )
|
|
887
|
+
|
|
888
|
+
/* ref call.#getsdpformodify */
|
|
889
|
+
const media = sdpobj.getmedia()
|
|
890
|
+
|
|
891
|
+
let ip
|
|
892
|
+
if( sdpobj && sdpobj.sdp && sdpobj.sdp.connection && sdpobj.sdp.connection.ip ) {
|
|
893
|
+
ip = sdpobj.sdp.connection.ip
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
expect( ip ).to.equal( "82.19.206.102" )
|
|
897
|
+
/* somewhere in the library - default is sendrecv so it is left undefined */
|
|
898
|
+
expect( media.direction ).to.be.undefined
|
|
899
|
+
} )
|
|
900
|
+
|
|
839
901
|
} )
|