Oops, I figured out the problem. It has to do with the SipXTapiDotNet
abstraction. It saves each call received in a collection, which I
mistakenly thought matched the value of the handle. It seems rather to
fix this code you would just do:

 

call= sipx.Lines[line].Calls.Count; //get the latest new call created on
the stack/collection

sipx.Lines[line].Calls[call].Accept();

 

 

Jason Hillier

Digital Business Solutions LLC

Office: (800) 768-0213

Cell: (801) 682-5580

http://www.thedigitalanswer.com <http://www.thedigitalanswer.com/> 

From: Jason Hillier 
Sent: Wednesday, August 15, 2007 12:24 PM
To: [email protected]
Subject: callstateevent.offering

 

Hi everyone,

 

I'm new to sipxtapi and was hoping someone could help me. I have a
functioning SIP phone client which can call and receive calls (is
connecting through asterisk proxy). However, whenever a second call
comes through, I get a KeyNotFoundException when try to execute
sipx.Line[line].Calls[call].Accept(); method on Offering event.

Like so (C#):

When e.CallStateinfo.StateEvent ==
SipXTapiDotNet.SipxCallStateEvent.Offering://pseudo

 

call=e.CallStateinfo.CallHandle.ToInt32();

sipx.Lines[line].Calls[call].Accept(); //[also tried with just
.Answer()]

 

The first time a call comes in, this code executes correctly, and the
call gets Answered. The second time a call comes in I get a
KeyNotFoundException indicating the 'call' is invalid. Why does it work
once but not a second time? I made sure to close previous call handle.
Reinitializing the line would probably work, but then I would lose
registration with the SIP server.

 

FYI on the first offering, call=2. On the second, call=5 (which it then
says KeyNotFound). Don't know if that helps any.

 

Anyone know what I am doing wrong?

 

Jason Hillier

Digital Business Solutions LLC

Office: (800) 768-0213

Cell: (801) 682-5580

http://www.thedigitalanswer.com <http://www.thedigitalanswer.com/> 

_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to