opensips-js 0.1.27 → 0.1.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/dist/index.d.ts +2 -0
- package/dist/opensips-js.cjs.js +1 -1
- package/dist/opensips-js.es.js +10 -8
- package/dist/opensips-js.iife.js +1 -1
- package/dist/opensips-js.umd.js +1 -1
- package/package.json +1 -1
- package/src/types/rtc.d.ts +2 -0
package/dist/index.d.ts
CHANGED
package/dist/opensips-js.cjs.js
CHANGED
|
@@ -139,7 +139,7 @@ ${t}
|
|
|
139
139
|
`;return this.body&&(t+=`\r
|
|
140
140
|
${this.body}\r
|
|
141
141
|
`),t+=`-------${this.ident}$\r
|
|
142
|
-
`,t}}const Re={STATUS_NULL:0,STATUS_INVITE_SENT:1,STATUS_1XX_RECEIVED:2,STATUS_INVITE_RECEIVED:3,STATUS_WAITING_FOR_ANSWER:4,STATUS_ANSWERED:5,STATUS_WAITING_FOR_ACK:6,STATUS_CANCELED:7,STATUS_TERMINATED:8,STATUS_CONFIRMED:9};class nu extends ft.EventEmitter{constructor(t){super(),this._id=null,this.my_ip="127.0.0.1",this._ua=t,this.auth_id=ke.createRandomToken(10),this._status=Re.STATUS_NULL,this._dialog=null,this._earlyDialogs={},this._contact=null,this._from_tag=null,this._to_tag=null,this._msgHistory=[],this.target_addr=[],this.my_addr=[],this.credentials={username:t._configuration.authorization_user,ha1:t._configuration.ha1,realm:t._configuration.realm},this._request=null,this.status="new",this.target="",this.message="",this._connectionPromiseQueue=Promise.resolve(),this._timers={ackTimer:null,expiresTimer:null,invite2xxTimer:null,userNoAnswerTimer:null},this._direction=null,this._local_identity=null,this._remote_identity=null,this._start_time=null,this._end_time=null,this._tones=null,this._sessionTimers={enabled:this._ua.configuration.session_timers,refreshMethod:this._ua.configuration.session_timers_refresh_method,defaultExpires:H.SESSION_EXPIRES,currentExpires:null,running:!1,refresher:!1,timer:null},this._msrpKeepAliveTimer=null}static get C(){return Re}get direction(){return this._direction}get connection(){return this._connection}get id(){return this._id}connect(t=""){t!==""&&(this._direction="outgoing"),this.target=t
|
|
142
|
+
`,t}}const Re={STATUS_NULL:0,STATUS_INVITE_SENT:1,STATUS_1XX_RECEIVED:2,STATUS_INVITE_RECEIVED:3,STATUS_WAITING_FOR_ANSWER:4,STATUS_ANSWERED:5,STATUS_WAITING_FOR_ACK:6,STATUS_CANCELED:7,STATUS_TERMINATED:8,STATUS_CONFIRMED:9};class nu extends ft.EventEmitter{constructor(t){super(),this._id=null,this.my_ip="127.0.0.1",this._ua=t,this.auth_id=ke.createRandomToken(10),this._status=Re.STATUS_NULL,this._dialog=null,this._earlyDialogs={},this._contact=null,this._from_tag=null,this._to_tag=null,this._msgHistory=[],this.target_addr=[],this.my_addr=[],this.credentials={username:t._configuration.authorization_user,ha1:t._configuration.ha1,realm:t._configuration.realm},this._request=null,this.status="new",this.target="",this.message="",this._connectionPromiseQueue=Promise.resolve(),this._timers={ackTimer:null,expiresTimer:null,invite2xxTimer:null,userNoAnswerTimer:null},this._direction=null,this._local_identity=null,this._remote_identity=null,this._start_time=null,this._end_time=null,this._tones=null,this._sessionTimers={enabled:this._ua.configuration.session_timers,refreshMethod:this._ua.configuration.session_timers_refresh_method,defaultExpires:H.SESSION_EXPIRES,currentExpires:null,running:!1,refresher:!1,timer:null},this._msrpKeepAliveTimer=null}static get C(){return Re}get direction(){return this._direction}get connection(){return this._connection}get id(){return this._id}connect(t=""){t!==""&&(this._direction="outgoing"),this.target=t;const n=this._ua.options.msrpWs?"ws":"wss";this._connection=new WebSocket(`${n}://${this._ua.options.msrpDomain||this._ua._configuration.realm}`,"msrp"),this._connection.binaryType="arraybuffer",this._connection.onopen=a=>{console.log("open",a),this.onopen()},this._connection.onclose=a=>{console.log("close",a),this.onclose()},this._connection.onmessage=a=>{console.log("msg",a),this.onmessage(a)},this._connection.onerror=a=>{console.log("error",a),this.onerror()}}_sendKeepAlive(){const t=new ur("");t.method="SEND";let n="";this.my_addr[1]&&(n=this.my_addr[1]),this.target_addr[1]&&(n+=" "+this.target_addr[1]),this.target_addr[0]&&(n+=" "+this.target_addr[0]),t.addHeader("To-Path",n),t.addHeader("From-Path",`${this.my_addr[0]}`),t.addHeader("Message-ID",ke.createRandomToken(10)),t.addHeader("Byte-Range","0-0/0"),t.addHeader("Content-Type","text/plain"),t.body="",this._connection.send(t.toString())}answer(){if(!this._createDialog(this._request,"UAS")){this._request.reply(500,"Error creating dialog");return}this._status=Re.STATUS_ANSWERED,clearTimeout(this._timers.userNoAnswerTimer),this.connect()}acceptParty(t){this._request.parseSDP(!0),this._request.reply(200,"OK",[],`v=0
|
|
143
143
|
o=- 4232740119537112802 2 IN IP4 ${this.my_ip}
|
|
144
144
|
c=IN IP4 ${this.my_ip}
|
|
145
145
|
t=0 0
|
package/dist/opensips-js.es.js
CHANGED
|
@@ -18962,14 +18962,16 @@ class nu extends ft.EventEmitter {
|
|
|
18962
18962
|
return this._id;
|
|
18963
18963
|
}
|
|
18964
18964
|
connect(t = "") {
|
|
18965
|
-
t !== "" && (this._direction = "outgoing"), this.target = t
|
|
18966
|
-
|
|
18967
|
-
}, this._connection.
|
|
18968
|
-
console.log("
|
|
18969
|
-
}, this._connection.
|
|
18970
|
-
console.log("
|
|
18971
|
-
}, this._connection.
|
|
18972
|
-
console.log("
|
|
18965
|
+
t !== "" && (this._direction = "outgoing"), this.target = t;
|
|
18966
|
+
const n = this._ua.options.msrpWs ? "ws" : "wss";
|
|
18967
|
+
this._connection = new WebSocket(`${n}://${this._ua.options.msrpDomain || this._ua._configuration.realm}`, "msrp"), this._connection.binaryType = "arraybuffer", this._connection.onopen = (a) => {
|
|
18968
|
+
console.log("open", a), this.onopen();
|
|
18969
|
+
}, this._connection.onclose = (a) => {
|
|
18970
|
+
console.log("close", a), this.onclose();
|
|
18971
|
+
}, this._connection.onmessage = (a) => {
|
|
18972
|
+
console.log("msg", a), this.onmessage(a);
|
|
18973
|
+
}, this._connection.onerror = (a) => {
|
|
18974
|
+
console.log("error", a), this.onerror();
|
|
18973
18975
|
};
|
|
18974
18976
|
}
|
|
18975
18977
|
_sendKeepAlive() {
|
package/dist/opensips-js.iife.js
CHANGED
|
@@ -139,7 +139,7 @@ ${t}
|
|
|
139
139
|
`;return this.body&&(t+=`\r
|
|
140
140
|
${this.body}\r
|
|
141
141
|
`),t+=`-------${this.ident}$\r
|
|
142
|
-
`,t}}const Ce={STATUS_NULL:0,STATUS_INVITE_SENT:1,STATUS_1XX_RECEIVED:2,STATUS_INVITE_RECEIVED:3,STATUS_WAITING_FOR_ANSWER:4,STATUS_ANSWERED:5,STATUS_WAITING_FOR_ACK:6,STATUS_CANCELED:7,STATUS_TERMINATED:8,STATUS_CONFIRMED:9};class Eu extends ct.EventEmitter{constructor(t){super(),this._id=null,this.my_ip="127.0.0.1",this._ua=t,this.auth_id=Pe.createRandomToken(10),this._status=Ce.STATUS_NULL,this._dialog=null,this._earlyDialogs={},this._contact=null,this._from_tag=null,this._to_tag=null,this._msgHistory=[],this.target_addr=[],this.my_addr=[],this.credentials={username:t._configuration.authorization_user,ha1:t._configuration.ha1,realm:t._configuration.realm},this._request=null,this.status="new",this.target="",this.message="",this._connectionPromiseQueue=Promise.resolve(),this._timers={ackTimer:null,expiresTimer:null,invite2xxTimer:null,userNoAnswerTimer:null},this._direction=null,this._local_identity=null,this._remote_identity=null,this._start_time=null,this._end_time=null,this._tones=null,this._sessionTimers={enabled:this._ua.configuration.session_timers,refreshMethod:this._ua.configuration.session_timers_refresh_method,defaultExpires:H.SESSION_EXPIRES,currentExpires:null,running:!1,refresher:!1,timer:null},this._msrpKeepAliveTimer=null}static get C(){return Ce}get direction(){return this._direction}get connection(){return this._connection}get id(){return this._id}connect(t=""){t!==""&&(this._direction="outgoing"),this.target=t
|
|
142
|
+
`,t}}const Ce={STATUS_NULL:0,STATUS_INVITE_SENT:1,STATUS_1XX_RECEIVED:2,STATUS_INVITE_RECEIVED:3,STATUS_WAITING_FOR_ANSWER:4,STATUS_ANSWERED:5,STATUS_WAITING_FOR_ACK:6,STATUS_CANCELED:7,STATUS_TERMINATED:8,STATUS_CONFIRMED:9};class Eu extends ct.EventEmitter{constructor(t){super(),this._id=null,this.my_ip="127.0.0.1",this._ua=t,this.auth_id=Pe.createRandomToken(10),this._status=Ce.STATUS_NULL,this._dialog=null,this._earlyDialogs={},this._contact=null,this._from_tag=null,this._to_tag=null,this._msgHistory=[],this.target_addr=[],this.my_addr=[],this.credentials={username:t._configuration.authorization_user,ha1:t._configuration.ha1,realm:t._configuration.realm},this._request=null,this.status="new",this.target="",this.message="",this._connectionPromiseQueue=Promise.resolve(),this._timers={ackTimer:null,expiresTimer:null,invite2xxTimer:null,userNoAnswerTimer:null},this._direction=null,this._local_identity=null,this._remote_identity=null,this._start_time=null,this._end_time=null,this._tones=null,this._sessionTimers={enabled:this._ua.configuration.session_timers,refreshMethod:this._ua.configuration.session_timers_refresh_method,defaultExpires:H.SESSION_EXPIRES,currentExpires:null,running:!1,refresher:!1,timer:null},this._msrpKeepAliveTimer=null}static get C(){return Ce}get direction(){return this._direction}get connection(){return this._connection}get id(){return this._id}connect(t=""){t!==""&&(this._direction="outgoing"),this.target=t;const n=this._ua.options.msrpWs?"ws":"wss";this._connection=new WebSocket(`${n}://${this._ua.options.msrpDomain||this._ua._configuration.realm}`,"msrp"),this._connection.binaryType="arraybuffer",this._connection.onopen=a=>{console.log("open",a),this.onopen()},this._connection.onclose=a=>{console.log("close",a),this.onclose()},this._connection.onmessage=a=>{console.log("msg",a),this.onmessage(a)},this._connection.onerror=a=>{console.log("error",a),this.onerror()}}_sendKeepAlive(){const t=new Vn("");t.method="SEND";let n="";this.my_addr[1]&&(n=this.my_addr[1]),this.target_addr[1]&&(n+=" "+this.target_addr[1]),this.target_addr[0]&&(n+=" "+this.target_addr[0]),t.addHeader("To-Path",n),t.addHeader("From-Path",`${this.my_addr[0]}`),t.addHeader("Message-ID",Pe.createRandomToken(10)),t.addHeader("Byte-Range","0-0/0"),t.addHeader("Content-Type","text/plain"),t.body="",this._connection.send(t.toString())}answer(){if(!this._createDialog(this._request,"UAS")){this._request.reply(500,"Error creating dialog");return}this._status=Ce.STATUS_ANSWERED,clearTimeout(this._timers.userNoAnswerTimer),this.connect()}acceptParty(t){this._request.parseSDP(!0),this._request.reply(200,"OK",[],`v=0
|
|
143
143
|
o=- 4232740119537112802 2 IN IP4 ${this.my_ip}
|
|
144
144
|
c=IN IP4 ${this.my_ip}
|
|
145
145
|
t=0 0
|
package/dist/opensips-js.umd.js
CHANGED
|
@@ -139,7 +139,7 @@ ${t}
|
|
|
139
139
|
`;return this.body&&(t+=`\r
|
|
140
140
|
${this.body}\r
|
|
141
141
|
`),t+=`-------${this.ident}$\r
|
|
142
|
-
`,t}}const Ce={STATUS_NULL:0,STATUS_INVITE_SENT:1,STATUS_1XX_RECEIVED:2,STATUS_INVITE_RECEIVED:3,STATUS_WAITING_FOR_ANSWER:4,STATUS_ANSWERED:5,STATUS_WAITING_FOR_ACK:6,STATUS_CANCELED:7,STATUS_TERMINATED:8,STATUS_CONFIRMED:9};class Eu extends ct.EventEmitter{constructor(t){super(),this._id=null,this.my_ip="127.0.0.1",this._ua=t,this.auth_id=Pe.createRandomToken(10),this._status=Ce.STATUS_NULL,this._dialog=null,this._earlyDialogs={},this._contact=null,this._from_tag=null,this._to_tag=null,this._msgHistory=[],this.target_addr=[],this.my_addr=[],this.credentials={username:t._configuration.authorization_user,ha1:t._configuration.ha1,realm:t._configuration.realm},this._request=null,this.status="new",this.target="",this.message="",this._connectionPromiseQueue=Promise.resolve(),this._timers={ackTimer:null,expiresTimer:null,invite2xxTimer:null,userNoAnswerTimer:null},this._direction=null,this._local_identity=null,this._remote_identity=null,this._start_time=null,this._end_time=null,this._tones=null,this._sessionTimers={enabled:this._ua.configuration.session_timers,refreshMethod:this._ua.configuration.session_timers_refresh_method,defaultExpires:H.SESSION_EXPIRES,currentExpires:null,running:!1,refresher:!1,timer:null},this._msrpKeepAliveTimer=null}static get C(){return Ce}get direction(){return this._direction}get connection(){return this._connection}get id(){return this._id}connect(t=""){t!==""&&(this._direction="outgoing"),this.target=t
|
|
142
|
+
`,t}}const Ce={STATUS_NULL:0,STATUS_INVITE_SENT:1,STATUS_1XX_RECEIVED:2,STATUS_INVITE_RECEIVED:3,STATUS_WAITING_FOR_ANSWER:4,STATUS_ANSWERED:5,STATUS_WAITING_FOR_ACK:6,STATUS_CANCELED:7,STATUS_TERMINATED:8,STATUS_CONFIRMED:9};class Eu extends ct.EventEmitter{constructor(t){super(),this._id=null,this.my_ip="127.0.0.1",this._ua=t,this.auth_id=Pe.createRandomToken(10),this._status=Ce.STATUS_NULL,this._dialog=null,this._earlyDialogs={},this._contact=null,this._from_tag=null,this._to_tag=null,this._msgHistory=[],this.target_addr=[],this.my_addr=[],this.credentials={username:t._configuration.authorization_user,ha1:t._configuration.ha1,realm:t._configuration.realm},this._request=null,this.status="new",this.target="",this.message="",this._connectionPromiseQueue=Promise.resolve(),this._timers={ackTimer:null,expiresTimer:null,invite2xxTimer:null,userNoAnswerTimer:null},this._direction=null,this._local_identity=null,this._remote_identity=null,this._start_time=null,this._end_time=null,this._tones=null,this._sessionTimers={enabled:this._ua.configuration.session_timers,refreshMethod:this._ua.configuration.session_timers_refresh_method,defaultExpires:H.SESSION_EXPIRES,currentExpires:null,running:!1,refresher:!1,timer:null},this._msrpKeepAliveTimer=null}static get C(){return Ce}get direction(){return this._direction}get connection(){return this._connection}get id(){return this._id}connect(t=""){t!==""&&(this._direction="outgoing"),this.target=t;const n=this._ua.options.msrpWs?"ws":"wss";this._connection=new WebSocket(`${n}://${this._ua.options.msrpDomain||this._ua._configuration.realm}`,"msrp"),this._connection.binaryType="arraybuffer",this._connection.onopen=a=>{console.log("open",a),this.onopen()},this._connection.onclose=a=>{console.log("close",a),this.onclose()},this._connection.onmessage=a=>{console.log("msg",a),this.onmessage(a)},this._connection.onerror=a=>{console.log("error",a),this.onerror()}}_sendKeepAlive(){const t=new Vn("");t.method="SEND";let n="";this.my_addr[1]&&(n=this.my_addr[1]),this.target_addr[1]&&(n+=" "+this.target_addr[1]),this.target_addr[0]&&(n+=" "+this.target_addr[0]),t.addHeader("To-Path",n),t.addHeader("From-Path",`${this.my_addr[0]}`),t.addHeader("Message-ID",Pe.createRandomToken(10)),t.addHeader("Byte-Range","0-0/0"),t.addHeader("Content-Type","text/plain"),t.body="",this._connection.send(t.toString())}answer(){if(!this._createDialog(this._request,"UAS")){this._request.reply(500,"Error creating dialog");return}this._status=Ce.STATUS_ANSWERED,clearTimeout(this._timers.userNoAnswerTimer),this.connect()}acceptParty(t){this._request.parseSDP(!0),this._request.reply(200,"OK",[],`v=0
|
|
143
143
|
o=- 4232740119537112802 2 IN IP4 ${this.my_ip}
|
|
144
144
|
c=IN IP4 ${this.my_ip}
|
|
145
145
|
t=0 0
|
package/package.json
CHANGED