CallerID when the received call is from a forwarded call

General discussions about AsteriskNOW.

Moderators: Moderator, Support

CallerID when the received call is from a forwarded call

Postby sergiojuan » Thu Dec 01, 2011 8:23 am

Hi everyone,

I want to forward my cell phone so all the incoming calls go to my asterisk pbx, and I need asterisk to know that that incoming call is coming from my cell phone.

The caller id received by asterisk is the caller id of the person that is making the call to my cell phone.

What I want to do is to be able to forward several cell phone to the asterisk, and that asterisk can recognize which of those cell phones is the one being called and is forwarding that call.

Any suggestions?
sergiojuan
Newsterisk
 
Posts: 1
Joined: Wed May 30, 2007 8:17 pm

Re: CallerID when the received call is from a forwarded call

Postby jjkool » Mon Dec 26, 2011 10:19 pm

Hey,

There is but you may run into some problems. There is the RDNIS which is the number the original caller called (IE cell phone number), however this is set by the cell provider. Some cell companies do not update this information correctly when forward all calls is enabled. I have read (but not verified) that setting busy/unavail/noanswer forwards normally makes their system put in forwarding data.

I use the following code:

exten = s,1,GotoIf($["${CALLERID(rdnis)}" = "905XXXXXXX"]?1-fwdPhone1,1)
exten = s,2,GotoIf($["${CALLERID(rdnis)}" = "416XXXXXXX"]?1-fwdPhone2,1)
exten = s,n,Hangup() // what to do if call doesnt meet above criteria
exten = 1-fwdPhone1,1,Dial(SIP/1000,r) // what to do with phone1
exten = 1-fwdPhone2,1,Dial(SIP/1000,r) // what to do with phone2

The ',r' is needed so the calling party hears ringing while the extensions are alerted. This doesnt handle all events, but it works!
jjkool
Newsterisk
 
Posts: 29
Joined: Mon Mar 17, 2008 10:41 am


Return to AsteriskNOW General

Who is online

Users browsing this forum: No registered users and 2 guests