Capture numbers entered during GSM call
The dual-tone multi-frequency (DTMF) system of transmitting data via. standardized audio tones is baked into the GSM standard and works similar to that of a land-line. When a call is in progress, pressing a number button generates a combination of audio frequencies based on which button is pressed (seen here.) If you have the ability to receive and interpret raw voice data over the GSM band, then you just need to listen for these standard tones and decode them into button presses. A quick search turns up 
example code libraries for doing just that, in addition to pre-built modules if you wanted something a little simpler.