claude-phone-local 2.0.13 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-phone-local",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "Local/offline fork of NetworkChuck's claude-phone: talk to Claude Code over 3CX/SIP with faster-whisper STT + Piper TTS in one Docker container.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -77,6 +77,10 @@ function getRandomThinkingPhrase() {
77
77
  return THINKING_PHRASES[Math.floor(Math.random() * THINKING_PHRASES.length)];
78
78
  }
79
79
 
80
+ function getRandomWaitingPhrase() {
81
+ return WAITING_PHRASES[Math.floor(Math.random() * WAITING_PHRASES.length)];
82
+ }
83
+
80
84
  function extractCallerId(req) {
81
85
  var from = req.get("From") || "";
82
86
  var match = from.match(/sip:([+\d]+)@/);
@@ -189,7 +193,12 @@ async function playInterruptible(endpoint, session, url) {
189
193
  session.once('barge-in', onBarge);
190
194
  session.setBargeInEnabled(true);
191
195
  try {
192
- await endpoint.play(url);
196
+ console.log('[' + new Date().toISOString() + '] PLAY (interruptible): ' + url);
197
+ const playResult = await endpoint.play(url);
198
+ console.log('[' + new Date().toISOString() + '] PLAY complete: ' + url + ' result=' + JSON.stringify(playResult));
199
+ } catch (playErr) {
200
+ console.log('[' + new Date().toISOString() + '] PLAY FAILED: ' + url + ' error=' + playErr.message);
201
+ throw playErr;
193
202
  } finally {
194
203
  session.setBargeInEnabled(false);
195
204
  session.removeListener('barge-in', onBarge);
@@ -384,8 +393,10 @@ async function conversationLoop(endpoint, dialog, callUuid, options, deviceConfi
384
393
  let round = 0;
385
394
  while (waiting) {
386
395
  round++;
396
+ const isSpeakRound = round % SPEAK_EVERY === 0;
397
+ console.log('[' + new Date().toISOString() + '] KEEPALIVE round ' + round + ': ' + (isSpeakRound ? 'speech' : 'hold music'));
387
398
  try {
388
- const clipUrl = (round % SPEAK_EVERY === 0)
399
+ const clipUrl = isSpeakRound
389
400
  ? await ttsService.generateSpeech(getRandomWaitingPhrase(), turnVoice)
390
401
  : HOLD_MUSIC_URL;
391
402
  if (!waiting) break;