Getting only Deliveries would be even simpler than summing up provided and requested items.
Check the Interface_Demo from in LTN. It writes all data LTN exposes to logfile.
https://github.com/Yousei9/Logistic-Train-Network/blob/master/Interface_Demo/control.lua
Dispatcher.Deliveries contains all information about a delivery including train and stop names.
To get the exact stop by unit_number either make a lookup table of [name] = unit_number. since LTN currently requires provider/requester having unique names it will work for your purpose without having to worry about duplicate name handling.
The other option would be to use LTN's Stop_Data.activeDeliveries and compare that to Dispatcher.Deliveries.train.id to get the pair and then use the name do decide which is provider and requester.