Advertisement
Guest User

app_queue.c.rej

a guest
Jan 14th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.64 KB | None | 0 0
  1. Index: app_queue.c
  2. --- app_queue.c (revision 295023)
  3. +++ app_queue.c (working copy)
  4. @@ -2884,6 +2885,7 @@
  5.     /* Request the peer */
  6.     tmp->chan = ast_request(tech, qe->chan->nativeformats, qe->chan, location, &status);
  7.     if (!tmp->chan) {           /* If we can't, just go on to the next call */
  8. +       rna(0, qe, tmp->member->state_interface, tmp->member->membername, 0, AST_CAUSE_CONGESTION);
  9.         if (qe->chan->cdr)
  10.             ast_cdr_busy(qe->chan->cdr);
  11.         tmp->stillgoing = 0;   
  12. @@ -2967,6 +2969,7 @@
  13.     /* Place the call, but don't wait on the answer */
  14.     if ((res = ast_call(tmp->chan, location, 0))) {
  15.         /* Again, keep going even if there's an error */
  16. +       rna(0, qe, tmp->member->state_interface, tmp->member->membername, 0, AST_CAUSE_CONGESTION);
  17.         ast_debug(1, "ast call on peer returned %d\n", res);
  18.         ast_verb(3, "Couldn't call %s\n", tmp->interface);
  19.         ast_channel_unlock(tmp->chan);
  20. @@ -3189,7 +3192,7 @@
  21.  }
  22.  
  23.  /*! \brief RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer. */
  24. -static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername, int pause)
  25. +static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername, int pause, int reason)
  26.  {
  27.     ast_verb(3, "Nobody picked up in %d ms\n", rnatime);
  28.  
  29. @@ -3209,6 +3212,7 @@
  30.                         "Member: %s\r\n"
  31.                         "MemberName: %s\r\n"
  32.                         "Ringtime: %d\r\n"
  33. +                       "Reason: %s\r\n"
  34.                         "%s",
  35.                         qe->parent->name,
  36.                         qe->chan->uniqueid,
  37. @@ -3216,9 +3220,10 @@
  38.                         interface,
  39.                         membername,
  40.                         rnatime,
  41. +                       ast_cause2str(reason),
  42.                         qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
  43.     }
  44. -   ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime);
  45. +   ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d|%s", rnatime, ast_cause2str(reason));
  46.     if (qe->parent->autopause != QUEUE_AUTOPAUSE_OFF && pause) {
  47.         if (qe->parent->autopause == QUEUE_AUTOPAUSE_ON) {
  48.             if (!set_member_paused(qe->parent->name, interface, "Auto-Pause", 1)) {
  49. @@ -3515,7 +3520,7 @@
  50.                             do_hang(o);
  51.                             endtime = (long) time(NULL);
  52.                             endtime -= starttime;
  53. -                           rna(endtime * 1000, qe, on, membername, 0);
  54. +                           rna(endtime * 1000, qe, on, membername, 0, o->chan->hangupcause);
  55.                             if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
  56.                                 if (qe->parent->timeoutrestart)
  57.                                     *to = orig;
  58. @@ -3533,7 +3538,7 @@
  59.                                 ast_cdr_busy(in->cdr);
  60.                             endtime = (long) time(NULL);
  61.                             endtime -= starttime;
  62. -                           rna(endtime * 1000, qe, on, membername, 0);
  63. +                           rna(endtime * 1000, qe, on, membername, 0, o->chan->hangupcause);
  64.                             do_hang(o);
  65.                             if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
  66.                                 if (qe->parent->timeoutrestart)
  67. @@ -3648,7 +3653,7 @@
  68.         }
  69.         if (!*to) {
  70.             for (o = start; o; o = o->call_next)
  71. -               rna(orig, qe, o->interface, o->member->membername, 1);
  72. +               rna(orig, qe, o->interface, o->member->membername, 1, AST_CAUSE_NOANSWER);
  73.         }
  74.     }
  75.  
  76. Index: UPGRADE.txt
  77. --- UPGRADE.txt (revision 295023)
  78. +++ UPGRADE.txt (working copy)
  79. @@ -30,6 +30,12 @@
  80.   - The default value for 'context' and 'parkinglots' in gtalk.conf has
  81.     been changed to 'default', previously they were empty.
  82.  
  83. +QueueLog:
  84. + - RINGNOANSWER now has the hangup reason as the last parameter.
  85.  
  86. +Manager:
  87. + - Manager event AgentRingNoAnswer now includes "Reason"-
  88. +   parameter, which holds the hangup reason.
  89. +
  90.  ===========================================================
  91.  ===========================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement