diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-07-10 20:45:03 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-07-10 20:45:03 +0000 |
commit | 5297036bb4d751faf3dad72bdb22fd622e27b7c4 (patch) | |
tree | 804d5b7b6895dad3a9e7d5e469af5374c60bb67d /pjsip/src/pjsua-lib/pjsua_im.c | |
parent | 110237399dcdb73e45945ab995fff97dc493b81a (diff) |
Ticket 555: modifications to pjsua instant messaging callbacks
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2118 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_im.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_im.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_im.c b/pjsip/src/pjsua-lib/pjsua_im.c index f993ff90..065999fc 100644 --- a/pjsip/src/pjsua-lib/pjsua_im.c +++ b/pjsip/src/pjsua-lib/pjsua_im.c @@ -191,6 +191,21 @@ void pjsua_im_process_pager(int call_id, const pj_str_t *from, is_typing); } + if (pjsua_var.ua_cfg.cb.on_typing2) { + pjsua_acc_id acc_id; + + if (call_id == PJSUA_INVALID_ID) { + acc_id = pjsua_acc_find_for_incoming(rdata); + } else { + pjsua_call *call = &pjsua_var.calls[call_id]; + acc_id = call->acc_id; + } + + + (*pjsua_var.ua_cfg.cb.on_typing2)(call_id, from, to, &contact, + is_typing, rdata, acc_id); + } + } else { pj_str_t mime_type; char buf[256]; @@ -219,8 +234,18 @@ void pjsua_im_process_pager(int call_id, const pj_str_t *from, } if (pjsua_var.ua_cfg.cb.on_pager2) { + pjsua_acc_id acc_id; + + if (call_id == PJSUA_INVALID_ID) { + acc_id = pjsua_acc_find_for_incoming(rdata); + } else { + pjsua_call *call = &pjsua_var.calls[call_id]; + acc_id = call->acc_id; + } + (*pjsua_var.ua_cfg.cb.on_pager2)(call_id, from, to, &contact, - &mime_type, &text_body, rdata); + &mime_type, &text_body, rdata, + acc_id); } } } @@ -389,7 +414,7 @@ static void im_callback(void *token, pjsip_event *e) tsx->status_code, &tsx->status_text, tsx->last_tx, - rdata); + rdata, im_data->acc_id); } } } |