Call back agi function

Hi the community could anyone give me a hand on building a script that save a number called and recall it through another number depending on some sort of condition like the provider of the callers?

Could anyone provide me a sip provider that works perfectly on bria or xlite i mean that by confiuguring the provider and ur personnal account u gain connection to the sip server.

Thanks and have a nice time