[asterisk-users] chan_local and Originate

Tilghman Lesher tlesher at digium.com
Wed Feb 17 09:45:00 CST 2010


On Wednesday 17 February 2010 09:32:50 Olle E. Johansson wrote:
> 17 feb 2010 kl. 16.00 skrev James Northcott / Chief Systems:
> > 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?
>
> I think I've seen the same problem with 1.4 from svn. Can't confirm it but
> based on your e-mail I will try with an old version and see if there's any
> difference.
>
> Thanks for e-mailing that, you woke me up. I spent almost an hour in a very
> busy system trying to find the second call leg of an AMI originate
> yesterday.
>
> The CLI originate works just fine.
>
> If you can confirm that it works in one version of 1.4 and not in 1.4.29,
> then please open a bug report on issues.asterisk.org

Actually, please try the latest 1.4.30 release candidate.  There's a known
regression in chan_local in 1.4.29, which has already been fixed in-tree.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list