[asterisk-dev] [Code Review] Add Connected line interception macros to Asterisk

Mark Michelson mmichelson at digium.com
Mon Jun 1 13:48:02 CDT 2009



> On 2009-05-29 17:21:03, Russell Bryant wrote:
> > /trunk/main/channel.c, line 6513
> > <http://reviewboard.digium.com/r/256/diff/1/?file=5457#file5457line6513>
> >
> >     Should connected_info be declared as const here?

No reason not to. Done.


> On 2009-05-29 17:21:03, Russell Bryant wrote:
> > /trunk/include/asterisk/app.h, lines 111-112
> > <http://reviewboard.digium.com/r/256/diff/1/?file=5454#file5454line111>
> >
> >     doxygen docs MIA (if these functions stick around)

These functions will not exist in my next diff.


> On 2009-05-29 17:21:03, Russell Bryant wrote:
> > /trunk/apps/app_macro.c, lines 613-627
> > <http://reviewboard.digium.com/r/256/diff/1/?file=5450#file5450line613>
> >
> >     Why not just implement this in the core?  That way, you don't need the register/unregister stuff.
> >     
> >     You can look for app_macro using pbx_findapp() and then emit an error if app_macro had not been loaded.

I can't really explain why I went this route for implementing this.

Anyway, I've changed to use the pbx_findapp() method.


> On 2009-05-29 17:21:03, Russell Bryant wrote:
> > /trunk/include/asterisk/app.h, lines 114-129
> > <http://reviewboard.digium.com/r/256/diff/1/?file=5454#file5454line114>
> >
> >     I would certainly prefer that all of this new code was wrapped at 90 columns.  ;-)

....fine I guess.


- Mark


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


On 2009-05-27 15:38:14, Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/256/
> -----------------------------------------------------------
> 
> (Updated 2009-05-27 15:38:14)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Connected line reception and transmission is a new feature in Asterisk trunk. One of its shortcomings is the inability to modify received connected line information while a dialplan application is running. 
> 
> Here is a common example where this may be useful. Many office environments require that a digit (such as '9') is dialled in order to reach the PSTN. The problem is that when one dials a PSTN number, the information received from the far end will not have this prefix digit. To make the lives of users easier, it would be really nice if the prefix digit could be displayed for them.
> 
> This proposed patch adds the ability to add connected line interception macros into the dialplan. When we are going to send a connected line update to someone, the administrator has the ability to run a macro which can do whatever manipulation of connected line information is necessary to appease everyone. There are four defined macros in the channelvariables.tex file.
> 
> ${CONNECTED_LINE_SEND_CALLEE_MACRO}        Macro to call before sending a connected line update to the callee
> ${CONNECTED_LINE_SEND_CALLEE_MACRO_ARGS}   Arguments to pass to ${CONNECTED_LINE_SEND_CALLEE_MACRO}
> ${CONNECTED_LINE_SEND_CALLER_MACRO}        Macro to call before sending a connected line update to the caller
> ${CONNECTED_LINE_SEND_CALLER_MACRO_ARGS}   Arguments to pass to ${CONNECTED_LINE_SEND_CALLER_MACRO}
> 
> So in the example I gave above, the administrator could write a simple macro like this:
> 
> [macro-addnine]
> exten => s,1,Set(CONNECTEDLINE(num,i)=9${CONNECTEDLINE(num)}); Adds '9' to the connected line number
> 
> Then, he could add a priority before any Dial to the PSTN:
> exten => blah,n,Set(CONNECTED_LINE_SEND_CALLER_MACRO=addnine)
> 
> Simple as that! And of course, one is not limited to modifying just the connected line number. You could modify the name, or even information not relating to connected line information.
> 
> Please review my code and see if there is anything that needs fixing. I realize as I am typing this that I have not placed anything in the CHANGES file, so I need to do that soon.i
> 
> 
> Diffs
> -----
> 
>   /trunk/apps/app_dial.c 197257 
>   /trunk/apps/app_directed_pickup.c 197257 
>   /trunk/apps/app_macro.c 197257 
>   /trunk/apps/app_queue.c 197257 
>   /trunk/channels/chan_sip.c 197257 
>   /trunk/doc/tex/channelvariables.tex 197257 
>   /trunk/include/asterisk/app.h 197257 
>   /trunk/include/asterisk/channel.h 197257 
>   /trunk/main/app.c 197257 
>   /trunk/main/channel.c 197257 
>   /trunk/main/dial.c 197257 
>   /trunk/main/features.c 197257 
> 
> Diff: http://reviewboard.digium.com/r/256/diff
> 
> 
> Testing
> -------
> 
> I have tested this with a scenario similar to what I listed above. In addition, I tested features such as call pickup (both using the Pickup application and the pickupexten from features.conf), built-in blind and attended transfers, and SIP transfers.
> 
> 
> Thanks,
> 
> Mark
> 
>




More information about the asterisk-dev mailing list