[asterisk-dev] PRI: help to understand why Asterisk drops calls (Got restart ack)

Giorgio Incantalupo gincantalupo at fgasoftware.com
Mon Sep 11 09:45:04 MST 2006


Hi,
I have an Asterisk box with a PRI line. I noticed every hour Asterisk 
drops calls and I get this message on Asterisk console:

"chan_zap.c: Got restart ack on channel 0/6 span 1 with owner"

so I drilled inside the code in chan_zap.c and I found this piece of code:

  case PRI_EVENT_RESTART_ACK:
      chanpos = pri_find_principle(pri, e->restartack.channel);
      if (chanpos < 0) {
          /* Sometime switches (e.g. I421 / British Telecom) don't give 
us the
              channel number, so we have to figure it out...  This must 
be why
              everybody resets exactly a channel at a time. */
          for (x=0;x<pri->numchans;x++) {
              if (pri->pvts[x] && pri->pvts[x]->resetting) {
                  chanpos = x;
                  ast_mutex_lock(&pri->pvts[chanpos]->lock);
                  ast_log(LOG_DEBUG, "Assuming restart ack is really for 
channel %d/%d span %d\n", pri->pvts[chanpos]->logicalspan,
                                  pri->pvts[chanpos]->prioffset, pri->span);
                  if (pri->pvts[chanpos]->realcall)
                          pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
                  else if (pri->pvts[chanpos]->owner) {
                          ast_log(LOG_WARNING, "Got restart ack on 
channel %d/%d with owner on span %d\n",pri->pvts[chanpos]->logicalspan,
                                  pri->pvts[chanpos]->prioffset, pri->span);
                          pri->pvts[chanpos]->owner->_softhangup |= 
AST_SOFTHANGUP_DEV;
                  }
                  pri->pvts[chanpos]->resetting = 0;
                  if (option_verbose > 2)
                          ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d 
successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
                                  pri->pvts[chanpos]->prioffset, pri->span);
                  ast_mutex_unlock(&pri->pvts[chanpos]->lock);
                  if (pri->resetting)
                          pri_check_restart(pri);
                  break;
              }


This seems to be the cause of my problem but unfortunately I'm not very 
skilled with Asterisk code.
Is there anybody who can explain to me why Asterisk is behaving that 
way? It seems like Asterisk is resetting something...
What does the comment "Sometime switches..." mean?

Any help is really appreciated.

TIA

Giorgio Incantalupo


More information about the asterisk-dev mailing list