How do I get CallerID Info to link to Multiple SIP extension

Here is my situation. I have one SIP account (which allows as many concurrent calls as I can handle on my internet connection) going to an asterisk server. I have 12 local extensions called ext2001, ext2002, etc… Each incoming call I wish to have ringing on one and only one of those extensions. If the call is not answered, then it goes to voicemail. This is working well, as I have done this using the following code:

; Return a Busy immediately if the next line is left in exten => 1000,1,Set(CallerIDString=${CALLERID(all)}) exten => 1000,n,Set(GROUP(${EXTEN})=incoming) exten => 1000,n,noop( ${GROUP_COUNT(incoming@${EXTEN})} ) ;If too many calls, then go to busy ;exten => 1000,n,Set(foo=${CURL(http://www.pblq.com/)}) exten => 1000,n,AGI(logcall.py) exten => 1000,n,noop exten => 1000,n,GotoIf($[${GROUP_COUNT(incoming@${EXTEN})} > 10 ]?333) ; ; Dial First Extension exten => 1000,n,Set(C1State=${CHANNEL(state)}) exten => 1000,n,Dial(SIP/ext2001,20,R) ; If congestion or unavailable, then go to Next line, otherwise go to voicemail immediately exten => 1000,n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?TryTwo) exten => 1000,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?TryTwo) exten => 1000,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?TryTwo) ; Go To Voice mail because it was not answered exten => 1000,n,Goto(DoVoiceMail) ; ; Try Second Extension exten => 1000,n(TryTwo),noop exten => 1000,n,Set(C2State=${CHANNEL(state)}) exten => 1000,n,Dial(SIP/ext2002,20,R) ; If congestion or unavailable, then go to Next line, otherwise go to voicemail immediately exten => 1000,n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?TryThree) exten => 1000,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?TryThree) exten => 1000,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?TryThree) ; Go To Voice mail because it was not answered exten => 1000,n,Goto(DoVoiceMail) ; ;Try Third Extension exten => 1000,n(TryThree),noop exten => 1000,n,Set(C3State=${CHANNEL(state)}) exten => 1000,n,Dial(SIP/ext2003,15,R) ; If congestion or unavailable, then go to Next line, otherwise go to voicemail immediately exten => 1000,n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?TryFour) exten => 1000,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?TryFour) exten => 1000,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?TryFour) ; Go To Voice mail because it was not answered exten => 1000,n,Goto(DoVoiceMail) ; ;Try Fourth Extension exten => 1000,n(TryFour),noop exten => 1000,n,Set(C4State=${CHANNEL(state)}) exten => 1000,n,Dial(SIP/ext2004,15,R) ; If congestion or unavailable, then go to NextLine otherwise go to voicemail immediately exten => 1000,n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?TryFive) exten => 1000,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?TryFive) exten => 1000,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?TryFive) ; Go To Voice mail because it was not answered exten => 1000,n,Goto(DoVoiceMail) ; ; exten => 1000,n(TryFive), Goto(DoVoiceMail) ; Fall Through to Voice Mail Anyways exten => 1000,n(DoVoiceMail),Answer() exten => 1000,n,Wait(1) exten => 1000,n,Voicemail(1001,u) exten => 1000,n,Hangup() exten => 1000,333,Busy() include => extensions
This works exactly as I want since each call rings for a short period of time on one SIP port, then goes to voice mail.

My question though is how can I get the caller ID information to be delivered to some other server (preferably via an HTTP call or something like that) when the call is actually ringing on a specific port. My issue is that the DIAL() command does not return unless the channel is busy or no answer. I need to have the caller ID information on the external system while the call is ringing, not after it gets picked up.

I thought about writing some sort of timeout system on the remote system so that the asterisk system sends the caller ID information to the remote before calling the DIAL() command, and then if the remote system gets nothing for a second or so, it actually uses that data. OTOH if the DIAL() command returns immediately with a “BUSY” or “UNAVAIL” then I send a sort of “forget about it” message to the remote system and it does not use the data given previously.

I tried calling the DIAL() command with a timeout of zero to see if the local extension was available, but that does not work.

So the real questions is how can I determine if an incoming call is ringing on a SIP port so I can send the callerID information to an external system for processing?

Any ideas please would be very helpful!!!

Thank you very much.
Reed

Can anbody help me with this one?

The reason I need the caller-id info is because I have a seperate computer that shows the location (using a lookup table on the phone number) of each ringing call. The person answering the phone wants to be able to see where the call is coming from before answering.

Right now I am doing this with individual SIP accounts from my provider, and an analog caller-id box, but I have to wait for one ring before I can get the caller-ID. When I go to a single SIP account, I want to take advantage of the fact that my Asterisk server knows the phone number and can send it to an external server which does all the processing.

I can write anything for the external server as I am a software engineer so I can write any program that needs to be written.

I guess my basic question is:

Is there a way to check the status of a local SIP account without actually transferring the call first? If I could do that, then I could check the status of a local SIP account/port, and if it is available, then send the call to that port after notifying my external system with the caller-id.

Thank you to anybody who can help me.

Reed

instead of doing packet-to-packet bridging you could dump the inbound caller and the sip outbound channel into a MeetMe conference. MeetMe has the ability to run an AgiScript in the background…

might work.

Hi

have a look at ADA or tapi or flash ops panel.

I did a write up on intergrating with vtiger some while ago

cyber-cottage.co.uk/site/index.p … &Itemid=60

Ian