Page 1 of 1

it is possible to LOG incoming calls for each sip account an

Posted: Mon Aug 04, 2014 7:24 pm
by qubo
it is possible to LOG incoming calls for each sip account I own an send a email with the call number of incoming as they arrived ?




myaccount1@sipsorcery.com log and email the number that is calling to examp1@gmail.com
myaccount2@sipsorcery.com log and email the number that is calling to examp1@gmail.com
myaccount3@sipsorcery.com log and email the number that is calling to examp1@gmail.com

and the incoming mail said something like this myaccount1 52331209xxx at 8 pm aug3 date if dificult only myaccount1 and number is fine

if yes hi I could add in the incoming dialplan ?

thanks so much

Re: it is possible to LOG incoming calls for each sip accoun

Posted: Tue Aug 05, 2014 11:14 am
by Aaron
Something like:

Code: Select all

case req.URI.User:
  when "myaccount1" then sys.Email("examp1@gmail.com", "SIPSorcery Call Notification", "A call was just received from #{req.Header.From.ToString()}.")
  when "myaccount2" then sys.Email("examp2@gmail.com", "SIPSorcery Call Notification", "A call was just received from #{req.Header.From.ToString()}.")
  when "myaccount3" then sys.Email("examp3@gmail.com", "SIPSorcery Call Notification", "A call was just received from #{req.Header.From.ToString()}.")
end

Re: it is possible to LOG incoming calls for each sip accoun

Posted: Tue Aug 05, 2014 12:50 pm
by qubo
Ohhhhh very nice Aaron thanks a lot... by the way how i could do to only send phone number instead of number@198.34.x.x tag xxxxxx


Thanks so much Aaron it help me a lot

Re: it is possible to LOG incoming calls for each sip accoun

Posted: Wed Aug 06, 2014 2:25 am
by Aaron
Instead of req.Header.From.ToString() try req.Header.From.FromURI.User or req.Header.From.DisplayName.

Re: it is possible to LOG incoming calls for each sip accoun

Posted: Wed Aug 06, 2014 3:09 am
by qubo
Thanks so much Aaron it works with req.Header.From.FromURI.User

thanks a lot