[asterisk-users] chan_local and Originate

James Northcott / Chief Systems james at chiefsystems.ca
Wed Feb 17 09:00:54 CST 2010


Hi,

I've recently upgraded from Asterisk 1.4.22 to 1.4.29, and I'm now
having a problem with Originate and chan_local.

I'm using the following Manager API action to originate a call:

Action: originate
Priority: 1
Context: trunk
Callerid: 100
Channel: Local/100 at callback/n
Exten: 123456789
Variable: USERFIELD=127.0.0.1|USEREXT=123456789
WaitTime: 30

This is intended to first call extension 100 in the callback context,
and then when that is answered, call 123456789 in the trunk context.  I
have the following in the callback context:

exten => 100,1,Answer
exten => 100,2,Wait(2)
exten => 100,3,NoOP(${ANSWERED} ${USEREXT})
exten => 100,4,AGI(getChannelState.agi|${USEREXT})
exten => 100,5,GotoIf($[${EXISTS(${ANSWERED})}]?6:2)
exten => 100,6,Set(CDR(accountcode)=${USERFIELD})
exten => 100,7,Set(__OriginalCallerNum=c2c ${USEREXT})
exten => 100,8,Goto(handleq,s,new)
exten => 100,9,Hangup

The getChannelState AGI script just waits until the call to 123456789 is
answered before putting the caller into a queue.

The problem is that the second leg of the Originate, the call to
123456789 at trunk, never happens.  Even though the first action at
100 at local is to Answer, the Originate action doesn't see this, so I just
get the AGI calls every 2 seconds for 30 seconds, and then everything
hangs up.

This code did work in a previous version of Asterisk, but I am not 100%
sure it worked in 1.4.22 - it may have broken before then.

If I replace Local/100 at callback/n with my direct SIP channel, the
Originate works as expected.

Can anyone tell me if I am using the Local channel incorrectly here?  Or
did something about the Local channel change in recent 1.4 versions?  Is
there a better way to do what I'm trying to do?

Thanks,

James




More information about the asterisk-users mailing list