mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-01 08:59:46 +02:00
feat: add websocket configuration for ARI
This commit is contained in:
parent
e0f43ccf27
commit
1821872f7a
13 changed files with 607 additions and 49 deletions
|
|
@ -57,6 +57,7 @@ interface TelephonyConfigForm {
|
|||
ari_endpoint?: string;
|
||||
app_name?: string;
|
||||
app_password?: string;
|
||||
ws_client_name?: string;
|
||||
// Common field - multiple phone numbers
|
||||
from_numbers: string[];
|
||||
}
|
||||
|
|
@ -153,6 +154,7 @@ export default function ConfigureTelephonyPage() {
|
|||
setValue("ari_endpoint", ariConfig.ari_endpoint);
|
||||
setValue("app_name", ariConfig.app_name);
|
||||
setValue("app_password", ariConfig.app_password);
|
||||
setValue("ws_client_name", ariConfig.ws_client_name);
|
||||
setValue("from_numbers", ariConfig.from_numbers?.length > 0 ? ariConfig.from_numbers : [""]);
|
||||
}
|
||||
}
|
||||
|
|
@ -254,6 +256,7 @@ export default function ConfigureTelephonyPage() {
|
|||
ari_endpoint: data.ari_endpoint!,
|
||||
app_name: data.app_name!,
|
||||
app_password: data.app_password!,
|
||||
ws_client_name: data.ws_client_name || "",
|
||||
} as AriConfigurationRequest;
|
||||
}
|
||||
|
||||
|
|
@ -898,6 +901,18 @@ export default function ConfigureTelephonyPage() {
|
|||
)}
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="ws_client_name">WebSocket Client Name</Label>
|
||||
<Input
|
||||
id="ws_client_name"
|
||||
placeholder="dograh_staging"
|
||||
{...register("ws_client_name")}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Connection name from Asterisk's websocket_client.conf for external media streaming
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>SIP Extensions / Numbers (Optional)</Label>
|
||||
{fromNumbers.map((number, index) => (
|
||||
|
|
|
|||
|
|
@ -238,9 +238,14 @@ export const PhoneCallDialog = ({
|
|||
{callLoading ? "Calling..." : "Start Call"}
|
||||
</Button>
|
||||
) : (
|
||||
<Button onClick={() => onOpenChange(false)}>
|
||||
Close
|
||||
</Button>
|
||||
<>
|
||||
<Button variant="outline" onClick={() => { setCallSuccessMsg(null); setCallError(null); }}>
|
||||
Call Again
|
||||
</Button>
|
||||
<Button onClick={() => onOpenChange(false)}>
|
||||
Close
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</DialogFooter>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,10 @@ export type AriConfigurationRequest = {
|
|||
* ARI user password
|
||||
*/
|
||||
app_password: string;
|
||||
/**
|
||||
* websocket_client.conf connection name for externalMedia (e.g., dograh_staging)
|
||||
*/
|
||||
ws_client_name?: string;
|
||||
/**
|
||||
* List of SIP extensions/numbers for outbound calls (optional)
|
||||
*/
|
||||
|
|
@ -50,6 +54,7 @@ export type AriConfigurationResponse = {
|
|||
ari_endpoint: string;
|
||||
app_name: string;
|
||||
app_password: string;
|
||||
ws_client_name?: string;
|
||||
from_numbers: Array<string>;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue