Passing userdata to pjsua.call_make_call from java and SWIG

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

 



@uno : if building using csipsimple code, please re-read with care the 
instructions :
http://code.google.com/p/csipsimple/wiki/HowToBuild
the first line in "Important" section is *important*, re-read it please.

On 16/05/2013 11:22, user uno wrote:
> I found in pjsua_wrap.cpp that the jni wrap function ilooks wrong.
>
> SWIGEXPORT jint JNICALL 
> Java_org_pjsip_pjsua_pjsuaJNI_call_1make_1call(JNIEnv *jenv, jclass 
> jcls, jint jarg1, jlong jarg2, jobject jarg2_, jlong jarg3, jobject 
> jarg3_, void * jarg4, jlong jarg5, jobject jarg5_, jintArray jarg6) {
>   jint jresult = 0 ;
>   pjsua_acc_id arg1 ;
>   pj_str_t *arg2 = (pj_str_t *) 0 ;
>   pjsua_call_setting *arg3 = (pjsua_call_setting *) 0 ;
>   void *arg4 = (void *) 0 ;
>   pjsua_msg_data *arg5 = (pjsua_msg_data *) 0 ;
>   pjsua_call_id *arg6 = (pjsua_call_id *) 0 ;
>   pjsua_call_id temp6 ;
>   pj_status_t result;
>   (void)jenv;
>   (void)jcls;
>   (void)jarg2_;
>   (void)jarg3_;
>   (void)jarg5_;
>   arg1 = (pjsua_acc_id)jarg1;
>   arg2 = *(pj_str_t **)&jarg2;
>   arg3 = *(pjsua_call_setting **)&jarg3;
>   arg4 = jarg4; // THIS LOOKS WRONG
>
> Everything works fine if I use the following line instead:
>
>   arg4 = (void*) jenv->GetByteArrayElements((jbyteArray)jarg4, 0);
>
> that is what I would have done if I used javah.
>
> The question is how is it possible that there is the "mistake" in the 
> pjsipjni level.
> Am I doing somehing wrong? I just used
>
> make SWIG=swig.
>
> to build it. Is it possible that the problem is that I should have 
> used swig2?
>
> Thanks
>
> On Wed, May 15, 2013 at 6:38 PM, <pjsip-request at lists.pjsip.org 
> <mailto:pjsip-request at lists.pjsip.org>> wrote:
>
>     Send pjsip mailing list submissions to
>     pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org>
>
>     To subscribe or unsubscribe via the World Wide Web, visit
>     http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>     or, via email, send a message with subject or body 'help' to
>     pjsip-request at lists.pjsip.org <mailto:pjsip-request at lists.pjsip.org>
>
>     You can reach the person managing the list at
>     pjsip-owner at lists.pjsip.org <mailto:pjsip-owner at lists.pjsip.org>
>
>     When replying, please edit your Subject line so it is more specific
>     than "Re: Contents of pjsip digest..."
>
>     Today's Topics:
>
>        1. Passing userdata to pjsua.call_make_call from java and SWIG
>           (user uno)
>
>
>     ---------- Forwarded message ----------
>     From: user uno <dammedeagle@xxxxxxxxx <mailto:dammedeagle at gmail.com>>
>     To: pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org>
>     Cc:
>     Date: Wed, 15 May 2013 18:38:42 +0100
>     Subject: Passing userdata to pjsua.call_make_call from
>     java and SWIG
>     I'm trying to call pjsua.call_make_call. I'm using the jni layer
>     in CSipSimple that is created with SWIG.
>
>     How can I pass the user_data? if I just pass the a byte[] when I use
>
>     pjsua_call_get_user_data(call_id);
>
>     in the C code I get a non null pointer but when I try to use it
>     the application crashes.
>
>     Is there an example of how to do it?
>
>     Thanks
>
>     _______________________________________________
>     pjsip mailing list
>     pjsip at lists.pjsip.org <mailto: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/20130516/e94853a7/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