~ubuntu-branches/ubuntu/saucy/dahdi-tools/saucy

« back to all changes in this revision

Viewing changes to xpp/perl_modules/Dahdi/Xpp/Mpp.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jean-Michel Dault, Tzafrir Cohen
  • Date: 2010-02-16 13:44:09 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100216134409-4y4k26mgzyra537o
Tags: 1:2.2.1-0ubuntu1
* Merge from Debian pkg-voip.
  * Changes from Debian:
  - debian/control: Change Maintainer
  - debian/control: Removed Uploaders field.
  - debian/control: Removed Debian Vcs-Svn entry and replaced with
      ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
  - debian/control: Package dahdi Depends on  dahdi-dkms | dahdi-source

* From Debian pkg-voip:
[ Tzafrir Cohen ]
* New upstream release (Closes: #536257, #564381).
* Patch 'bashism' dropped: merged upstream. 
* Patch xpp_no_extra_at dropped: merged upstream. 
* Add an example genconf_parameters.
* Compat level 7.
* Bump standars version to 3.8.3.0 (no change needed)
* Udev rules are now in dahdi-linux.
* Patches perl_fix_noserial, perl_fix_transportdir: Fixes for some
  minor perl issues.
* Add the missing ${misc:Depends}, as per lintian. 
* Patch astribank_allow_ignoreend: an extra missing patch from upstream. 
* Patches init_unload_modules and init_unload_oslec: also unload OSLEC
  when unloading all modules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
# This program is free software; you can redistribute and/or
6
6
# modify it under the same terms as Perl itself.
7
7
#
8
 
# $Id: Mpp.pm 6630 2009-05-16 22:46:57Z tzafrir $
 
8
# $Id: Mpp.pm 7621 2009-11-22 11:48:40Z tzafrir $
9
9
#
10
10
use strict;
11
11
use File::Basename;
102
102
        }
103
103
}
104
104
 
105
 
sub astribank_tool_cmd($) {
 
105
sub astribank_tool_cmd($@) {
106
106
        my $dev = shift || die;
 
107
        my @args = @_;
107
108
        my $usb_top;
108
109
 
109
110
        # Find USB bus toplevel
113
114
        my $name = $dev->priv_device_name();
114
115
        die "$0: Unkown private device name" unless defined $name;
115
116
        my $path = "$usb_top/$name";
116
 
        return ($astribank_tool, '-D', "$path");
 
117
        return ($astribank_tool, '-D', "$path", @args);
117
118
}
118
119
 
119
120
sub new($$$) {
136
137
        }
137
138
        return $mppinfo unless $product =~ /116[12]/;
138
139
        $mppinfo->{'MPP_TALK'} = 1;
139
 
        my @cmd = astribank_tool_cmd($dev);
 
140
        my @cmd = astribank_tool_cmd($dev, '-Q');
140
141
        my $name = $dev->priv_device_name();
141
142
        my $dbg_file = "$name";
142
143
        $dbg_file =~ s/\W/_/g;
191
192
        my $dev = $mppinfo->dev || die;
192
193
        return undef unless defined $mppinfo->mpp_talk;
193
194
        my $old = $mppinfo->tws_watchdog;
194
 
        my @cmd = astribank_tool_cmd($dev);
 
195
        my @cmd = astribank_tool_cmd($dev, '-w', $on);
195
196
        print STDERR "DEBUG($on): '@cmd'\n";
196
 
        system(@cmd, '-w', $on);
 
197
        system(@cmd);
197
198
        die "Running $astribank_tool failed: $?" if $?;
198
199
}
199
200
 
204
205
        my $port = $mppinfo->twinstar_port;
205
206
        $port = ($port == 1) ? 0 : 1;
206
207
        die "Unknown TwinStar port" unless defined $port;
207
 
        my @cmd = astribank_tool_cmd($dev);
208
 
        system(@cmd, '-p', $port);
 
208
        my @cmd = astribank_tool_cmd($dev, '-p', $port);
 
209
        system(@cmd);
209
210
        die "Running $astribank_tool failed: $?" if $?;
210
211
}
211
212