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

Russell Bryant russell at digium.com
Wed Dec 17 15:24:05 CST 2008



> 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.

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.


- Russell


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/95/#review235
-----------------------------------------------------------


On 2008-12-17 12:15:34, Russell Bryant wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/95/
> -----------------------------------------------------------
> 
> (Updated 2008-12-17 12:15:34)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch introduces a new application, Originate.  I made a lot of changes to the original patch, so I figured it would be worth getting another set of eyes on the code before commit.
> 
> 
> This addresses bug 14075.
>     http://bugs.digium.com/view.php?id=14075
> 
> 
> Diffs
> -----
> 
>   /trunk/CHANGES 165156 
>   /trunk/apps/app_originate.c PRE-CREATION 
> 
> Diff: http://reviewboard.digium.com/r/95/diff
> 
> 
> Testing
> -------
> 
> Tested calls to 589 through 595 and got expected results.
> 
> exten => s,1,Answer
> exten => s,n,MusicOnHold()
> 
> exten => 589,1,Answer
> exten => 589,n,Originate(SIP/5004,exten,default,586,1)
> exten => 589,n,Playback(demo-congrats)
> 
> exten => 590,1,Answer
> exten => 590,n,Originate(SIP/5004,exten,default,586)
> exten => 590,n,Playback(demo-congrats)
> 
> exten => 591,1,Answer
> exten => 591,n,Originate(SIP/5004,exten,default)
> exten => 591,n,Playback(demo-congrats)
> 
> exten => 592,1,Answer
> exten => 592,n,Originate(SIP/5004,exten)
> exten => 592,n,Playback(demo-congrats)
> 
> exten => 593,1,Answer
> exten => 593,n,Originate(SIP/5004,app,Playback,demo-congrats)
> exten => 593,n,Playback(demo-congrats)
> 
> exten => 594,1,Answer
> exten => 594,n,Originate(SIP/5004,app,Echo)
> exten => 594,n,Playback(demo-congrats)
> 
> exten => 595,1,Answer
> exten => 595,n,Originate(SIP/5004,app)
> exten => 595,n,Playback(demo-congrats)
> 
> 
> Thanks,
> 
> Russell
> 
>




More information about the asterisk-dev mailing list