[asterisk-dev] [Code Review]: Add replacement for SIP_CAUSE

opticron reviewboard at asterisk.org
Thu May 3 13:49:31 CDT 2012



> On May 3, 2012, 10:47 a.m., Mark Michelson wrote:
> > The actual code looks good. I would suggest amending your UPGRADE.txt addition to include the fact that "storesipcause" is now a deprecated option. Also remove all traces of "storesipcause" from configs/sip.conf/sample.

Commentary about sipstorecause deprecation added and sipstorecause eradicated.


- opticron


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


On April 26, 2012, 11:09 a.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1822/
> -----------------------------------------------------------
> 
> (Updated April 26, 2012, 11:09 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Add HANGUPCAUSE as a more generic mechanism for reporting the type of information available in SIP_CAUSE as well as a drop-in replacement for SIP_CAUSE that does not incur the overhead of the MASTER_CHANNEL dialplan function.  This feature uses control frames to pass the data and creates a mechanism by which any channel driver can report cause information.  This implementation includes only SIP, but implementations for other channel drivers will be available in the future.
> 
> 
> This addresses bug SWP-4221.
>     https://issues.asterisk.org/jira/browse/SWP-4221
> 
> 
> Diffs
> -----
> 
>   trunk/CHANGES 360259 
>   trunk/UPGRADE.txt 360259 
>   trunk/apps/app_dial.c 360259 
>   trunk/apps/app_followme.c 360259 
>   trunk/apps/app_queue.c 360259 
>   trunk/channels/chan_alsa.c 360259 
>   trunk/channels/chan_console.c 360259 
>   trunk/channels/chan_gtalk.c 360259 
>   trunk/channels/chan_h323.c 360259 
>   trunk/channels/chan_iax2.c 360259 
>   trunk/channels/chan_jingle.c 360259 
>   trunk/channels/chan_mgcp.c 360259 
>   trunk/channels/chan_misdn.c 360259 
>   trunk/channels/chan_oss.c 360259 
>   trunk/channels/chan_phone.c 360259 
>   trunk/channels/chan_sip.c 360259 
>   trunk/channels/chan_skinny.c 360259 
>   trunk/channels/chan_unistim.c 360259 
>   trunk/channels/chan_vpb.cc 360259 
>   trunk/funcs/func_frame_trace.c 360259 
>   trunk/include/asterisk/frame.h 360259 
>   trunk/main/channel.c 360259 
>   trunk/main/dial.c 360259 
>   trunk/main/features.c 360259 
>   trunk/main/file.c 360259 
>   trunk/main/rtp_engine.c 360259 
> 
> Diff: https://reviewboard.asterisk.org/r/1822/diff
> 
> 
> Testing
> -------
> 
> Verified that this functions identically to SIP_CAUSE in single-channel dials, forked dials, and forked dials behind a local dial.
> 
> Sample dialplan:
> [foo]
> exten => s,1,Dial(SIP/bar)
>  
> exten => h,1,noop()
> exten => h,n,set(HANGUPCAUSE_STRING=${HASHKEYS(HANGUPCAUSE)})
> ; start loop
> exten => h,n(begin),noop()
>  
> ; check exit condition (no more array to check)
> exten => h,n,gotoif($[${LEN(${HANGUPCAUSE_STRING})} = 0]?exit)
>  
> ; pull the next item
> exten => h,n,set(ARRAY(item)=${HANGUPCAUSE_STRING})
> exten => h,n,set(HANGUPCAUSE_STRING=${HANGUPCAUSE_STRING:${LEN(${item})}})
>  
> ; display the channel ID and cause code
> exten => h,n,noop(got channel ID ${item} with pvt cause ${HASH(HANGUPCAUSE,${item})})
>  
> ; check exit condition (no more array to check)
> exten => h,n,gotoif($[${LEN(${HANGUPCAUSE_STRING})} = 0]?exit)
>  
> ; we still have entries to process, so strip the leading comma
> exten => h,n,set(HANGUPCAUSE_STRING=${HANGUPCAUSE_STRING:1})
> ; go back to the beginning of the loop
> exten => h,n,goto(begin)
> exten => h,n(exit),noop(All HANGUPCAUSE entries processed)
> 
> 
> Thanks,
> 
> opticron
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120503/59101bc2/attachment.htm>


More information about the asterisk-dev mailing list