dahdi_cfg: Allow dynamic spans to handle udev based span assignment.
authorShaun Ruffell <sruffell@digium.com>
Wed, 8 Jan 2014 20:11:03 +0000 (14:11 -0600)
committerRuss Meyerriecks <rmeyerriecks@digium.com>
Wed, 22 Jan 2014 18:58:57 +0000 (12:58 -0600)
commit69ce6f07e0842e1dcb8b18f19fd3d61f577d3022
treef88f1fb80c3939e19b45aeb63d90446c4fd8a20c
parent9989b8779cef3c243ee58e273c0b2709fb11e31b
dahdi_cfg: Allow dynamic spans to handle udev based span assignment.

Prior to this commit, if auto_assign_spans was set to 0, it was possible to
get in an endless loop creating and destroying spans. The primary reason was
that all dynamic spans are destroyed and recreated each time dahdi_cfg runs, BUT
dahdi_cfg was run each time a new span showed up in udev when auto_assign_spans
was set to 0.

Now dahdi_cfg will only destroy and recreate dynamic spans if dahdi_cfg is run
without a specifc span number. Also, while creating dynamic spans, dahdi_cfg
will pause for up to one second for the span to be assigned in order to ensure
that the spans are numbered consistently when auto span assignment is
configured.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
dahdi_cfg.c