[Spce-user] RTCP-XR support

Anibal Cañada anibal at hercom.es
Thu Oct 10 04:57:27 EDT 2013


Hello, 
I was not sure whether to send it here or development list.
But I only have a "prototype" , so we can talk about if is convenient support this or not.
I was looking for get statitics from the client , now we are mounting cisco or polycom , and I found this in internet:

http://wiki.sipfoundry.org/display/sipXecs/Setting+up+an+RTCP-XR+collector+for+Polycom+Productivity+Suite

So I adapted the perl script to lua, that is supported natively by kamailio, and now I have it running in a kamailio with a freeswitch.
I think will be great to have this integrated in sipwise. I am doing the the adaptation in a 2.8-lts , through impresence.cfg.
it need a new table in kamailio database , and I have the templates nearly complete for the sipwise 2.8-lts
It record in database, the quality of voice (MOSLQ,MOSCQ) , and the packetLoss.
I have samples of the SIP PUBLISH from cisco , if somebody need it.
Sorry for my bad english. 

Here is the script:

QUALITY.LUA:

--BEGIN OF THE FILE

luasql = require "luasql.mysql"
env = assert (luasql.mysql())
con = assert (env:connect("kamailio","user","password"))

local data = sr.pv.get("$rb")
local header = sr.pv.get("$hdr(From)")

callID = string.match(data,'CallID:%s(.-)@.-.')
name,number = string.match(header,'"(.-)"%s<sip:(.-)@')
domain = string.match(header,'<sip:.*@(.-)>')
timeStart,timeStop = string.match(data,'START=(.-)Z%sSTOP=(.-)Z')
localUA = string.match(data,'LocalAddr:%sIP=(.-)%s')
remoteUA = string.match(data,'RemoteAddr:%sIP=(.-)%s')
rtd = string.match(data,'RTD=(.-)%sESD')
moslq,moscq = string.match(data,'MOSLQ=(.-)%sMOSCQ=(.-)%s')
packetLoss = string.match(data,'PacketLoss:NLR=(.-)%s')
consulta = "INSERT INTO v_quality VALUES ('"..callID.."','"..name.."','"..number.."','"..domain.."','"..timeStart.."','"..timeStop.."','"..localUA.."','"..remoteUA.."','"..rtd.."','"..moslq.."','"..moscq.."','"..packetLoss.."')"
consulta_post = "UPDATE v_quality SET callID='"..callID.."',name ='"..name.."',number='"..number.."',domain='"..domain.."',timeStart='"..timeStart.."',timeStop='"..timeStop.."',localUA='"..localUA.."',remoteUA='"..remoteUA.."',rtd='"..rtd.."',moslq='"..moslq.."',moscq='"..moscq.."',packetLoss='"..packeLoss.."'"
consulta_prev = "SELECT rtd from v_quality where callid='"..callID.."'"
res1 = assert (con:execute(consulta_prev))
res2 = res1:numrows()
        if res2 > 0 then
        res = assert (con:execute(consulta_post))
        else
        res = assert (con:execute(consulta))
        end
assert (con:close())

--END OF FILE

MYSQL TABLE:

CREATE TABLE v_quality (
  callid varchar(50),
  name varchar(50),
  number varchar(12),
  domain varchar(60),
  timestart datetime,
  timestop datetime,
  localua varchar(20),
  remoteua varchar(20),
  rtd int(4),
  moslq varchar(10),
  moscq varchar(10),
  packetloss varchar(10) 
);





More information about the Spce-user mailing list