Call Reference Length as a variable

Hello,

how can I get the Call Reference Length as a variable??
When I do a “pri debug span X” I get something like this:

< Protocol Discriminator: Q.931 (8) len=10 < Call Ref: len= 2 (reference 9/0x9) (Terminator) < Message type: SETUP ACKNOWLEDGE (13)

Now I need the 2 from the Call Reference Length in a variable.
Any ideas?