Hello,

Problem at hand:
I am using pjsip voip library. While making the call, the state of the call changes from early to connecting to dialing to connected etc.
I want to display the same state changes to the ui. I implemented an observer method in my ui and invoked it from the pjsip every time the
call state changes and calling DrawNow()/DrawDeferred() thereafter. Suprisingly, string associated to only first state is getting displayed to the user and not others.
The observer is getting called on every state change, DrawNow() is also getting called every time but somehow is associated text is not displayed except for the first
call state. I have tried the device debugging already.

I know publish and subscribe is another way i can try but just wondering what could be the issue in this particular case. To give you an idea, here is how i am doing it:

PJSIP code: this is the one of the callback methods in pjsip when the call is made
Code:
void on_call_state(pjsip_call_id id)
{
CMyContainer observer = NULL;
observer = new(ELeave)CMyContainer;

pjsip_state code = get_call_info(call_id);

observer->notifyUi(code);
}
--------------------------------------------------------------------

CMyContainer code: this is my implementation for getting the call state
Code:
void CMyContainer::notify(unsigned code)
{
iTextDisplayed.Zero();

switch(code)
{
case PJSIP_CALL_DIALING: // code is 1
{
iTextDisplayed.Copy()_L("Dialing...");
}
break;

case PJSIP_CALL_CONNECTING:  // code is 2
{
iTextDisplayed.Copy()_L("Connecting...");
}
break;

case PSIP_CALL_CONFIRMED:  // code is 3:
{
iTextDisplayed.Copy()_L("Connected...");
}
break;

default:
{
iTextDisplayed.Copy()_L("Early...");
}
break;

DrawNow();          //Draw method will be called and ui should be updated
}
I hope you got a little idea as to how i am doing it. notify() is getting called every time the call state changes but text corresponding to PJSIP_CALL_DIALING is displayed always.

Any idea why is that happening? Or is there any other way to do this except Publish and Subscribe?

Thanks,
Rajesh