Fwd: Buddy presence issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Baskar


I  fixed the issue


Thanks

Yuvaraj R

On Tue, Sep 22, 2009 at 10:56 AM, Yuvaraj R <yuvaraj at ongobiz.com> wrote:

>  If i change my status for idle or away,i am getting unknown status only..
>
>  how come to i know ,if buddy is in idle or away status
>
> To detect presence additionally i added in pjsua.h file like this..
> typedef enum pjsua_buddy_status
>
> {
>
> PJSUA_BUDDY_STATUS_UNKNOWN,
>
>  PJSUA_BUDDY_STATUS_ONLINE,
>
> PJSUA_BUDDY_STATUS_OFFLINE,
>
> PJSUA_BUDDY_STATUS_IDLE,
>
> PJSUA_BUDDY_STATUS_AWAY,
>
> } pjsua_buddy_status;
>
>
>
> When detecting the status
>
> switch (buddy->status)
>
> {
>
> case PJSUA_BUDDY_STATUS_UNKNOWN:
>
> QString *name = new QString("Offline");
>
> list_presence.insert(item,name);
>
> item->setIcon(QIcon(":image/Icons/offline.PNG"));
>
> break;
>
> case PJSUA_BUDDY_STATUS_ONLINE:
>
> item->setIcon(QIcon(":image/Icons/online.PNG"));
>
> QString *name1 = new QString("Online");
>
> list_presence.insert(item,name1);
>
> item->setHidden(false);
>
> break;
>
> case PJSUA_BUDDY_STATUS_OFFLINE:
>
> QString *name2 = new QString("Offline");
>
> list_presence.insert(item,name2);
>
> item->setIcon(QIcon(":image/Icons/offline.PNG"));
> break;
>
> case PJSUA_BUDDY_STATUS_AWAY:
>
> QMessageBox::information(0,"",QString("Away"));
>
> break;
>
> case PJSUA_BUDDY_STATUS_IDLE:
>
> QMessageBox::information(0,"",QString("Idle"));
>
> break;
>
> Thanks
>
> Yuvaraj R
>
>
> On Tue, Sep 22, 2009 at 9:58 AM, Yuvaraj R <yuvaraj at ongobiz.com> wrote:
>
>> Thanks Baskar,
>>
>> It is working...
>>
>> but my status is not publishing,
>>
>> to publish my status  i have to  this pjsua_acc_set_online_statusfunction ha ?
>>
>>
>> Thanks
>>
>> Yuvaraj R
>>
>>
>> On Tue, Sep 22, 2009 at 12:56 AM, Rachel Baskaran <
>> rachelbaskaran at gmail.com> wrote:
>>
>>> Why don't you use this code I have attached, just try it(attach the code
>>> as written on my comment line) I haven't worked with this buddy thing. I
>>> presume it may work.
>>>
>>> /* below the header file */
>>> enum{
>>> ONLINE, IDLE, AWAY, OFFLINE};
>>> struct presence_status{
>>> int id;
>>> char *name;
>>> }
>>> opts[]={
>>> { ONLINE, "Online"},
>>> { IDLE, "Idle"},
>>> { AWAY, "Away"},
>>> { OFFLINE, "Offline"}
>>> };
>>>
>>>
>>> /* insert after your account registration */
>>> int dll_setStatus(int accId, int presence_state)
>>> {
>>> pj_status_t online_status;
>>> pj_bool_t is_online = PJ_FALSE;
>>> pjrpid_element elem;
>>>
>>> pj_bzero(&elem, sizeof(elem));
>>> elem.type = PJRPID_ELEMENT_TYPE_PERSON;
>>>
>>> online_status = PJ_TRUE;
>>>
>>> switch(presence_state){
>>> case ONLINE:
>>> break;
>>> case IDLE:
>>> elem.activity = PJRPID_ACTIVITY_UNKNOWN;
>>> elem.note = pj_str("Idle");
>>>  break;
>>>
>>> case AWAY:
>>> elem.activity = PJRPID_ACTIVITY_AWAY;
>>> elem.note = pj_str("Away");
>>> break;
>>>
>>> case OFFLINE:
>>> online_status = PJ_TRUE;
>>> break
>>> }
>>> pj_status_t status = pjsua_acc_set_online_status2(accId, online_status,
>>> &elem);
>>> return status;
>>> }
>>>
>>> If above code works, there are chances of getting error for that pj_bzero
>>> thing. Hope it's useful for you.
>>>
>>> Regards
>>> Rachel
>>>
>>>
>>>
>>>
>>> On Mon, Sep 21, 2009 at 12:30 PM, Yuvaraj R <yuvaraj at ongobiz.com> wrote:
>>>
>>>> Thanks for reply
>>>>
>>>> if use pointer application is crashing while accessing activity
>>>>
>>>> please help me how do i fix this issue ?
>>>>
>>>>
>>>> Thanks
>>>>
>>>> Yuvaraj R
>>>>
>>>> On Mon, Sep 21, 2009 at 9:22 PM, Rachel Baskaran <
>>>> rachelbaskaran at gmail.com> wrote:
>>>>
>>>>> I felt the pjrpid_element is a pointer. If only you define a pointer
>>>>> you could use *&elem* in
>>>>> pjsua_acc_set_online_status2(acc_id,online_status,&elem);
>>>>>
>>>>> Try:
>>>>> pjrpid_element *elem;
>>>>>
>>>>> This might be one of reason for your crash.
>>>>>
>>>>> On Mon, Sep 21, 2009 at 10:18 AM, Yuvaraj R <yuvaraj at ongobiz.com>wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>> ---------- Forwarded message ----------
>>>>>> From: Yuvaraj R <yuvaraj@xxxxxxxxxxx>
>>>>>> Date: Mon, Sep 21, 2009 at 7:47 PM
>>>>>> Subject: Buddy presence issue
>>>>>> To: pjsip at list.pjsip.org
>>>>>>
>>>>>>
>>>>>> Hi All
>>>>>>
>>>>>> I am  have trouble with  buddy presence
>>>>>>
>>>>>> I want to set following status for buddy
>>>>>>
>>>>>> 1) Online
>>>>>>
>>>>>> 2)offline
>>>>>>
>>>>>> 3) Away
>>>>>>
>>>>>> 4) ideal
>>>>>>
>>>>>>
>>>>>> *Code :*
>>>>>> bool *ok;
>>>>>>
>>>>>> pj_status_t status;
>>>>>>
>>>>>> pj_bool_t online_status;
>>>>>>
>>>>>> pjrpid_element elem;
>>>>>>
>>>>>> enum status
>>>>>>
>>>>>> {
>>>>>>
>>>>>> Online,
>>>>>>
>>>>>> Offline,
>>>>>>
>>>>>> Busy,
>>>>>>
>>>>>> Idle,
>>>>>>
>>>>>> Away,
>>>>>>
>>>>>> };
>>>>>>
>>>>>> QMessageBox::information(0,"",QString("1"));
>>>>>>
>>>>>> if(sipOn)
>>>>>>
>>>>>> {
>>>>>>
>>>>>> QMessageBox::information(0,"",QString("2"));
>>>>>>
>>>>>> switch(text.toInt(ok,10))
>>>>>>
>>>>>> {
>>>>>>
>>>>>> case Online:
>>>>>>
>>>>>> elem.activity = PJRPID_ACTIVITY_BUSY;
>>>>>>
>>>>>> elem.note = pj_str("Busy");
>>>>>>
>>>>>> online_status =PJ_TRUE;
>>>>>>
>>>>>> break;
>>>>>>
>>>>>> case Offline:
>>>>>>
>>>>>> online_status =PJ_FALSE;
>>>>>>
>>>>>> break;
>>>>>>
>>>>>> case Idle:
>>>>>>
>>>>>> elem.activity = PJRPID_ACTIVITY_UNKNOWN;
>>>>>>
>>>>>> elem.note = pj_str("Idle");
>>>>>>
>>>>>> online_status =PJ_TRUE;
>>>>>>
>>>>>> break;
>>>>>>
>>>>>> case Away:
>>>>>>
>>>>>> elem.activity = PJRPID_ACTIVITY_AWAY;
>>>>>>
>>>>>> elem.note = pj_str("Away");
>>>>>>
>>>>>> break;
>>>>>>
>>>>>> }
>>>>>>
>>>>>> QMessageBox::information(0,"",QString("3"));
>>>>>>
>>>>>> pjsua_acc_set_online_status2(acc_id, online_status, &elem);
>>>>>>
>>>>>> QMessageBox::information(0,"",QString("4"));
>>>>>>
>>>>>> }
>>>>>>
>>>>>> Here QmessageBox is  Qt realated to verify the code (such as printf
>>>>>> statements).
>>>>>>
>>>>>> When i am calling the pjsua_acc_set_online_status2(acc_id,
>>>>>> online_status, &elem); My application is crashing..
>>>>>>
>>>>>>
>>>>>> Can anybody say what is the reason.
>>>>>>
>>>>>> Please help me.
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Yuvaraj R
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Visit our blog: http://blog.pjsip.org
>>>>>>
>>>>>> pjsip mailing list
>>>>>> pjsip at lists.pjsip.org
>>>>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Visit our blog: http://blog.pjsip.org
>>>>>
>>>>> pjsip mailing list
>>>>> pjsip at lists.pjsip.org
>>>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Visit our blog: http://blog.pjsip.org
>>>>
>>>> pjsip mailing list
>>>> pjsip at lists.pjsip.org
>>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Visit our blog: http://blog.pjsip.org
>>>
>>> pjsip mailing list
>>> pjsip at lists.pjsip.org
>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090922/188e55a4/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux