Wednesday, September 18, 2013
List entities of an ICM script
USE ccc_awdb
SELECT scr.*,
CASE(scr.TargetType)
WHEN 1 THEN 'Service'
WHEN 2 THEN 'Skill_Group'
WHEN 3 THEN 'Agent'
WHEN 4 THEN 'Translation_Route'
WHEN 7 THEN 'Call_Type'
WHEN 8 THEN 'Enterprise_Service'
WHEN 14 THEN 'Peripheral'
WHEN 16 THEN 'Trunk_Group'
WHEN 17 THEN 'Route'
WHEN 20 THEN 'Master_Script'
WHEN 33 THEN 'Network_Vru_Script'
WHEN 37 THEN 'Expanded_Call_Variable'
END AS Type,
CASE(scr.TargetType)
WHEN 1 THEN (SELECT EnterpriseName FROM Service WHERE SkillTargetID = scr.ForeignKey)
WHEN 2 THEN (SELECT EnterpriseName FROM Skill_Group WHERE SkillTargetID = scr.ForeignKey)
WHEN 3 THEN (SELECT EnterpriseName FROM Agent WHERE SkillTargetID = scr.ForeignKey)
WHEN 4 THEN (SELECT EnterpriseName FROM Translation_Route WHERE SkillTargetID = scr.ForeignKey)
WHEN 7 THEN (SELECT EnterpriseName FROM Call_Type WHERE CallTypeID = scr.ForeignKey)
WHEN 8 THEN (SELECT EnterpriseName FROM Enterprise_Service WHERE EnterpriseServiceID = scr.ForeignKey)
WHEN 14 THEN (SELECT EnterpriseName FROM Peripheral WHERE PeripheralID = scr.ForeignKey)
WHEN 16 THEN (SELECT EnterpriseName FROM Trunk_Group WHERE TrunkGroupID = scr.ForeignKey)
WHEN 17 THEN (SELECT EnterpriseName FROM Route WHERE RouteID = scr.ForeignKey)
WHEN 20 THEN (SELECT EnterpriseName FROM Master_Script WHERE MasterScriptID = scr.ForeignKey)
WHEN 33 THEN (SELECT EnterpriseName FROM Network_Vru_Script WHERE NetworkVruScriptID = scr.ForeignKey)
WHEN 37 THEN (SELECT EnterpriseName FROM Expanded_Call_Variable WHERE ExpandedCallVariableID = scr.ForeignKey)
END AS EnterpriseName
FROM Master_Script ms
INNER JOIN Script s ON s.MasterScriptID = ms.MasterScriptID AND s.Version = ms.CurrentVersion
INNER JOIN Script_Cross_Reference scr ON scr.ScriptID = s.ScriptID
WHERE ms.EnterpriseName = 'NM_AkviziceEL'
Friday, July 19, 2013
[Grails] Use Domain.withNewSession instead of refresh()
Waaaaaaay faster.
For instance, if you have a service run by a scheduled recurring Quartz job, the service seem to be attached to a thread which does not see the updated fields in the database (always returns cached values). We may refresh the whole domain calling the refresh() method on the domain class instance, or just do this:
def allCampaigns
Campaign.withNewSession{ session ->
allCampaigns = Campaign.findAll("from Campaign where myStatus IN ('active','paused') OR myStatus = null")
}
For instance, if you have a service run by a scheduled recurring Quartz job, the service seem to be attached to a thread which does not see the updated fields in the database (always returns cached values). We may refresh the whole domain calling the refresh() method on the domain class instance, or just do this:
def allCampaigns
Campaign.withNewSession{ session ->
allCampaigns = Campaign.findAll("from Campaign where myStatus IN ('active','paused') OR myStatus = null")
}
Saturday, July 6, 2013
Cleaning up /boot
dpkg --get-selections|grep 'linux-image*'|awk '{print $1}'|egrep -v "linux-image-$(uname -r)|linux-image-generic" |while read n;do apt-get -y remove $n;done
Monday, May 27, 2013
Blocking one calling to one called
!
voice translation-rule 1001
rule 1 reject /17771238001/
!
voice translation-profile 1001
translate calling 1001
!
!incoming dial-peer 4 all
dial-peer voice 1 pots
incoming called-number .
direct-inward-dial
!
!incoming dial-peer special
dial-peer voice 1001 pots
call-block translation-profile incoming 1001
incoming called-number 0012021111001
direct-inward-dial
!
!outgoing dialpeer to CUCM
dial-peer voice 9000 voip
destination-pattern 0012021111...
session target ipv4:192.168.210.11
no vad
voice translation-rule 1001
rule 1 reject /17771238001/
!
voice translation-profile 1001
translate calling 1001
!
!incoming dial-peer 4 all
dial-peer voice 1 pots
incoming called-number .
direct-inward-dial
!
!incoming dial-peer special
dial-peer voice 1001 pots
call-block translation-profile incoming 1001
incoming called-number 0012021111001
direct-inward-dial
!
!outgoing dialpeer to CUCM
dial-peer voice 9000 voip
destination-pattern 0012021111...
session target ipv4:192.168.210.11
no vad
Tuesday, October 2, 2012
Monday, August 6, 2012
Friday, June 15, 2012
Mounting Popcorn Hour NFS share under Ubuntu 12.04
greg@antares:~$ sudo mount -t nfs -o vers=3 192.168.90.101:/share /media/popcorn
Thursday, June 7, 2012
ByteArrayOutputStream.toString() human readable
I can do this for a readable output:
public class Changer {
public static void main(String[] args) {
try {
java.io.InputStream in = new java.io.FileInputStream(new java.io.File("DBSDashboard.XML"));
java.io.OutputStream out = new java.io.ByteArrayOutputStream();
org.jdom2.input.SAXBuilder builder = new org.jdom2.input.SAXBuilder();
org.jdom2.Document document = (org.jdom2.Document) builder.build(in);
org.jdom2.Element rootNode = document.getRootElement();
org.jdom2.Element ccc= rootNode.getChild("CallCentreClosed").getChild("callCentreClosed");
ccc.setText("true");
/* or, ccc.setText("false") */
org.jdom2.output.XMLOutputter xmlOutputter = new org.jdom2.output.XMLOutputter();
xmlOutputter.setFormat(org.jdom2.output.Format.getPrettyFormat());
xmlOutputter.output(document, out);
System.out.println(out);
} catch (Exception e) {
e.printStackTrace();
}
}
}
And voila:
false
Good to know.
public static void main(String[] args) {
try {
java.io.InputStream in = new java.io.FileInputStream(new java.io.File("DBSDashboard.XML"));
java.io.OutputStream out = new java.io.ByteArrayOutputStream();
org.jdom2.input.SAXBuilder builder = new org.jdom2.input.SAXBuilder();
org.jdom2.Document document = (org.jdom2.Document) builder.build(in);
org.jdom2.Element rootNode = document.getRootElement();
org.jdom2.Element ccc= rootNode.getChild("CallCentreClosed").getChild("callCentreClosed");
ccc.setText("true");
/* or, ccc.setText("false") */
org.jdom2.output.XMLOutputter xmlOutputter = new org.jdom2.output.XMLOutputter();
xmlOutputter.setFormat(org.jdom2.output.Format.getPrettyFormat());
xmlOutputter.output(document, out);
System.out.println(out);
} catch (Exception e) {
e.printStackTrace();
}
}
}
And voila:
(...)
Good to know.
Sunday, June 3, 2012
MKP, y u no have English?!
Az előbb - unalomból - megnéztem az MKP hivatalos honlapjának angol nyelvű verzióját. A jobb felső sarokban: random kép. Csáky-Bugár dwa bratanki, azaz két jó szivar. Pártszakadás volt? Ezek szerint nem. So keep smiling.
Monday, April 23, 2012
Ubuntu open router
ip_forwarding = 1
sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
... think about your network design before you start kicking your head against the wall.
Poor external router does not know anything about internal addresses.
Fsck.
sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
... think about your network design before you start kicking your head against the wall.
Poor external router does not know anything about internal addresses.
Fsck.
Subscribe to:
Posts (Atom)


