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

Catalog of dial plans
Post Reply
qubo
Posts: 127
Joined: Tue Apr 12, 2011 6:11 am

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

Post by qubo » Mon Aug 04, 2014 7:24 pm

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

User avatar
Aaron
Site Admin
Posts: 4551
Joined: Thu Jul 12, 2007 12:13 am

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

Post by Aaron » Tue Aug 05, 2014 11:14 am

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

qubo
Posts: 127
Joined: Tue Apr 12, 2011 6:11 am

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

Post by qubo » Tue Aug 05, 2014 12:50 pm

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

User avatar
Aaron
Site Admin
Posts: 4551
Joined: Thu Jul 12, 2007 12:13 am

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

Post by Aaron » Wed Aug 06, 2014 2:25 am

Instead of req.Header.From.ToString() try req.Header.From.FromURI.User or req.Header.From.DisplayName.

qubo
Posts: 127
Joined: Tue Apr 12, 2011 6:11 am

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

Post by qubo » Wed Aug 06, 2014 3:09 am

Thanks so much Aaron it works with req.Header.From.FromURI.User

thanks a lot

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests