pjsua_account_set/get_user_data()?

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

 



On 3/4/08, Pedro Sanchez <psanchez at nortel.com> wrote:
> Hello,
>
>  The pjsua basic API has several callbacks defined, most of which involve
>  a call_id in the list of parameters. For those, passing user data across
>  is easy using the functions pjsua_call_set/get_user_data().
>
>  I'd like to have the same functionality with the on_reg_state() callback
>  which only involves the sip account, not the sip call. But I see no
>  pjsua_account_set/get_user_data() in the docs. Is there such a thing? If
>  not, what is the suggested workaround?
>

You're right, we don't have those functions for now. But I think the
workaround should be pretty easy. Since acc_id is just a small integer
number, application can just maintain array of user data itself,
something like:

  void *acc_user_data[PJSUA_MAX_ACC];

  void acc_set_user_data(pjsua_acc_id acc_id, void *ud)
  {
     acc_user_data[acc_id] = ud;
  }

  void* acc_get_user_data(pjsua_acc_id acc_id)
  {
    return acc_user_data[acc_id];
  }

cheers,
 -benny


>  Thanks,
>
>  --
>  Pedro



[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