Back
Example LRT
lrt commands
lrt xml range type example


LRT - one of the routing options on SBC.
Can by used in place of ENUM. LRT config and files are stored on SBC, as opposed to external server when using ENUM.

Configuring lrt on SBC involve configuring 
1) local-routing-config object 
2) local-policy object configured such that next-hop points to local-routing-config object name
   next-hop   lrt:<local-routing-config name>
   i.e. next-hop: lrt:priv_lrt
3) Placing the compressed .xml (.gz) file(s) in /code/lrt directory 
   (take a .xml file and gzip it: linux# gzip privlist.xml)
   Then take the privlist.xml.gz file and put in /code/lrt

======================================================================================================
If you have a SAG (session agent group), you can use in LRT, (by matching on the name of it). You must, though, enable enum-sag-match in the sip-config object.
======================================================================================================
LRT in general designed to pre-define complete phone number you would like to react on. You can use LRT as a next hop in one policy attribute for pre-defined numbers, and have a second policy attribute for numbers not defined inside LRT. So can have 2 policy attributes for one local-policy and once number not match on any LRT number, sbc will recurce to second policy attribute, where you can have a second or default route.
======================================================================================================
relevant commands: notify lrtd refresh priv_lrt show lrt route-entry LRT_US-1 9786276030 show lrt route-table lookupI
======================================================================================================
If you have the .xml file, you can check it for errors, using the xmllint tool on linux: linux# xmllint DID.xml python script if you want to read just the number in lrt xml file where numbers are a range (replace in filehandle line, with correct name of your xml file):
======================================================================================================
#!/usr/bin/python import re import xml.etree.ElementTree as ET def main(): filehandle=open("priv_lrt.xml",'r') data = filehandle.read() dtree = ET.fromstring(data) lst = dtree.findall('route') for item in lst: print 'user type:',item.find('user').get('type'), print 'RangeStart:',item.find('user').get('rangeStart'), print 'RangeEnd:',item.find('user').get('rangeEnd') if __name__=='__main__': main()
======================================================================================================
python script if you want to read just the number in lrt xml file (replace in filehandle line, with correct name of your xml file): #!/usr/bin/python import re import xml.etree.ElementTree as ET def main(): filehandle=open("DIDUS.xml",'r') data = filehandle.read() stuff = ET.fromstring(data) lst = stuff.findall('route') print 'User count: ', len(lst) for item in lst: #print 'user type:',item.find('user').get('type') print 'user :', item.find('user').text if __name__=='__main__': main()