xpp: dahdi_registration: wait at end of assignments
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Sun, 24 Dec 2017 15:59:49 +0000 (17:59 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Sun, 24 Dec 2017 16:02:29 +0000 (18:02 +0200)
Wait for assindments to end only after calling all of them.
Otherwise we are likely to get a timeout with multiple Astribanks.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

xpp/dahdi_registration

index 2772e00..29e180f 100755 (executable)
@@ -109,9 +109,15 @@ foreach my $xbus (Dahdi::Xpp::xbuses($sorter)) {
                        system @cmd;
                        warn "Failed '@cmd' (status=$?)\n" if $?;
                }
+       }
+}
+if (defined($on) && $on) {
+       if ($opts{'R'} || ! $default_auto_assign) {
                # wait for UDEV to do its stuff
                system "dahdi_waitfor_span_assignments assigned";
        }
+}
+foreach my $xbus (Dahdi::Xpp::xbuses($sorter)) {
        foreach my $xpd (Dahdi::Xpp::Xpd::telephony_devs($xbus->xpds())) {
                my $spanno = $xpd->xpd_getattr('span');
                myprintf "\t%-10s: ", $xpd->fqn;