hii getting error in this line from...
# ask-ai
m
hii getting error in this line from livekit.plugins.turn_detector.english import EnglishModel and the error is 013850.263 ERROR livekit.agents Error in _user_turn_completed_task Traceback (most recent call last): File "C:\Users\hi\Desktop\realcopy\.venv\Lib\site-packages\livekit\agents\utils\log.py", line 16, in async_fn_logs return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hi\Desktop\realcopy\.venv\Lib\site-packages\livekit\agents\voice\agent_activity.py", line 1547, in _user_turn_completed_task model_name=self._turn_detection.model, model_provider=self._turn_detection.provider ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'EnglishModel' object has no attribute 'model' cananyone help in solving
t
Thanks for reaching out, Rithwikreddy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I see you're hitting: AttributeError: 'EnglishModel' object has no attribute 'model' This happens because LiveKit's AgentSession expects the turn_detection object to expose
.model
and
.provider
, but
EnglishModel
(the turn-detector plugin) does not provide those attributes. You can fix this in one of two ways: • Option 1 — Switch to the Multilingual turn detector: a. Replace your import with:
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel
1. Initialize the session with
turn_detection=MultilingualModel()
. • Option 2 — Keep EnglishModel but avoid the missing-attribute access: a. If you control code that references
self._turn_detection.model
/
.provider
, stop accessing those attributes. b. If the access comes from the LiveKit SDK, update the package to the latest
livekit-agents
release:
Copy code
pip install --upgrade "livekit-agents[turn-detector]"
1. Re-download plugin files if needed:
Copy code
python -m livekit.agents.download-files
If after trying the MultilingualModel or updating the package you still see the error, tell me: • the exact code where you instantiate
AgentSession
(or paste the
turn_detection=
line), • your installed
livekit-agents
version (
pip show livekit-agents
), and • the full traceback. I’ll help you from there. Sources: Turn detection and interruptions | LiveKit Docs | LiveKit turn detector plugin | LiveKit docs | Improving voice AI's turn detection with transformers
m
014849.497 ERROR livekit.agents Error in _user_turn_completed_task Traceback (most recent call last): File "C:\Users\hi\Desktop\realcopy\.venv\Lib\site-packages\livekit\agents\utils\log.py", line 16, in async_fn_logs return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hi\Desktop\realcopy\.venv\Lib\site-packages\livekit\agents\voice\agent_activity.py", line 1547, in _user_turn_completed_task model_name=self._turn_detection.model, model_provider=self._turn_detection.provider ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'EnglishModel' object has no attribute 'model'
t
Thanks — I’m following up on the same AttributeError for
EnglishModel
. To diagnose and fix this quickly I need a few details: 1. The code where you create the AgentSession (the line(s) that set
turn_detection=...
). 2. Your installed package version: output of
pip show livekit-agents
. 3. Have you tried updating the package and replacing
EnglishModel
with
MultilingualModel
? If so, what happened when you tried that? If you prefer, paste the small snippet that imports
EnglishModel
and constructs the session plus the full traceback. I’ll tell you the exact change to make next.
m
015530.457 ERROR livekit.agents Error in _user_turn_completed_task Traceback (most recent call last): File "C:\Users\hi\Desktop\realcopy\.venv\Lib\site-packages\livekit\agents\utils\log.py", line 16, in async_fn_logs return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hi\Desktop\realcopy\.venv\Lib\site-packages\livekit\agents\voice\agent_activity.py", line 1398, in _user_turn_completed_task await old_task File "C:\Users\hi\Desktop\realcopy\.venv\Lib\site-packages\livekit\agents\voice\agent_activity.py", line 405, in _context_aware_coro return await coro ^^^^^^^^^^ File "C:\Users\hi\Desktop\realcopy\.venv\Lib\site-packages\livekit\agents\utils\log.py", line 16, in async_fn_logs return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hi\Desktop\realcopy\.venv\Lib\site-packages\livekit\agents\voice\agent_activity.py", line 1547, in _user_turn_completed_task model_name=self._turn_detection.model, model_provider=self._turn_detection.provider ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'MultilingualModel' object has no attribute 'model'
t
Thanks — I see the same error now occurs for
MultilingualModel
. That confirms the SDK is attempting to read
.model
and
.provider
from the turn detector object, but those plugin classes don’t provide those attributes. Please provide two quick things so I can give the exact next step: 1. The
AgentSession
instantiation lines (the code that sets
turn_detection=...
). 2. Your installed package version: output of
pip show livekit-agents
. In the meantime, try this quick temporary workaround (adds the missing attributes without changing plugin behavior):
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel as _MultilingualModel

