@babblevoice/babble-drachtio-callmanager 2.3.26 → 2.3.28
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/README.md +2 -1
- package/lib/call.js +5 -0
- package/lib/sdp.js +20 -0
- package/package.json +1 -1
- package/test/interface/sdp.js +30 -1
package/README.md
CHANGED
|
@@ -37,7 +37,8 @@ const r = new Registrar( {
|
|
|
37
37
|
"staletime": 180, /* number of seconds we consider a client stale if we don't hear a response from an OPTIONS or REGISTER ping */
|
|
38
38
|
"expires": 3600, /* default expires */
|
|
39
39
|
"minexpires": 3600, /* Force the client with 423 to extend expires to this amount - conflicts with regping */
|
|
40
|
-
"userlookup": passwordLookup
|
|
40
|
+
"userlookup": passwordLookup,
|
|
41
|
+
"forcerport": true /* when sending invite - request rport */
|
|
41
42
|
} )
|
|
42
43
|
|
|
43
44
|
|
package/lib/call.js
CHANGED
|
@@ -2686,6 +2686,9 @@ class call {
|
|
|
2686
2686
|
* @param { object } [ channeldef ]
|
|
2687
2687
|
*/
|
|
2688
2688
|
async #openrelatedchannel( channeldef ) {
|
|
2689
|
+
|
|
2690
|
+
if( this.channels.audio ) return
|
|
2691
|
+
|
|
2689
2692
|
const relatedcall = this.other
|
|
2690
2693
|
/* TODO: this is a hack. projectrtp has become too complicated with both a listen and connect
|
|
2691
2694
|
mechanism. This is causing problems in code like this. There is no interface to
|
|
@@ -2869,9 +2872,11 @@ class call {
|
|
|
2869
2872
|
if( !this.options.contactparams ) this.options.contactparams = ""
|
|
2870
2873
|
if( true === this.options.autoanswer ) {
|
|
2871
2874
|
this.options.headers[ "Call-Info" ] = `<sip:${parts.host}>;answer-after=0`
|
|
2875
|
+
this.options.headers[ "Alert-Info" ] = "auto-answer"
|
|
2872
2876
|
this.options.contactparams += ";intercom=true"
|
|
2873
2877
|
} else if ( "number" == typeof this.options.autoanswer ) {
|
|
2874
2878
|
this.options.headers[ "Call-Info" ] = `<sip:${parts.host}>;answer-after=${this.options.autoanswer}`
|
|
2879
|
+
this.options.headers[ "Alert-Info" ] = "auto-answer"
|
|
2875
2880
|
this.options.contactparams += ";intercom=true"
|
|
2876
2881
|
}
|
|
2877
2882
|
}
|
package/lib/sdp.js
CHANGED
|
@@ -691,10 +691,30 @@ class sdp {
|
|
|
691
691
|
|
|
692
692
|
if( "ilbc" in o && 8000 == o.ilbc.rate ) {
|
|
693
693
|
this.#dynamicpts.setdynamicpt( "ilbc", "ilbc", o.ilbc.payload )
|
|
694
|
+
|
|
695
|
+
const m = this.sdp.media.find( mo => "audio" === mo.type )
|
|
696
|
+
if( m ) {
|
|
697
|
+
// @ts-ignore
|
|
698
|
+
const ilbcindex = m.payloads.indexOf( prtpcodecpts.ilbc )
|
|
699
|
+
if( -1 !== ilbcindex ) {
|
|
700
|
+
// @ts-ignore
|
|
701
|
+
m.payloads.splice( ilbcindex, 1, o.ilbc.payload )
|
|
702
|
+
}
|
|
703
|
+
}
|
|
694
704
|
}
|
|
695
705
|
|
|
696
706
|
if( "rfc2833" in o && 8000 == o.rfc2833.rate ) {
|
|
697
707
|
this.#dynamicpts.setdynamicpt( "2833", "telephone-event", o.rfc2833.payload )
|
|
708
|
+
|
|
709
|
+
const m = this.sdp.media.find( mo => "audio" === mo.type )
|
|
710
|
+
if( m ) {
|
|
711
|
+
// @ts-ignore
|
|
712
|
+
const televindex = m.payloads.indexOf( prtpcodecpts[ "2833" ] )
|
|
713
|
+
if( -1 !== televindex ) {
|
|
714
|
+
// @ts-ignore
|
|
715
|
+
m.payloads.splice( televindex, 1, o.rfc2833.payload )
|
|
716
|
+
}
|
|
717
|
+
}
|
|
698
718
|
}
|
|
699
719
|
|
|
700
720
|
return this
|
package/package.json
CHANGED
package/test/interface/sdp.js
CHANGED
|
@@ -814,7 +814,7 @@ o=- \\d+ 0 IN IP4 127.0.0.1
|
|
|
814
814
|
s=project
|
|
815
815
|
c=IN IP4 127.0.0.1
|
|
816
816
|
t=0 0
|
|
817
|
-
m=audio 0 RTP/AVP
|
|
817
|
+
m=audio 0 RTP/AVP 110 127
|
|
818
818
|
a=rtpmap:110 ilbc/8000
|
|
819
819
|
a=rtpmap:127 telephone-event/8000
|
|
820
820
|
a=fmtp:110 mode=20
|
|
@@ -898,4 +898,33 @@ a=rtpmap:127 telephone-event/8000
|
|
|
898
898
|
expect( media.direction ).to.be.undefined
|
|
899
899
|
} )
|
|
900
900
|
|
|
901
|
+
it( "receive sdp send sdp ilbc", async () => {
|
|
902
|
+
const polysdp = `v=0
|
|
903
|
+
o=- 1699618792 1699618792 IN IP4 82.19.206.102
|
|
904
|
+
s=Polycom IP Phone
|
|
905
|
+
c=IN IP4 82.19.206.102
|
|
906
|
+
t=0 0
|
|
907
|
+
a=sendrecv
|
|
908
|
+
m=audio 63450 RTP/AVP 110 127
|
|
909
|
+
a=rtpmap:110 iLBC/8000
|
|
910
|
+
a=fmtp:110 mode=20
|
|
911
|
+
a=rtpmap:127 telephone-event/8000
|
|
912
|
+
`.replace( /\r\n/g, "\n" ).replace( /\n/g, "\r\n" )
|
|
913
|
+
|
|
914
|
+
const sdpobj = sdp.create( polysdp )
|
|
915
|
+
|
|
916
|
+
sdpobj.select( sdpobj.intersection( "g722 pcma pcmu ilbc", true ) )
|
|
917
|
+
|
|
918
|
+
const respsdp = sdp.create()
|
|
919
|
+
.addcodecs( sdpobj.selected.name )
|
|
920
|
+
.setconnectionaddress( "1.1.1.1" )
|
|
921
|
+
.setaudioport( 10000 )
|
|
922
|
+
.setdynamepayloadtypes( sdpobj )
|
|
923
|
+
|
|
924
|
+
const outsdpstring = respsdp.toString()
|
|
925
|
+
|
|
926
|
+
expect( outsdpstring ).include( outsdpstring, "m=audio 10000 RTP/AVP 110" )
|
|
927
|
+
expect( outsdpstring ).include( outsdpstring, "a=rtpmap:110 ilbc/8000" )
|
|
928
|
+
|
|
929
|
+
} )
|
|
901
930
|
} )
|