Call Infomation specifc to CallStateChange

Dec 21, 2012 at 5:17 PM

There is any way to the event e.call always receive the call information to the specific e.CallState? I think with many devices will be more problematic because the e.Call.CallState and his properties can be not related to the e.CallState.

I have the following code:

private void OnCallStateChanged(object sender, CallStateEventArgs e) 
        {
            try
            {
                DateTime newcallDateTime = DateTime.Now;
                string callState = e.CallState.ToString();
                string callLine = e.Call.Line.ToString();
                string callId = e.Call.Id.ToString();
                string calledId = e.Call.CalledId;
                string callerId = e.Call.CallerId;
                string connectedId = e.Call.ConnectedId;
                string callReason = e.Call.CallReason.ToString();
                string redirectingId = e.Call.RedirectingId;
                string redirectionId = e.Call.RedirectionId;
                string canAnswer = e.Call.Features.CanAnswer.ToString();
                string canDial = e.Call.Features.CanDial.ToString();
                string canDrop = e.Call.Features.CanDrop.ToString();
              ...
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message, ex.InnerException);
            }
        }
Thank you

Coordinator
Dec 21, 2012 at 10:51 PM
Hi,

I'm not sure what you mean -- can you elaborate further?

mark

Mark Smith

On Friday, December 21, 2012 at 9:17 AM, Dpires wrote:

From: Dpires

There is any way to the event e.call always receive the call information to the specific e.CallState? I think with many devices will be more problematic because the e.Call.CallState and his properties can be not related to the e.CallState.

I have the following code:

private void OnCallStateChanged(object sender, CallStateEventArgs e)  
        {
            try
            {
                DateTime newcallDateTime = DateTime.Now;
                string callState = e.CallState.ToString();
                string callLine = e.Call.Line.ToString();
                string callId = e.Call.Id.ToString();
                string calledId = e.Call.CalledId;
                string callerId = e.Call.CallerId;
                string connectedId = e.Call.ConnectedId;
                string callReason = e.Call.CallReason.ToString();
                string redirectingId = e.Call.RedirectingId;
                string redirectionId = e.Call.RedirectionId;
                string canAnswer = e.Call.Features.CanAnswer.ToString();
                string canDial = e.Call.Features.CanDial.ToString();
                string canDrop = e.Call.Features.CanDrop.ToString();
              ...
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message, ex.InnerException);
            }
        }
Thank you

Read the full discussion online.

To add a post to this discussion, reply to this email (atapi@discussions.codeplex.com)

To start a new discussion for this project, email atapi@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Dec 21, 2012 at 11:47 PM

Hi mark,

What i mean is that, for exemple, the OnCallStateChanged event is triggered with a Connected state but by the time is being processed the call was already been dropped. The TapiCall object that is returned from the CallStateEventArgs has already a CallState idle and i cannot know what information (CallerId, calledId, etc) was in that call  in the moment it was connected.

Do you think this can happen when having many devices (more then one hundred)? Im not sure because we have very few devices to make that test.

Thanks and hope i am being clear!

Coordinator
Dec 28, 2012 at 6:16 PM
I guess it depends on how quickly it happens. You could modify the code to snapshot the CallInfo when it receives a call state from TAPI, but it's possible that it might be gone by then too if it gets dropped that fast. It should still have the caller ID information, assuming it was ever available though - unless the TSP clears the information out when the call is dropped (it's not specified in the TAPI spec how this is to be handled so it's up to the provider to decide how to handle this).

What's causing it to drop the call? Any way to delay that operation?

Mark Smith

On Friday, December 21, 2012 at 5:47 PM, dpires wrote:

From: dpires

Hi mark,

What i mean is that, for exemple, the OnCallStateChanged event is triggered with a Connected state but by the time is being processed the call was already been dropped. The TapiCall object that is returned from the CallStateEventArgs has already a CallState idle and i cannot know what information (CallerId, calledId, etc) was in that call in the moment it was connected.

Do you think this can happen when having many devices (more then one hundred)? Im not sure because we have very few devices to make that test.

Thanks and hope i am being clear!

Read the full discussion online.

To add a post to this discussion, reply to this email (atapi@discussions.codeplex.com)

To start a new discussion for this project, email atapi@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com