Processing records as group - awk

I have a file has following records

policy glb id 1233 name Permit ping from "One" to "Second" "Address1" "Any" "ICMP-ANY" permit
policy id 999251
service "snmp-udp"
exit
policy glb id 1234 name Permit telnet from "One" to "Second" "Address2" "Any" "TCP-ANY" permit
policy id 1234
service "tcp"
exit

I want to generate a record for each glb id. exit is the end for each policy id.

the expected Output is:

#id#name,type,from,to,Address,service
1233,Permit ping,glb,One,Second,Address1,snmp-udp
1234,Permit telnet,glb,One,Second,Address2,snmp-tcp

Thanks in advance

local $/;
my $str=<DATA>;
my @tmp=split(/(?<=exit)\n/,$str);
foreach(@tmp){
	if(/.*id\s*([0-9]+)\s*name\s*(.*)\sfrom\s*"([^"]*)"\s*to\s*"([^"]*)"\s*"([^"]+)".*service\s*"([^"]+)"/msx){
		print "$1,$2,$3,$4,$5,$6\n";
	}
}
__DATA__
policy glb id 1233 name Permit ping from "One" to "Second" "Address1" "Any" "ICMP-ANY" permit 
policy id 999251
service "snmp-udp"
exit
policy glb id 1234 name Permit telnet from "One" to "Second" "Address2" "Any" "TCP-ANY" permit 
policy id 1234
service "tcp"
exit
awk  'BEGIN {RS = "exit"} {print $4,$6" "$7,$2,$9,$11,$12,$NF}' OFS="," urfile

Thanks for quick update.

I'm working with a file that does not have fixed field numbers, some records have additional name and value. I want to make single line from each set ex: from policy to exit, then I want to print the value of id, name, address(multiple addresses) by finding the pattern (id, name ..etc)

awk '/policy/,/exit/{ if($0~/exit/) ORS="\n"; else ORS=" "; print}' input > tmp

I want to read tmp and find next word (value) of matched pattern (id, name, etc)

first record
policy glb id 1233 name Permit ping from "One" to "Second" "Address1" "Any" "ICMP-ANY" permit
policy id 1233
service "snmp-udp"
exit
second record
policy id 1234 name Permit ping from "One" to "Second" address "Address1" "Any" "ICMP-ANY" permit
policy id 1234
address "xyzabc"
address "12345"
service "snmp-udp"
exit

Expected output:

id name from to address service
1234 Permit Ping One Second Address1 snmp-udp
1234 Permit Ping One Second xyzabc snmp-udp
1234 Permit ping One Second 12345 snmp-udp