[Asterisk-Users] struggling with the "g" flag

Julian Lyndon-Smith asterisk at dotr.com
Mon Jun 26 06:33:13 MST 2006


If I have in my dialplan

[AgentQ]
exten => _XX.,1,Dial(Sip/{$exten},120,g)
exten => _XX.,2,NoOP(here we are)

where [AgentQ] is called by the queue command to a member added by

addqueuemember(Local/99 at AgentQ)

why don't I get to the NoOp if the agent hangs up during the 
announcement message (to the agent) ?

I see in the app_dial.c program that the "g" flag is tested thus:

if ((ast_test_flag(peerflags, OPT_GO_ON)) && (!chan->_softhangup) && 
(res != AST_PBX_KEEPALIVE))
		res = 0;

So this would indicate that if all three of these conditions are met 
then res would be set to 0, and things would behave how I want.

In chan_agent.c, the following line is where the agent has hung up

if (peer->_softhangup) {
				/* Agent must have hung up */
				ast_log(LOG_WARNING, "Agent on %s hungup on the customer.  They're 
going to be pissed.\n", peer->name);

I see that in chan_agent the peer->_softhangup is true (I get the 
message on the console) but the test in app_dial specifically tests to 
see if chan->_softhangup is *not* true.

Why is that ?

Julian



More information about the asterisk-users mailing list