Ignore:
Timestamp:
May 26, 2006 12:17:46 PM (18 years ago)
Author:
bennylp
Message:

First stage in pjsua library re-arrangements towards creating an easy to use high level API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c

    r300 r476  
    153153        text.slen = rdata->msg_info.msg->body->len; 
    154154 
    155         pjsua_ui_on_pager(call_index, from, to, &text); 
     155        if (pjsua.cb.on_pager) 
     156            (*pjsua.cb.on_pager)(call_index, from, to, &text); 
    156157 
    157158    } else { 
     
    170171        } 
    171172 
    172         pjsua_ui_on_typing(call_index, from, to, is_typing); 
     173        if (pjsua.cb.on_typing) 
     174            (*pjsua.cb.on_typing)(call_index, from, to, is_typing); 
    173175    } 
    174176 
     
    270272 * Send IM outside dialog. 
    271273 */ 
    272 pj_status_t pjsua_im_send(int acc_index, const char *dst_uri,  
    273                           const char *str) 
     274PJ_DEF(pj_status_t) pjsua_im_send(int acc_index, const char *dst_uri,  
     275                                  const char *str) 
    274276{ 
    275277    pjsip_tx_data *tdata; 
     
    282284 
    283285    /* Create request. */ 
    284     status = pjsip_endpt_create_request( pjsua.endpt, &pjsip_message_method, 
    285                                          &dst, &pjsua.acc[acc_index].local_uri, 
    286                                          &dst, NULL, NULL, -1, NULL, &tdata); 
     286    status = pjsip_endpt_create_request(pjsua.endpt, &pjsip_message_method, 
     287                                        &dst,  
     288                                        &pjsua.config.acc_config[acc_index].id, 
     289                                        &dst, NULL, NULL, -1, NULL, &tdata); 
    287290    if (status != PJ_SUCCESS) { 
    288291        pjsua_perror(THIS_FILE, "Unable to create request", status); 
     
    296299    /* Add contact. */ 
    297300    pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 
    298                        pjsip_generic_string_hdr_create(tdata->pool,  
    299                                                        &STR_CONTACT, 
    300                                                        &pjsua.acc[acc_index].contact_uri)); 
     301        pjsip_generic_string_hdr_create(tdata->pool,  
     302                                        &STR_CONTACT, 
     303                                        &pjsua.config.acc_config[acc_index].contact)); 
    301304 
    302305    /* Duplicate text. 
     
    331334 * Send typing indication outside dialog. 
    332335 */ 
    333 pj_status_t pjsua_im_typing(int acc_index, const char *dst_uri,  
    334                             pj_bool_t is_typing) 
     336PJ_DEF(pj_status_t) pjsua_im_typing(int acc_index, const char *dst_uri,  
     337                                    pj_bool_t is_typing) 
    335338{ 
    336339    const pj_str_t dst = pj_str((char*)dst_uri); 
     
    340343    /* Create request. */ 
    341344    status = pjsip_endpt_create_request( pjsua.endpt, &pjsip_message_method, 
    342                                          &dst, &pjsua.acc[acc_index].local_uri, 
     345                                         &dst,  
     346                                         &pjsua.config.acc_config[acc_index].id, 
    343347                                         &dst, NULL, NULL, -1, NULL, &tdata); 
    344348    if (status != PJ_SUCCESS) { 
Note: See TracChangeset for help on using the changeset viewer.