class MultilingualModel:
    def __init__(self):
        self._inner = _MultilingualModel()
        self.model = "livekit/turn-detector-multilingual"
        self.provider = "livekit"
    def __getattr__(self, name):
        return getattr(self._inner, name)

turn_detection = MultilingualModel()
# pass `turn_detection` to AgentSession as before
If you prefer English only, do the same wrapping for
EnglishModel
. after you send the two items above I’ll confirm whether you should instead upgrade
livekit-agents
or apply a different fix. Sources: LiveKit turn detector plugin | LiveKit docs
m
image.png
t
Thanks — I reviewed the terminal screenshot and logs. The key findings: • The turn_detector files downloaded successfully, but the startup log warns: "None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available…" • The missing ML runtime explains why the turn detector plugin classes may not fully initialize and why the agent later tries to access `.model`/`.provider` and fails. To get you unstuck, please do the following in order: 1. Confirm your livekit-agents version ◦ Run:
Copy code
pip show livekit-agents
• Paste the Version value here. 1. Install PyTorch (recommended) into your virtualenv so plugin models can load: ◦ For CPU-only on Windows:
Copy code
pip install torch --index-url https://download.pytorch.org/whl/cpu
• Or follow the official PyTorch selector at pytorch.org for the correct command if you need CUDA. 1. Restart your virtualenv and re-run the agent. Check the logs — the "Models won't be available" warning should disappear and the turn_detector should initialize fully. 2. If the AttributeError still appears afterward, paste: ◦ The
AgentSession
instantiation lines (the exact code where you set
turn_detection=...
). ◦ The
pip show livekit-agents
output you ran in step 1. ◦ The updated traceback (if any). Quick temporary workaround (use only if you can't install PyTorch yet): • Wrap the turn detector to add the missing attributes so the agent doesn't error:
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel as _MultilingualModel

class MultilingualModel:
    def __init__(self):
        self._inner = _MultilingualModel()
        self.model = "livekit/turn-detector-multilingual"
        self.provider = "livekit"
    def __getattr__(self, name):
        return getattr(self._inner, name)

turn_detection = MultilingualModel()
# pass `turn_detection` into AgentSession
Do step 1 and 2 first and tell me the results — I’ll tell you the exact next step based on the outputs.
m
image.png
t
Thanks — I can see you’re on livekit-agents 1.3.5. That confirms the SDK is recent enough; the remaining issue is that the turn-detector plugin classes don’t expose `.model`/`.provider`, and your environment also showed the "Models won't be available" message earlier. Next steps (do these in order): 1. Install PyTorch so the turn detector can load its model: ◦ CPU-only on Windows:
Copy code
pip install torch --index-url https://download.pytorch.org/whl/cpu
• Or use the appropriate command from https://pytorch.org if you need CUDA. 1. Re-download plugin model files and restart the agent:
Copy code
python -m livekit.agents.download-files
   # restart your app/agent after this
Confirm the startup logs no longer show "Models won't be available". 1. If you still get the AttributeError after step 2, either: ◦ Paste the exact
AgentSession(...)
lines where you set
turn_detection=...
, or ◦ Apply this temporary wrapper to add the missing attributes:
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel as _MultilingualModel

class MultilingualModel:
    def __init__(self):
        self._inner = _MultilingualModel()
        self.model = "livekit/turn-detector-multilingual"
        self.provider = "livekit"
    def __getattr__(self, name):
        return getattr(self._inner, name)

turn_detection = MultilingualModel()
# pass `turn_detection` into AgentSession
Tell me whether step 1+2 clear the warning and error. If not, paste your
AgentSession
instantiation and the updated traceback and I’ll give the exact fix. Sources: LiveKit turn detector plugin | LiveKit docs
m
still getting the same error installed the pytorch and downloadedfiles models wont avaliable error is gone but still the error is same
t
Thanks — I know this is frustrating. You’ve done the right setup (PyTorch installed, models downloaded, livekit-agents 1.3.5). The error now is a compatibility issue: the agent code expects the turn-detector instance to expose
.model
and
.provider
, but
MultilingualModel
(and
EnglishModel
) do not. Two quick options — pick one: Option A — Monkey-patch (fastest)
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel

turn_detection = MultilingualModel()
turn_detection.model = "livekit/turn-detector-multilingual"
turn_detection.provider = "livekit"

# pass turn_detection into AgentSession
Option B — Subclass (cleaner)
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel as BaseMultilingualModel

class FixedMultilingualModel(BaseMultilingualModel):
    def __init__(self, *a, **kw):
        super().__init__(*a, **kw)
        self.model = "livekit/turn-detector-multilingual"
        self.provider = "livekit"

turn_detection = FixedMultilingualModel()
# pass turn_detection into AgentSession
If you’ve already tried one of these and it didn’t help, paste: 1) The exact
AgentSession(...)
lines where you set
turn_detection=...
, and 2) The latest traceback (the lines around where it reads
model_name=...
). I’ll inspect that and give the exact fix. Sources: How does end-of-utterance detection work in conversations? | LiveKit turn detector plugin | LiveKit docs
m
image.png
t
Thanks — you’ve done the key steps (PyTorch installed, models downloaded, livekit-agents 1.3.5). The error now is a compatibility/usage issue: the agent expects the turn detector instance to expose
.model
and
.provider
, but the plugin class does not by default. Two safe fixes — pick one: Option 1 — Monkey-patch (quick)
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel

