Skip to content

Commit 74db90c

Browse files
author
mesut
committed
username pass not required
1 parent a8061a9 commit 74db90c

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

apps/backend/src/routes/phone-numbers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ router.post('/sip-trunk', async (req: Request, res: Response) => {
181181
const { phoneNumber, friendlyName, username, password, domain, proxy } = req.body;
182182
const userId = (req as any).user.id;
183183

184-
if (!phoneNumber || !username || !password || !domain) {
184+
if (!phoneNumber || !domain) {
185185
return res.status(400).json({
186-
error: 'Phone number, username, password, and domain are required'
186+
error: 'Phone number and domain are required'
187187
});
188188
}
189189

@@ -225,8 +225,8 @@ router.post('/sip-trunk', async (req: Request, res: Response) => {
225225
console.log(`\n📞 Step 2: Saving phone number to database...`);
226226

227227
const configuration = {
228-
username,
229-
password,
228+
username: username || null,
229+
password: password || null,
230230
domain,
231231
proxy: proxy || null,
232232
};

apps/backend/src/services/livekitSipConfigService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ interface CreateTwilioTrunkParams {
99

1010
interface CreateSipProviderTrunkParams {
1111
phoneNumber: string;
12-
username: string;
13-
password: string;
12+
username?: string;
13+
password?: string;
1414
domain: string;
1515
proxy?: string;
1616
}
@@ -85,8 +85,8 @@ export class LiveKitSipConfigService {
8585
[phoneNumber],
8686
{
8787
transport: 1, // TCP for better reliability with SIP providers
88-
authUsername: username,
89-
authPassword: password,
88+
...(username && { authUsername: username }),
89+
...(password && { authPassword: password }),
9090
}
9191
);
9292

apps/frontend/src/api/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const phoneNumbersApi = {
6868
return response.data;
6969
},
7070

71-
createSipTrunk: async (data: { phoneNumber: string; friendlyName: string; username: string; password: string; domain: string; proxy?: string }) => {
71+
createSipTrunk: async (data: { phoneNumber: string; friendlyName: string; username?: string; password?: string; domain: string; proxy?: string }) => {
7272
const response = await client.post('/phone-numbers/sip-trunk', data);
7373
return response.data;
7474
},

0 commit comments

Comments
 (0)