mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
Feature/incoming refer (#76)
* Dial: handle incoming REFER on either leg by calling referHook, if configured * lint * modify payload of referHook * support target.trunk on rest createCall api * bugfix: gather partial result hook was not working * lint * handling of incoming REFER
This commit is contained in:
@@ -27,6 +27,7 @@ class CallInfo {
|
||||
this.to = req.calledNumber;
|
||||
this.callId = req.get('Call-ID');
|
||||
this.sipStatus = 100;
|
||||
this.sipReason = 'Trying';
|
||||
this.callStatus = CallStatus.Trying;
|
||||
this.originatingSipIp = req.get('X-Forwarded-For');
|
||||
this.originatingSipTrunkName = req.get('X-Originating-Carrier');
|
||||
@@ -45,6 +46,7 @@ class CallInfo {
|
||||
this.callId = req.get('Call-ID');
|
||||
this.callStatus = CallStatus.Trying,
|
||||
this.sipStatus = 100;
|
||||
this.sipReason = 'Trying';
|
||||
}
|
||||
else if (this.direction === CallDirection.None) {
|
||||
// outbound SMS
|
||||
@@ -65,6 +67,7 @@ class CallInfo {
|
||||
this.callStatus = CallStatus.Trying,
|
||||
this.callId = req.get('Call-ID');
|
||||
this.sipStatus = 100;
|
||||
this.sipReason = 'Trying';
|
||||
this.from = from || req.callingNumber;
|
||||
this.to = to;
|
||||
if (tag) this._customerData = tag;
|
||||
@@ -81,9 +84,10 @@ class CallInfo {
|
||||
* @param {string} callStatus - current call status
|
||||
* @param {number} sipStatus - current sip status
|
||||
*/
|
||||
updateCallStatus(callStatus, sipStatus) {
|
||||
updateCallStatus(callStatus, sipStatus, sipReason) {
|
||||
this.callStatus = callStatus;
|
||||
if (sipStatus) this.sipStatus = sipStatus;
|
||||
if (sipReason) this.sipReason = sipReason;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,6 +110,7 @@ class CallInfo {
|
||||
to: this.to,
|
||||
callId: this.callId,
|
||||
sipStatus: this.sipStatus,
|
||||
sipReason: this.sipReason,
|
||||
callStatus: this.callStatus,
|
||||
callerId: this.callerId,
|
||||
accountSid: this.accountSid,
|
||||
|
||||
Reference in New Issue
Block a user