turn_detection = MultilingualModel()
turn_detection.model = "livekit/turn-detector-multilingual"
turn_detection.provider = "livekit"

session = AgentSession(
    stt=stt_instance,
    llm=llm_instance,
    tts=tts_instance,
    vad=vad_instance,
    turn_detection=turn_detection,
)
Option 2 — Subclass (cleaner)
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel as BaseMultilingualModel

class FixedMultilingualModel(BaseMultilingualModel):
    def __init__(self, *a, **kw):
        super().__init__(*a, **kw)
        self.model = "livekit/turn-detector-multilingual"
        self.provider = "livekit"

session = AgentSession(..., turn_detection=FixedMultilingualModel())
Also confirm your AgentSession usage matches this pattern (no inline attempts to set attributes inside the constructor). If the error persists after applying one of those, paste: 1) The exact
AgentSession(...)
call, and 2) The latest full traceback lines around where it reads
model_name=...
— I’ll give the precise next change. Sources: LiveKit turn detector plugin | LiveKit docs | Turn detection and interruptions | LiveKit Docs
m
031446.975 ERROR database_manager Error updating call session: relation "call_sessions" does not exist LINE 1: UPDATE call_sessions SET call_end_time = '2025-12-04T03144... ^ 031446.978 ERROR database_manager Error logging disposition: relation "call_dispositions" does not exist LINE 2: INSERT INTO call_dispositions ( ^
t
Thanks — you now have two separate issues: (A) the turn-detector AttributeError and (B) missing DB tables. Both are independent; here’s concise guidance to resolve each. A — Turn-detector AttributeError ('MultilingualModel' has no attribute 'model') • You’ve confirmed: PyTorch installed, models downloaded, livekit-agents 1.3.5 — so dependencies are fine. The remaining issue is that AgentSession expects
turn_detection
instances to expose
model
and
provider
, but the plugin classes don’t. • Fix options (choose one): Option 1 — Monkey-patch (fastest)
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel

  turn_detection = MultilingualModel()
  turn_detection.model = "livekit/turn-detector-multilingual"
  turn_detection.provider = "livekit"

  session = AgentSession(..., turn_detection=turn_detection)
Option 2 — Subclass (cleaner)
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel as BaseMultilingualModel

  class FixedMultilingualModel(BaseMultilingualModel):
      def __init__(self, *a, **kw):
          super().__init__(*a, **kw)
          self.model = "livekit/turn-detector-multilingual"
          self.provider = "livekit"

  session = AgentSession(..., turn_detection=FixedMultilingualModel())
• Ensure you pass the instance variable into
AgentSession
(do not attempt inline assignments inside the constructor). • If you apply one of the above and still get the error, paste the exact
AgentSession(...)
call and the updated traceback. B — Database errors (relation "call_sessions"/"call_dispositions" does not exist) • Your app is trying to UPDATE/INSERT to tables that aren’t created. Create them (example for PostgreSQL):
Copy code
CREATE TABLE IF NOT EXISTS call_sessions (
  id SERIAL PRIMARY KEY,
  room_name TEXT NOT NULL,
  call_start_time TIMESTAMPTZ DEFAULT NOW(),
  call_end_time TIMESTAMPTZ,
  participant_identity TEXT,
  status TEXT DEFAULT 'active'
);

