Fw: how to check for incoming event from PJSUA API

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

 



Hi, 
I found that there is a strange thing is:

in the on_pager function, I try to copy the incoming message by following:

static void *on_pager(pjsua_call_id call_id, const pj_str_t *from, const pj_str_t *to, const pj_str_t *contact,
             const pj_str_t *mime_type, const pj_str_t *text)
{
    /* Note: call index may be -1 */
    PJ_UNUSED_ARG(call_id);
    PJ_UNUSED_ARG(to);
    PJ_UNUSED_ARG(contact);
    PJ_UNUSED_ARG(mime_type);

    PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s (%.*s)",
          (int)from->slen, from->ptr,
          (int)text->slen, text->ptr,
          (int)mime_type->slen, mime_type->ptr));
    
    puts(text->ptr);
    inmsg = text->ptr;
    puts(inmsg);
    
}

the inmsg is declare as :
        static char* inmsg;

eventhought I see that from above "puts(inmsg)" command, the inmsg copied the message. However, when I try to use the inmsg in other function in the same file, the inmsg become "". Can anyone tell me whats happen?

Sincerely,
ws



----- Forwarded Message ----
From: Soh Wei Sin <wssoh85@xxxxxxxxx>
To: pjsip list <pjsip at lists.pjsip.org>
Sent: Saturday, March 14, 2009 3:54:02 PM
Subject: Re: how to check for incoming event from PJSUA API


Hi, is there are any example on how to use the on_pager() callback? can the on_pager callback return the message to the function calling it when there is message come in?

sincerely,
ws




________________________________
From: Benny Prijono <bennylp@xxxxxxxxx>
To: pjsip list <pjsip at lists.pjsip.org>
Sent: Saturday, March 14, 2009 12:43:00 AM
Subject: Re: how to check for incoming event from PJSUA API

On Fri, Mar 13, 2009 at 4:38 PM, Soh Wei Sin <wssoh85 at yahoo.com> wrote:

Hi, thanks for your fast reply :)

    I understand that the on_pager() call able to obtain the received IM. However, since the on_pager() is an static void function, therefore, how could I pass the IM received to  other function? I need to get the message string for other purpose instead of display it on screen. So is there are any other method to do so?



I was talking about on_pager() callback in pjsua_callback structure, and not on_pager() function in pjsua_app.c application. I think that should fit your purpose.

cheers
 Benny

 
Sincerely,
WS


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090314/7cfe4297/attachment-0001.html>
-------------- next part --------------
_______________________________________________
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


[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