mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-04-11 18:08:16 +00:00
feat: Ozonetel V3 dial endpoint, worklist query fixes
- Switch outbound dial to /CAServicesV3/mdlConnection.php (tbManualDial) - Use both Apikey + Basic Auth headers matching Ozonetel toolbar pattern - Auto-login agent before dial attempt - Dial controller returns 502 (not 401) for Ozonetel errors to prevent session logout - Fix worklist: remove non-existent callId from followUp query - Fix worklist: use unquoted MISSED enum, remove callerNumber subfield issue - Worklist controller resolves agent name from platform currentUser API Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,6 +63,45 @@ export class OzonetelAgentService {
|
||||
}
|
||||
}
|
||||
|
||||
async dialCustomer(params: {
|
||||
agentId: string;
|
||||
customerNumber: string;
|
||||
campaignName?: string;
|
||||
}): Promise<{ type: string; agentId: string; user: string }> {
|
||||
const url = `https://${this.apiDomain}/CAServicesV3/mdlConnection.php`;
|
||||
const basicAuth = Buffer.from(`${this.accountId}:${this.apiKey}`).toString('base64');
|
||||
|
||||
this.logger.log(`Dialing ${params.customerNumber} for agent ${params.agentId}`);
|
||||
|
||||
try {
|
||||
const response = await axios.post(
|
||||
url,
|
||||
{
|
||||
type: 'tbManualDial',
|
||||
ns: 'ozonetel.cloudagent',
|
||||
customer: this.accountId,
|
||||
agentId: params.agentId,
|
||||
custNumber: params.customerNumber,
|
||||
campaignName: params.campaignName ?? 'Inbound_918062873123',
|
||||
timestamp: Date.now(),
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
'Apikey': this.apiKey,
|
||||
'Authorization': `Basic ${basicAuth}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
this.logger.log(`Dial response: ${JSON.stringify(response.data)}`);
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
this.logger.error(`Dial failed: ${error.response?.data?.message ?? error.message}`);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async logoutAgent(params: {
|
||||
agentId: string;
|
||||
password: string;
|
||||
|
||||
Reference in New Issue
Block a user