[asterisk-dev] [Code Review] Add setvar option to calendaring

Russell Bryant reviewboard at asterisk.org
Fri Mar 4 17:01:19 CST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1134/#review3229
-----------------------------------------------------------



/trunk/res/res_calendar.c
<https://reviewboard.asterisk.org/r/1134/#comment6702>

    a couple of things:
    
    1) It looks like there is a memory leak here.  I think 'name' needs to be freed.
    
    2) I wonder if it would be a good idea to do an ast_strip() on both the name and value before calling ast_variable_new() to eat whitespace around '=' from the config file.  That's how I would expect it to behave anyway.


- Russell


On 2011-03-04 15:25:57, Terry Wilson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1134/
> -----------------------------------------------------------
> 
> (Updated 2011-03-04 15:25:57)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> There is currently no way to set dialplan variables or callerid on an event notification channel without using a local channel. Adding the setvar option with variable substitution on the value allows things like setting the outbound caller id name to the summary of a calendar event, etc. Values could be chained together as they are appended in order to do some scripting if necessary.
> 
> 
> Diffs
> -----
> 
>   /trunk/configs/calendar.conf.sample 309629 
>   /trunk/include/asterisk/calendar.h 309629 
>   /trunk/res/res_calendar.c 309629 
> 
> Diff: https://reviewboard.asterisk.org/r/1134/diff
> 
> 
> Testing
> -------
> 
> setvar=CALLERID(name)=${CALENDAR_EVENT(summary)}
> setvar=CALLERID(num)=$MYGLOBALVAR
> 
> Verified that the values were set in the notification.
> 
> 
> Thanks,
> 
> Terry
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110304/1966cc22/attachment-0001.htm>


More information about the asterisk-dev mailing list