Friday, September 28, 2012

Help in JSNI callback in javascript object

Hi i need some help to do a wrapper to GWT.

in javascript i have the following:

(...)

// create a new SIP stack. Not mandatory as it's possible to reuse the same satck
        oSipStack
= new tsip_stack(txtRealm.value, txtPrivateIdentity.value, txtPublicIdentity.value)
oSipStack
.on_event_stack = onSipEventStack;
oSipStack
.on_event_dialog = onSipEventDialog;

(...)

// Callback function for SIP Stacks
function onSipEventStack
(evt) {
   
// this is a special event shared by all sessions and there is no "e_stack_type"
   
// check the 'sip/stack' code
    tsk_utils_log_info
(evt.s_phrase);
   
switch (evt.i_code) {
       
case tsip_event_code_e.STACK_STARTED:

(...)

// Callback function for all SIP dialogs (INVITE, REGISTER, INFO...)
function onSipEventDialog
(evt) {
   
// this is special event shared by all sessions and there is no "e_dialog_type"
   
// check the 'sip/dialog' code
    tsk_utils_log_info
(evt.s_phrase);
   
switch (evt.i_code) {
       
case tsip_event_code_e.DIALOG_TRANSPORT_ERROR:
       
case tsip_event_code_e.DIALOG_GLOBAL_ERROR:
       
case tsip_event_code_e.DIALOG_MESSAGE_ERROR:
       
case tsip_event_code_e.DIALOG_WEBRTC_ERROR:

So in my GWT-Wrapper using JSNI i make:

public static native JavaScriptObject tsip_stack(String s_realm,
           
String s_impi, String s_impu_uri
           
) /*-{
        return new $wnd.tsip_stack(s_realm, s_impi, s_impu_uri);
    }-*/
;

How do i make the callback and is association to the javascript object.

This project is to make an wrapper of sipml5 if someone had the wrapper it helps to

Thanks Best Regards

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/HAUjdk0kmwcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment