[asterisk-dev] [svn-commits] jrose: trunk r389623 - /trunk/res/parking/parking_bridge.c

Jonathan Rose jrose at digium.com
Fri May 24 11:54:17 CDT 2013


On May 23, 2013, at 11:05 PM, Paul Belanger wrote:
> From: "Paul Belanger" <paul.belanger at polybeacon.com>
> To: "Asterisk Developers Mailing List" <asterisk-dev at lists.digium.com>
> Sent: Thursday, May 23, 2013 11:05:30 PM
> Subject: Re: [asterisk-dev] [svn-commits] jrose: trunk r389623 -	/trunk/res/parking/parking_bridge.c
> 
> On 13-05-23 05:11 PM, SVN commits to the Digium repositories wrote:
> > Author: jrose
> > Date: Thu May 23 16:11:18 2013
> > New Revision: 389623
> >
> > URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389623
> > Log:
> > res_parking: Add a verbose message when a channel is parked
> >
> > Modified:
> >      trunk/res/parking/parking_bridge.c
> >
> > Modified: trunk/res/parking/parking_bridge.c
> > URL:
> > http://svnview.digium.com/svn/asterisk/trunk/res/parking/parking_bridge.c?view=diff&rev=389623&r1=389622&r2=389623
> > ==============================================================================
> > --- trunk/res/parking/parking_bridge.c (original)
> > +++ trunk/res/parking/parking_bridge.c Thu May 23 16:11:18 2013
> > @@ -29,6 +29,7 @@
> >   #include "asterisk/astobj2.h"
> >   #include "asterisk/features.h"
> >   #include "asterisk/say.h"
> > +#include "asterisk/term.h"
> >
> >   struct ast_bridge_parking
> >   {
> > @@ -284,6 +285,11 @@
> >   	/* Set this to the bridge pvt so that we don't have to refind
> >   	the parked user associated with this bridge channel again. */
> >   	bridge_channel->bridge_pvt = pu;
> >
> > +	ast_verb(3, "Parking '" COLORIZE_FMT "' in '" COLORIZE_FMT "' at
> > space %d\n",
> > +		COLORIZE(COLOR_BRMAGENTA, 0,
> > ast_channel_name(bridge_channel->chan)),
> > +		COLORIZE(COLOR_BRMAGENTA, 0, self->lot->name),
> > +		pu->parking_space);
> > +
> >   	return 0;
> >   }
> >
> Am I correct in reading this as a colorized verbose message? I don't
> think I have ever seen that before.  Why did you decided to add it?
> 
> --
> Paul Belanger | PolyBeacon, Inc.
> Jabber: paul.belanger at polybeacon.com | IRC: pabelanger (Freenode)
> Github: https://github.com/pabelanger | Twitter:
> https://twitter.com/pabelanger

Why I added the verbose message: Nothing was indicating that a call was
parked in the CLI when a call was parked by transferring to a parking
application (because when a call is transfered to a park application
provided it's the first priority, the transfer is actually intercepted
and treated as a special type of park feature).

Why it's colorized: This isn't strictly necessary, but when verbose
messages are issued for executing an application, the channel it is
running on is colored with BR_MAGENTA and so are the arguments to the
application. For the parking application the lot used is a common
argument, but it doesn't have to be. In any event, I used COLORIZE here
because it makes the arguments more visually apparent.

For the record: You should have been seeing colorized CLI output for
some time now. pbx.c colors application execution messages when
verbosity is 3 or higher. I don't know when this was first done, but
it's the case in 1.2

That said: It is pretty rare to have verbose messages do colorize and
I'm not averse to ditching the color if anyone dislikes it.

--
Jonathan R. Rose
Digium, Inc. | Software Engineer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
direct +1 256 428 6139 

Check us out at: http://digium.com & http://asterisk.org



More information about the asterisk-dev mailing list