CREATE TABLE IF NOT EXISTS call_dispositions (
  id SERIAL PRIMARY KEY,
  session_id INTEGER REFERENCES call_sessions(id),
  disposition_type TEXT NOT NULL,
  notes TEXT,
  recorded_at TIMESTAMPTZ DEFAULT NOW()
);
• If you use an ORM, define corresponding models and run migrations (Alembic/Django migrations). • Verify connection and schema: ◦ Confirm your database URL/credentials in the app match the DB you are checking. ◦ Run
\dt call_sessions
/
\dt call_dispositions
(psql) or query
information_schema.tables
. If you want, tell me: 1) The exact
AgentSession(...)
snippet you’re using (to confirm turn_detection is passed correctly). 2) Your DB type (Postgres/MySQL/SQLite) and whether you use migrations or raw SQL. I’ll provide the exact code/migration you should run next.
m
1)error is done and 2)its postgres
t
Great — glad the turn-detector error is resolved and thanks for confirming Postgres. Do you want: • The exact SQL to create the two tables I suggested earlier, tailored to Postgres? • Or a ready-to-run Alembic migration file for your project? Tell me which and I’ll provide it.
m
❌ Failed to connect to billing portal: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/health (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002086729D3D0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')) when will it allow next
t
That error means your client tried to open an HTTP connection to http://localhost:8000/api/health but the TCP connection was refused — the service on port 8000 is not accepting connections right now. Quick checklist to get it working and estimate “when” it will allow connections: 1. Is the billing service process running? ◦ On Windows: check Task Manager or run:
Copy code
netstat -ano | findstr :8000
If nothing listens on :8000, start the billing service. 1. If the process is running, confirm it’s bound to the expected interface: ◦ If it’s only bound to 127.0.0.1, localhost is fine; if bound to 0.0.0.0 it accepts external too. ◦ Use:
Copy code
netstat -ano | findstr LISTENING | findstr :8000
1. Check service logs for startup errors (port already in use, crash, missing config). Those logs tell you why it refused connections and roughly when it will be back (after you fix the logged error). 2. Firewall / antivirus: ◦ Windows Firewall can block incoming connections. Temporarily disable or add an allow rule for the service or port 8000 to test. 1. Confirm you’re calling the correct host/port and path: ◦ If the billing portal runs in a container or VM, ensure port forwarding is configured to host:8000. 1. If it’s a transient service (restarts on deploy), retry after starting/redeploying it. If you start it now, it should accept connections immediately — there’s no built-in delay. If you want, tell me: • How you start the billing portal (command or service manager), and • Any recent logs from that service or output from
netstat
above. I’ll guide you through the exact command or config change to get it reachable.
m
image.png
t
I see the call-session creation code screenshot — do you need help with: • the SQL/schema (create tables, migrations), • fixing an error from that function, or • wiring DB transactions/connection handling in Python? Tell me which and paste any error you're seeing (traceback) if you have one.
m
035732.815 ERROR database_manager Error creating call session: relation "call_session" does not exist LINE 2: INSERT INTO call_session ( ^
t
Thanks — the error shows your code is trying to INSERT into a table named
call_session
(singular), but your database has
call_sessions
(plural) or neither. Two quick fixes: Option A — Create the singular table (Postgres SQL)
Copy code
CREATE TABLE IF NOT EXISTS call_session (
  id SERIAL PRIMARY KEY,
  room_name TEXT NOT NULL,
  call_start_time TIMESTAMPTZ DEFAULT NOW(),
  call_end_time TIMESTAMPTZ,
  participant_identity TEXT,
  status TEXT DEFAULT 'active'
);
Option B — Prefer plural (recommended if other code uses
call_sessions
) • Update your INSERT/UPDATE SQL in the Python code to use
call_sessions
(plural) instead of
call_session
. • Or create a view/alias:
Copy code
CREATE TABLE IF NOT EXISTS call_sessions (...); -- as earlier
CREATE VIEW call_session AS SELECT * FROM call_sessions;
Pick one and tell me which you want. If you want, paste the Python function that does the INSERT and I’ll give the exact SQL change or migration file to run.
m
actually there is no call session table in my database
t
Got it — since the table is missing, create the two tables your code expects. Run these Postgres statements (adjust columns/types as you need): 1) Create call_sessions:
Copy code
CREATE TABLE IF NOT EXISTS call_sessions (
  id SERIAL PRIMARY KEY,
  room_name TEXT NOT NULL,
  call_start_time TIMESTAMPTZ DEFAULT NOW(),
  call_end_time TIMESTAMPTZ,
  participant_identity TEXT,
  status TEXT DEFAULT 'active'
);
2) Create call_dispositions (references call_sessions):
Copy code
CREATE TABLE IF NOT EXISTS call_dispositions (
  id SERIAL PRIMARY KEY,
  session_id INTEGER REFERENCES call_sessions(id) ON DELETE CASCADE,
  disposition_type TEXT NOT NULL,
  notes TEXT,
  recorded_at TIMESTAMPTZ DEFAULT NOW()
);
After running those: • Verify with psql:
\dt call_sessions
and
\dt call_dispositions
• Restart your app and re-test the flow that creates/updates sessions. If your code uses a different column set or table name (e.g., singular
call_session
), paste the INSERT/UPDATE SQL from your Python function and I’ll give the exact table definition or a migration to match it.
m
insert_query = """ INSERT INTO call_sessions ( session_id, customer_id, customer_phone, room_name, vicidial_call_id, vicidial_lead_id, call_status, detected_gender, personalized_greeting, timezone_greeting, extracted_variables ) VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s ) RETURNING session_id """ cur.execute(insert_query, ( session_data.get('session_id'), session_data.get('customer_id'), session_data.get('customer_phone'), session_data.get('room_name'), session_data.get('vicidial_call_id'), session_data.get('vicidial_lead_id'), session_data.get('call_status', 'initiated'), session_data.get('detected_gender'), session_data.get('personalized_greeting'), session_data.get('timezone_greeting'), json.dumps(session_data.get('extracted_variables', {})) ))
t
Thanks — I matched your INSERT to a table schema. Run this PostgreSQL SQL to create
call_sessions
so your INSERT succeeds (types chosen to match the fields you insert):
Copy code
CREATE TABLE IF NOT EXISTS call_sessions (
  session_id TEXT PRIMARY KEY,
  customer_id TEXT,
  customer_phone TEXT,
  room_name TEXT,
  vicidial_call_id TEXT,
  vicidial_lead_id TEXT,
  call_status TEXT DEFAULT 'initiated',
  detected_gender TEXT,
  personalized_greeting TEXT,
  timezone_greeting TEXT,
  extracted_variables JSONB,
  created_at TIMESTAMPTZ DEFAULT NOW()
);
Also create
call_dispositions
if you need it (referencing
call_sessions.session_id
):
Copy code
CREATE TABLE IF NOT EXISTS call_dispositions (
  id SERIAL PRIMARY KEY,
  session_id TEXT REFERENCES call_sessions(session_id) ON DELETE CASCADE,
  disposition_type TEXT NOT NULL,
  notes TEXT,
  recorded_at TIMESTAMPTZ DEFAULT NOW()
);
Steps to apply: 1. Connect to your Postgres DB (psql or PgAdmin) and run the two CREATE TABLE statements. 2. Verify tables exist: in psql run
\dt call_sessions
and
\dt call_dispositions
. 3. Restart your app and re-run the code that executes the INSERT. If you prefer
session_id
to be an integer sequence instead of TEXT, tell me and I’ll provide an adjusted schema and a migration. If you run into any error running these statements, paste the error and I’ll help fix it.
m
its done
def transfer_call_to_agent(self, lead_id: str, phone_number: str = None) -> Dict[str, Any]: """Transfer call to human agent using VICIdial ra_call_control with failover""" try: # PRIMARY: Find agent handling this lead by lead_id logger.info(f"🎯 PRIMARY: Finding agent by lead_id {lead_id}") agent_info = self.find_agent_by_lead(lead_id) # FAILOVER: If primary failed and phone_number provided, try finding by phone if not agent_info and phone_number: logger.warning(f"⚠️ Primary method failed, trying failover with phone {phone_number}") agent_info = self.find_agent_by_phone(phone_number) # If both methods failed if not agent_info: error_msg = f'No agent found for lead {lead_id}' if phone_number: error_msg += f' or phone {phone_number}' return { 'success': False, 'message': error_msg } # Build transfer URL base_url = self.config.url.replace('/vicidial/non_agent_api.php', '') transfer_url = f"{base_url}/agc/api.php" params = { 'source': self.config.source, 'user': self.config.username, 'pass': self.config.password, 'agent_user': agent_info['user'], 'function': 'ra_call_control', 'stage': 'INGROUPTRANSFER', 'ingroup_choices': 'INGAI', 'value': agent_info['callerid'] } # Log which method was successful method_used = "lead_id" if self.find_agent_by_lead(lead_id) else "phone_number" logger.info(f"✅ Found agent using {method_used} method") logger.info(f"Transferring call for lead {lead_id} to agent {agent_info['agent_name']} ({agent_info['user']})") response = self.session.get(transfer_url, params=params) response_text = response.text.strip() logger.debug(f"Transfer response: {response_text}") success = response.ok or 'SUCCESS' in response_text or 'TRANSFERRED' in response_text return { 'success': success, 'message': f"Transfer {'successful' if success else 'failed'}: {response_text}", 'agent_info': agent_info } except Exception as e: logger.error(f"Error transferring call: {e}") return { 'success': False, 'message': f'Transfer error: {str(e)}' } this my code for ra_call_control i dont know why call transer in not happening successfully its starting intiating loading logged agents and try to connect to them its diconnects in agents it shows only incall agents value(callerid) ready agents doest have caller id but the one who is in call how can we connect and one who dont have callerid as being in ready i want to know how this transfer function ra_call_control to make transfer success
t
Thanks — I can help. Quick checklist and targeted changes to make VICIdial
ra_call_control
transfers succeed and why your current flow may fail. First, what I need if this checklist doesn't fix it: • The exact
response_text
you get from the transfer request (you log it — paste it). • A short sample of the agent state output (which agents are READY vs INCALL and their callerid values). Checklist and fixes (in order): 1) Confirm correct transfer parameters •
function=ra_call_control
,
stage=INGROUPTRANSFER
,
ingroup_choices=INGAI
and
value=<callerid>
are valid, but
value
must match the agent identifier the dialplan expects. Often this is the agent’s extension/callerid, not the agent user id. Verify
agent_info['callerid']
contains the right transfer target (agent extension or channel name). 2) Use the agent’s extension/extension channel for transfers • Ready agents typically do not have a callerid because they aren’t on a channel. You must transfer into the agent’s extension/queue or an in-group endpoint that will ring ready agents. If
callerid
is empty for READY agents, use that agent’s extension or
agent_info['user']
mapped to extension. 3) Ensure the agent is in the proper ingroup • The agent must belong to the target ingroup (INGAI). Confirm agent’s ingroup membership in VICIdial and that
ingroup_choices
matches. 4) Prefer In-group transfer to group rather than to the active INCALL agent •
INGROUPTRANSFER
should place the call back into the ingroup so ACD/queueing routes to READY agents. If you instead target an INCALL agent’s channel, the call may fail or disconnect. If you want queueing behavior, ensure the call is transferred to the ingroup endpoint (not a specific INCALL agent channel). 5) Check VICIdial / Asterisk transfer behavior and dialplan • Verify
agc/api.php
maps
ra_call_control
to a dialplan transfer that uses
Local/
or
Queue
constructs. If the transfer goes to a channel that immediately disconnects when the agent is INCALL, it will fail. 6) Use correct
value
examples to try • Try transferring to ingroup directly: ◦ value = the ingroup number or name your dialplan expects (e.g., "7000" or "INGROUP:101") • Try transferring to an agent extension: ◦ value = agent extension (e.g., "7001") • Try transferring to
agent_info['user']
if your system treats it as extension. 7) Confirm response.ok and transfer output parsing • Your success check:
Copy code
success = response.ok or 'SUCCESS' in response_text or 'TRANSFERRED' in response_text
is fine, but paste the full
response_text
. Many failures return textual errors (e.g., "AGENT NOT READY", "NO SUCH INGROUP", or "INVALID CALLID") that explain why. 8) Verify call context & channel • The active call must be associated with the correct channel/callid that
ra_call_control
expects. Ensure the call was created via the same VICIdial context and
value
points to a valid channel. 9) Add logging & small retries • Log
transfer_url
,
params
,
response.status_code
,
response_text
. • Retry once after a short delay if agent state may change. 10) Example alternate approach (transfer into queue) • If ingroup transfers work more reliably, call the agc/api.php with a value that places call back into queue: ◦ params: {'function':'ra_call_control','stage':'INGROUPTRANSFER','ingroup_choices':'INGAI','value': '<ingroup_id>'} If you try the above and paste: • the
response_text
, and • one example agent record (user, agent_name, callerid, status: READY/INCALL, ingroups), I’ll tell you exactly which
value
to use and any dialplan tweaks to make the transfer reliably connect a READY agent.