diff options
author | Liong Sauw Ming <ming@teluu.com> | 2012-06-20 10:39:05 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2012-06-20 10:39:05 +0000 |
commit | 8f176cf7c8af5c681b7b616500b6eb32adb28887 (patch) | |
tree | b4aba22b23c9d59115b0f190e161933c05f6d667 /pjsip/src/pjsua-lib/pjsua_im.c | |
parent | 253bf3c598087e7d4b11d0c0cb3940551becfcdc (diff) |
Fixed #1537: Via rewrite: putting the right IP address in Via sent-by for outgoing requests
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4173 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 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_im.c b/pjsip/src/pjsua-lib/pjsua_im.c index a1062c6f..7c6886a4 100644 --- a/pjsip/src/pjsua-lib/pjsua_im.c +++ b/pjsip/src/pjsua-lib/pjsua_im.c @@ -601,6 +601,12 @@ PJ_DEF(pj_status_t) pjsua_im_send( pjsua_acc_id acc_id, /* Add route set */ pjsua_set_msg_route_set(tdata, &acc->route_set); + /* If via_addr is set, use this address for the Via header. */ + if (acc->cfg.allow_via_rewrite && acc->via_addr.host.slen > 0) { + tdata->via_addr = acc->via_addr; + tdata->via_tp = acc->via_tp; + } + /* Send request (statefully) */ status = pjsip_endpt_send_request( pjsua_var.endpt, tdata, -1, im_data, &im_callback); @@ -684,6 +690,12 @@ PJ_DEF(pj_status_t) pjsua_im_typing( pjsua_acc_id acc_id, /* Add route set */ pjsua_set_msg_route_set(tdata, &acc->route_set); + /* If via_addr is set, use this address for the Via header. */ + if (acc->cfg.allow_via_rewrite && acc->via_addr.host.slen > 0) { + tdata->via_addr = acc->via_addr; + tdata->via_tp = acc->via_tp; + } + /* Create data to reauthenticate */ im_data = PJ_POOL_ZALLOC_T(tdata->pool, pjsua_im_data); im_data->acc_id = acc_id; |