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

Mark Michelson reviewboard at asterisk.org
Mon May 14 13:53:23 CDT 2012


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

Ship it!


- Mark


On May 3, 2012, 1:49 p.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1822/
> -----------------------------------------------------------
> 
> (Updated May 3, 2012, 1:49 p.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/UPGRADE.txt 365212 
>   trunk/apps/app_dial.c 365212 
>   trunk/apps/app_followme.c 365212 
>   trunk/apps/app_queue.c 365212 
>   trunk/channels/chan_alsa.c 365212 
>   trunk/channels/chan_console.c 365212 
>   trunk/channels/chan_gtalk.c 365212 
>   trunk/channels/chan_h323.c 365212 
>   trunk/channels/chan_iax2.c 365212 
>   trunk/channels/chan_jingle.c 365212 
>   trunk/channels/chan_mgcp.c 365212 
>   trunk/channels/chan_misdn.c 365212 
>   trunk/channels/chan_oss.c 365212 
>   trunk/channels/chan_phone.c 365212 
>   trunk/channels/chan_sip.c 365212 
>   trunk/channels/chan_skinny.c 365212 
>   trunk/channels/chan_unistim.c 365212 
>   trunk/channels/chan_vpb.cc 365212 
>   trunk/configs/sip.conf.sample 365212 
>   trunk/funcs/func_frame_trace.c 365212 
>   trunk/include/asterisk/frame.h 365212 
>   trunk/main/channel.c 365212 
>   trunk/main/dial.c 365212 
>   trunk/main/features.c 365212 
>   trunk/main/file.c 365212 
>   trunk/main/rtp_engine.c 365212 
> 
> 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/20120514/83a01460/attachment.htm>


More information about the asterisk-dev mailing list