[asterisk-bugs] [Asterisk 0014970]: [patch] chan_vpb fails to catch exception on 1.4

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Nov 5 13:25:44 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=14970 
====================================================================== 
Reported By:                tzafrir
Assigned To:                qwell
====================================================================== 
Project:                    Asterisk
Issue ID:                   14970
Category:                   Channels/General
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
JIRA:                       SWP-269 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 189391 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-04-25 04:01 CDT
Last Modified:              2009-11-05 13:25 CST
====================================================================== 
Summary:                    [patch] chan_vpb fails to catch exception on 1.4
Description: 
On module startup, chan_vpb asks libvpb to scan for relevant hardware. If
libvpb fails to find any, it raises an exception:

	try {
		num_cards = vpb_get_num_cards();
	} catch (VpbException e) {
		ast_log(LOG_ERROR, "No Voicetronix cards detected\n");
		return AST_MODULE_LOAD_DECLINE;
	}

This seems to work as planned on trunk . However with 1.4 (on the same
system and same libvpb) I get

*CLI> module load chan_vpb.so
[Apr 25 11:56:50] ERROR[20919]: chan_vpb.cc:2720 ast_module_load_result
terminate called after throwing an instance of 'VpbException'
  what():  VPBREG_NO_VPB_DEVICES_DETECTED
/home/tzafrir/Proj/Asterisk/Git/asterisk/live_ast: line 170: 20919 Aborted
                $AST_BIN -C $AST_CONF "$@"

The fix/workaround (attached) is to use the parent class std::exception .

After which I get:

*CLI> module load chan_vpb.so
[Apr 25 11:58:40] ERROR[21550]: chan_vpb.cc:2722 ast_module_load_result
load_module(): No Voicetronix cards detected

and no panic.
====================================================================== 

---------------------------------------------------------------------- 
 (0113220) svnbot (reporter) - 2009-11-05 13:25
 https://issues.asterisk.org/view.php?id=14970#c113220 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 228093

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_vpb.cc

------------------------------------------------------------------------
r228093 | qwell | 2009-11-05 13:25:43 -0600 (Thu, 05 Nov 2009) | 22 lines

Merged revisions 228080 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r228080 | qwell | 2009-11-05 13:16:29 -0600 (Thu, 05 Nov 2009) | 15
lines
  
  Merged revisions 228079 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r228079 | qwell | 2009-11-05 13:14:25 -0600 (Thu, 05 Nov 2009) | 8
lines
    
    Fix crash on VPB exception when no hardware is present.
    
    (closes issue https://issues.asterisk.org/view.php?id=14970)
    Reported by: tzafrir
    Patches:
          vpb_exception.diff uploaded by tzafrir (license 46)
    Tested by: markwaters
  ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=228093 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-11-05 13:25 svnbot         Checkin                                      
2009-11-05 13:25 svnbot         Note Added: 0113220                          
======================================================================




More information about the asterisk-bugs mailing list