Hi Daniel,

The Unregister method basically calls the sipxLineRemove and
sipxUninitialize. The reason why it is called in the switch case is
because, I am calling sipxLineRegister(sipxLine, false) and I am expecting
the LINESTATE_UNREGISTERED / LINESTATE_UNREGISTER_FAILED to occur after
which I call Unregister(). This is just a test app though.

I am working off of the code base from the google:  code.*google*.com/p/*
sipxtapi*/

The SipXEventListenerAdd() is invoked just after the sipxInitialize()
method and before the sipxLineAdd() and sipxLineRegister().

The main issue I am facing is that in the HandleLineStateEvent, the
SIPX_LINESTATE_INFO object (pLineInfo) displays all the other data, but not
the event and the cause, which is why the switch-case statement doesn't
enter in that method.

The SipXezPhone is the same code base when executes seems to be working
just allright. I am just not sure what I am missing.

The libraries that I have included are the sipXtackLibD.lib sipXtapid.lib
sipXportLibD.lib.

The headers I have included in my code are: tapi/sipXtapi.h
and tapi/sipXtapiEvents.h

I am sure I must be overlooking something, but have no idea what it is.



On Thu, Aug 9, 2012 at 9:32 PM, Daniel Petrie <[email protected]> wrote:

> Hi Bhaskar:
> Your event handler looks fine to me. I am not sure what your UnRegister
> method does, but just to be clear the LINESTATE_UNREGISTER* events are not
> going to occur until after sipxLineRegister(lineHandle, false) is called.
>
> Are you getting the LINESTATE_REGISTERED state?
>
> Did you invoke sipxEventListenerAdd before the line was registered or at
> least before the line was unregistered?
>
> Also just to be sure we are talking about the same code base, what svn
> repository are you workinng off of?
>
> You may also find sipxEventToString to be useful in debugging your event
> handler.
>
> Cheers,
> Dan
>
> Sent from my Android Xoom
>
> *From: *Bhaskar Raghavendran ;
> *To: *; ;
> *Subject: *[sipX UA] Issue with SIPX_LINESTATE_INFO
> *Sent: *Thu, Aug 9, 2012 9:58:25 AM
>
> Hi,
>
> I am initializing the event listener using the
>
> sipxEventListenerAdd(sipXinstance, SipCallbackProc, NULL);
>
> In my call back function, I am trying to filter the Line State Events:
>
> bool SipXConnector::SipCallbackProc(SIPX_EVENT_CATEGORY eventCategory,
> void* pInfo, void* pUserData)
>
> {
>
> switch (eventCategory)
>
> {
>
> case EVENT_CATEGORY_LINESTATE:
>
> return
> SipXConnector::getInstance()->HandleLineStateEvent((SIPX_LINESTATE_INFO*)pInfo);
>
> default:
>
> return false;
>
> }
>
> return true;
>
> }
>
> bool SipXConnector::HandleLineStateEvent(const SIPX_LINESTATE_INFO*
> pLineInfo)
>
> {
>
> switch(pLineInfo->event)
>
> {
>
> case LINESTATE_PROVISIONED:
>
> break;
>
> case LINESTATE_PROVISIONED_NORMAL:
>
> break;
>
> case LINESTATE_REGISTERED:
>
> break;
>
> case LINESTATE_REGISTERED_NORMAL:
>
> break;
>
> case LINESTATE_UNREGISTERED:
>
> case LINESTATE_UNREGISTER_FAILED:
>
> UnRegister();
>
> break;
>
> }
>
> return true;
>
> }
>
> The problem I am facing is in the HandleLineStateEvent method above.
>
> The pLineInfo object does not show the event and the cause (the
> breakpoints on the case statements do not hit due to this), but shows the
> rest of the data, although the SIP extension gets registered successfully
> on the server.
>
> I am not sure what I am missing here. Please enlighten!
>
> Thanks!
>
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev/

Reply via email to