[Home]

Summary:ASTERISK-05152: only one way text using agents/queues
Reporter:Adrian Sietsma (adrian_sie)Labels:
Date Opened:2005-09-26 07:45:30Date Closed:2008-01-15 15:51:08.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_queue
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:using an iax client (iaxclientlib based), peer<->peer text messages are passed throug asterisk ok.
client<->client tested in both directions.

using agentcallback and queues, the agent can send text to the caller, but text sent by the caller is not recieved by the agent.

****** ADDITIONAL INFORMATION ******

tested on v 1.0.9 under linux kernel 2.4, cvs head (1.2) 19/9/05 on fc3 (kernel 2.6).
100% reproducible.

Comments:By: Michael Jerris (mikej) 2005-09-26 07:52:46

There were MANY fixes to text messaging in cvs head that I am not positive made it in to 1.0.  Can you please test this with cvs head (or does your version indicate you already tested with 1.2 beta1?)

By: Adrian Sietsma (adrian_sie) 2005-09-26 08:01:03

tested with 1.2 b1 as of 19/9/05, as well as 1.0.9

By: Kevin P. Fleming (kpfleming) 2005-09-26 11:42:25

The agent_write() function in chan_agent does not filter out any frames, except for voice frames that are not in the correct format.

To help us find this problem, please add some debugging to agent_write() to determine whether it is receiving the AST_FRAME_TEXT frames at all... then we can find out where the failure is happening.

By: Adrian Sietsma (adrian_sie) 2005-09-28 20:08:45

added a frametype dump to chan_agent agent_read() and agent_write().
agent_read() successfully procecesses AST_FRAME_TEXT's, but they are never seen in agent_write().

i'm now trying to trace the call flow, to see where the text frames disappear. any pointers would be most welcome.

By: Kevin P. Fleming (kpfleming) 2005-09-28 23:42:05

The call is going to end up in ast_generic_channel_bridge() in channel.c, which is responsible for forwarding frames between the channels. It uses the same code to handle both directions, so I can't see why it would fail in only one direction.

If you like, you can add some debugging to that function to spit out a log message every time it receives an AST_FRAME_TEXT frame, and from which channel it received it. At least then you would know it arrived at the bridge, but never made it into chan_agent.

By: Adrian Sietsma (adrian_sie) 2005-09-29 20:26:01

Found it.

in ast_write in channel.c, there is the following case :

case AST_FRAME_TEXT:
if (chan->tech->send_text)
res = chan->tech->send_text(chan, (char *) fr->data);
else
res = 0;
break;

for an agent channel, tech->send_text is null, so the text frame is dropped here.

i will try adding a modified clone of agent_sendhtml() as agent_send_text(), and adding it to the agent_tech stucture.

results to follow.

Adrian

By: Kevin P. Fleming (kpfleming) 2005-10-13 20:51:55

Fixed in CVS HEAD.

By: Digium Subversion (svnbot) 2008-01-15 15:51:08.000-0600

Repository: asterisk
Revision: 6787

U   trunk/channel.c
U   trunk/channels/chan_agent.c
U   trunk/include/asterisk/channel.h

------------------------------------------------------------------------
r6787 | kpfleming | 2008-01-15 15:51:07 -0600 (Tue, 15 Jan 2008) | 2 lines

support sending text through agent channels (issue ASTERISK-5152)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=6787