[python] Problem reloading account configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi:

I'm having a little problem when I try to reload the account
configuration. I'm doing something like this:

def start_acc(self):
        from callback.acc_cb import yass_acc_cb
        if self.cfg.acc.ready:
            self.acc =
self.lib.create_account(acc_config=self.cfg.acc.acc, cb=yass_acc_cb())

    def stop_acc(self):
        if self.acc is not None:
            self.acc.delete()
            self.acc = None

    def restart_acc(self):
        self.stop_acc()
        self.cfg.reload_acc()
        self.start_acc()

If I do this, the account unregisters, but it does not register again,
although, after doing start_acc self.acc contains a valid account. I
can solve this by putting another call to start_acc like this:

def restart_acc(self):
        self.stop_acc()
        self.cfg.reload_acc()
        self.start_acc()
        self.start_acc()

By putting the two calls to the method, I can get the account
re-registered, but I don't know why. Does it make any sense? Thanks in
advance!


-- 
Sa?l -- "Nunca subestimes el ancho de banda de un cami?n lleno de disketes."
----------------------------------------------------------------
http://www.saghul.net/



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux