Script for send mail for missed calls

In the sip.conf file I have put information a about the trunks. For example:

[trunk1]
type=blabla
context=blabla
host:blabla
secret:blabla

[trunk2]
type=blabla
context=blabla
host:blabla
secret:blabla

[trunk3]
type=blabla
context=blabla
host:blabla
secret:blabla

If there is a missed call, I’m currently getting only the number of the caller and sending it to the person who has the missed call. Now I want him to also get the trunk who has been used to place the call with.

For example: You have a missed call from 02456345. The call took place over [trunk1] or [trunk2] [or trunk3]. Thank is what I mean. Thanks