Skip to main content
Glama

phone_get_active_calls

Retrieve a real-time list of active phone calls on the Asterisk S2S MCP Server for monitoring or managing ongoing conversations efficiently.

Instructions

Obtener lista de llamadas telefónicas activas en este momento

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.ts:144-168 (registration)
    MCP server tool registration for 'phone_get_active_calls'. Defines description, empty input schema, and thin async handler that calls phoneTools.getActiveCalls() and formats response as text.
    server.tool( "phone_get_active_calls", "Obtener lista de llamadas telefónicas activas en este momento", {}, async () => { const result = await phoneTools.getActiveCalls(); if (result.length === 0) { return { content: [{ type: "text", text: "📵 No hay llamadas activas en este momento" }], }; } const activeText = result.map(call => `**${call.callId}** - ${call.usuario} (${call.telefono})\n📞 Estado: ${call.status}\n🎯 Propósito: ${call.proposito}\n⏱️ Iniciada: ${call.startTime || 'N/A'}` ).join('\n\n'); return { content: [{ type: "text", text: `📞 **Llamadas Activas (${result.length})**\n\n${activeText}` }], }; } );
  • Async wrapper function getActiveCalls() that delegates to phoneOps.getActiveCalls() and maps the CallStatus objects to a simplified response structure including duration.
    export async function getActiveCalls(): Promise<Array<{ callId: string; status: string; usuario: string; telefono: string; proposito: string; startTime?: string; duration?: number; }>> { return phoneOps.getActiveCalls().map(call => ({ callId: call.callId, status: call.status, usuario: call.usuario, telefono: call.telefono, proposito: call.proposito, startTime: call.startTime, duration: call.duration })); }
  • Core implementation of getActiveCalls(): Returns all active calls from the in-memory activeCalls Map.
    export function getActiveCalls(): CallStatus[] { return Array.from(activeCalls.values()); }
  • In-memory Map storing active CallStatus objects, populated during makePhoneCall and updated in other operations.
    const activeCalls = new Map<string, CallStatus>();

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gcorroto/mcp-s2s-asterisk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server