Author Topic: Outbound and Druid  (Read 2077 times)

goit

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
Outbound and Druid
« on: January 06, 2009, 16:54:30 »
Hello, I am still not able to get this script working with DRUID. Below is the Macro DRUID uses for outbound calls. Can you someone please suggest how this macro be incorporated with the outbound script.

Thank you

This is the Dial string from extensions.conf

Code: [Select]
exten=>_XXXXXXXXXX,n,Macro(ael-druid-trunkdial,SIP/ipcomms,${EXTEN},WTK,,,,,${EXTEN})

This is the macro in extensions.ael

Code: [Select]
macro ael-druid-trunkdial( dev, number, options, accountcode, callerid, authzone, backuptrunk, backupnumber ) {
   TRANSFER_CONTEXT="druid-default";
   DYNAMIC_FEATURES=automon;
   channeltype = "${CUT(CHANNEL|/|1)}";
   if ("${channeltype}" == "Zap") {
      mydev = "${CUT(CHANNEL|-|1)}";
   }
   else {
      mydev = "${CUT(CHANNEL|-|1-3)}";
   }
   &ael-druid-hotdesk-outbound(${mydev});

   monitor = "${DRUID_USERFIELD(${CALLERID(number)}|monitor)}";
   if (${monitor}) {
      MONITOR_FILE="auto-${EPOCH}-${CALLERID(number)}-${number}";
      Monitor(wav,${MONITOR_FILE},mb);
   }

   // Check mobile bridge
   mobilenum = "${CUT(DIALEDPEERNUMBER|@|1)}";
   mobileexten = "${DRUID_MOBILEUSEREXTEN(${mobilenum})}";
   if (!${ISNULL(${mobileexten})}) {
      options = "wWtTkKM(ael-druid-mobilebridge)";
      CALLERID(number)=${mobileexten};
   }

   TOUCH_MONITOR="${CALLERID(number)}-${number}";
   Verbose(3|- Authenticating outbound call to);
   if (!${ISNULL(${authzone})}) {
      Verbose(3|- Zone ${authzone});
      auth = "${DRUID_ZONE(${CALLERID(number)}|${authzone})}";
     
      if (${auth} == 0) {
         if (${ISNULL(${mobileexten})}) {
            Playback(not-auth-pstn);
         };
         MacroExit;
      }
   }

   Verbose(3|- Setting outbound accountcode);
   if (!${ISNULL(${accountcode})}) {
      Set(CDR(accountcode)=${accountcode});
   }
   else {
      accountcode = "${DRUID_USERFIELD(${CALLERID(number)}|accountcode)}";
      amaflags = "${DRUID_USERFIELD(${CALLERID(number)}|amaflags)}";
      if (!${ISNULL(${accountcode})}) {
         Set(CDR(accountcode)=${accountcode});
      };
      if (!${ISNULL(${amaflags})}) {
         switch (${amaflags}) {
            case omit:
               Set(CDR(amaflags)=1);
               break;
            case billing:
               Set(CDR(amaflags)=2);
               break;
            case documentation:
               Set(CDR(amaflags)=3);
               break;
            default:
               break;
         };
      }
   };

   Verbose(3|- Setting outbound callerid);
   name = "${DRUID_USERFIELD(${CALLERID(number)}|fullname)}";
   cid = "${DRUID_USERFIELD(${CALLERID(number)}|cidnumber)}";
   if (!${ISNULL(${cid})}) {
      CALLERID(name)="${name}";
      CALLERID(number)=${cid};
   }
   else {
      if (!${ISNULL(${callerid})}) {
         Set(CALLERID(all)=${callerid});
      };
   };
   Verbose(3|- Checking if trunk is available);
   ChanIsAvail(${dev});
   if (${ISNULL(${AVAILCHAN})}) {
      if (${ISNULL(${backuptrunk})}) {
         Verbose(3|- No backup trunk configured);
         Congestion;
      }
      else {
         &ael-druid-backuptrunkdial(${backuptrunk}, ${backupnumber}, ${number});
      }
   }
   else {
      Verbose(3|- Normal trunk operation);
      Dial(${dev}/${number}||${options});
      switch(${DIALSTATUS}) {
         case CONGESTION:
         case CHANUNAVAIL:
            &ael-druid-backuptrunkdial(${backuptrunk}, ${backupnumber}, ${number});
      }
   }
   StopMonitor();
}
« Last Edit: January 06, 2009, 18:13:55 by QueueMetrics »

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2993
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Outbound and Druid
« Reply #1 on: January 06, 2009, 18:16:43 »
I think you don't really need all that stuff.

I would intercept the:

exten=>_XXXXXXXXXX,n,Macro(ael-druid-trunkdial,SIP/ipcomms,${EXTEN},WTK,,,,,${EXTEN})

and change that to

Code: [Select]
exten =>_XXXXXXXXXX,1,Set(QDIALER_QUEUE=q-999)
exten => _XXXXXXXXXX,n,Set(QDIALER_NUMBER=1${EXTEN})
exten => _XXXXXXXXXX.,n,Set(QDIALER_AGENT=Agent/${CALLERID(num)})
exten => _XXXXXXXXXX,n,Set(QDIALER_CHANNEL=SIP/trunk-name/${QDIALER_NUMBER})
exten => _XXXXXXXXXX,n,Set(QueueName=${QDIALER_QUEUE})
exten => _XXXXXXXXXX,n,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV|b|)
exten => _XXXXXXXXXX,n,Goto(qm-queuedial,s,1)

You have to make sure that the original QM dialplan is included.