[cisco-voip] Inserting Cisco AVPairs from accounting request into database

vignesh vignesh at novanet.net
Fri May 26 05:43:43 EDT 2006


Hello all
I want to insert cisco AV Pairs from accounting request packet into
database. Here is the accounting request packet for a single leg.
        Acct-Session-Id = "00000B93"
        Calling-Station-Id = "216"
        Called-Station-Id = "9833515315"
        Cisco-AVPair = "call-id=19421006761822000202723 at 202.80.61.42"
        h323-setup-time = "h323-setup-time=*14:42:31.708 PCTime Fri May
26 2006"
        h323-conf-id = "h323-conf-id=989CA2C5 EBCE11DA 81EF9672
750B1B97"
        h323-call-type = "h323-call-type=VoIP"
        Cisco-AVPair = "h323-incoming-conf-id=989CA2C5 EBCE11DA 81EF9672
750B1B97"
        Cisco-AVPair = "session-protocol=sipv2"
        h323-connect-time = "h323-connect-time=*14:42:34.904 PCTime Fri
May 26 2006"
        Acct-Session-Time = 4
        h323-disconnect-time = "h323-disconnect-time=*14:42:39.020
PCTime Fri May 26 2006"
        h323-disconnect-cause = "h323-disconnect-cause=10"
        h323-remote-address = "h323-remote-address=202.80.61.42"
        h323-voice-quality = "h323-voice-quality=0"
        Cisco-AVPair = "remote-media-address=202.80.61.42"
        Cisco-AVPair = "gw-rxd-cgn=ton:0,npi:0,pi:0,si:0,#:216"
        User-Name = "202.80.61.42"
        Acct-Status-Type = Stop
        Service-Type = Login-User
        NAS-IP-Address = 202.80.61.1
        Acct-Delay-Time = 0

I changed the default table structure to include the extra columns. Also
made changes in sql.conf to add values in the respective columns.
Here is my problem. I insert h323-remote-address by adding
'%{h323-remote-address}' in the insert query
But I get the value as h323-remote-address=202.80.61.42 whereas I wanted
only the ip address not the complete string after the '=' sign.
Also I want to insert other fields like callid, remote-media-address
both of which are Cisco AVPair. So how do I include them into my
database coz I cant refer them direcly by their attribute name like
'%{remote-media-address}.  I tried that but it doesn't return any value.
So how do I insert all these values.

Thanks 
Vignesh



More information about the cisco-voip mailing list