refactor: move inbound config
This commit is contained in:
@@ -68,7 +68,7 @@ function resolveSession(opts: {
|
||||
to?: string;
|
||||
sessionId?: string;
|
||||
}): SessionResolution {
|
||||
const sessionCfg = opts.cfg.inbound?.session;
|
||||
const sessionCfg = opts.cfg.session;
|
||||
const scope = sessionCfg?.scope ?? "per-sender";
|
||||
const mainKey = sessionCfg?.mainKey ?? "main";
|
||||
const idleMinutes = Math.max(
|
||||
@@ -150,7 +150,7 @@ export async function agentCommand(
|
||||
});
|
||||
const workspaceDir = workspace.dir;
|
||||
|
||||
const allowFrom = (cfg.inbound?.allowFrom ?? [])
|
||||
const allowFrom = (cfg.routing?.allowFrom ?? [])
|
||||
.map((val) => normalizeE164(val))
|
||||
.filter((val) => val.length > 1);
|
||||
|
||||
@@ -421,7 +421,7 @@ export async function agentCommand(
|
||||
if (deliver) {
|
||||
if (deliveryProvider === "whatsapp" && !whatsappTarget) {
|
||||
const err = new Error(
|
||||
"Delivering to WhatsApp requires --to <E.164> or inbound.allowFrom[0]",
|
||||
"Delivering to WhatsApp requires --to <E.164> or routing.allowFrom[0]",
|
||||
);
|
||||
if (!bestEffortDeliver) throw err;
|
||||
logDeliveryError(err);
|
||||
|
||||
Reference in New Issue
Block a user