[asterisk-dev] [Code Review] New Application: Originate

Roberto Casas roberto.casas at diaple.com
Thu Dec 18 08:38:38 CST 2008


El Jueves 18 Diciembre 2008, Russell Bryant escribió:
> > On 2008-12-17 13:11:59, Mark Michelson wrote:
> > > The code appears to be error-free by my eyes, but I do have a
> > > suggestion, though.
> > >
> > > I'm wondering if it would be a good idea to use the return value from
> > > ast_pbx_outgoing_exten and ast_pbx_outgoing_app in conjunction with the
> > > output parameter "res" to play a sound back to the channel running
> > > app_originate to indicate if the call was successful. Something like
> > > "Originate successful," "Originate failed. Channel was busy," or
> > > "Originate failed. Channel could not be requested."
> > >
> > > My inspection of the code shows that even though the two function calls
> > > are made with the "sync" variable set to 0, ast_pbx_outgoing_exten and
> > > ast_pbx_outgoing_app will only return once the channel specified as the
> > > first parameter for Originate() has either answered or is determined to
> > > be busy or something.
> > >
> > > Feel free to reject this idea entirely or modify it in some way, but it
> > > seems like right now there's no way for someone originating a call in
> > > this manner to know if the originate actually succeeded or not.
> >
> > Russell Bryant wrote:
> >     This is a great suggestion.
> >
> >     I do have one modification.  I'll take a look at what is available as
> > a result code back from those API calls.  Whatever is available, I'd like
> > to expose via ORIGINATE_RESULT channel variables.  That way, from the
> > dialplan, you could play a sound as you suggest, or do whatever else the
> > dialplan author may want to do.
> >
> >     Thanks.
> >
> > Jared Smith wrote:
> >     Would it be worth it to have an additional parameter for being able
> > to set one or more channel variables on the Originated call?  I've often
> > used this for originations come from AMI, and I figured it might be
> > useful here.
> >
> >     The syntax is a bit ugly, but I imagine it looking something like:
> >
> >    
> > Originate(SIP/george,exten,default,123,1,accountnumber=543212345&agentnum
> >ber=424242&requestid=77321672)
>
> Jared, I think that's a great suggestion for improvement.  I have added a
> todo note in the code so that the enhancement gets completed at some point.
>  I'm not so sure on the syntax, but we'll figure something out.  It could
> also be something like ...
>
> Set(ORIGINATE_VAR=MYVAR=foo)
> Set(ORIGINATE_VAR=CALLERID(name)=Me)
> Set(ORIGINATE_VAR=SOMETHING_ELSE=bar)
> Originate(SIP/1234,exten,default,123,1)

I think this one is better, because additional arguments are used form app 
type originate.



More information about the asterisk-dev mailing list