diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-09-27 13:14:52 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-09-27 13:14:52 +0000 |
commit | 6b8d251db07c478f233cbe2393ff9add63873c6f (patch) | |
tree | 6feda8cd45a824e8b22dfd261c27b6942d184b84 /pjsip/src/pjsip/sip_transport.c | |
parent | 5e73abe535570c01289e786aee46564dc9d97dd4 (diff) |
Fixed ticket #383: Bug with handling Via received and rport parameters for response message
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1453 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip/sip_transport.c')
-rw-r--r-- | pjsip/src/pjsip/sip_transport.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c index 5f6679aa..03e82a05 100644 --- a/pjsip/src/pjsip/sip_transport.c +++ b/pjsip/src/pjsip/sip_transport.c @@ -1310,16 +1310,19 @@ PJ_DEF(pj_ssize_t) pjsip_tpmgr_receive_packet( pjsip_tpmgr *mgr, goto finish_process_fragment; } - /* Always add received parameter to the via. */ - pj_strdup2(rdata->tp_info.pool, - &rdata->msg_info.via->recvd_param, - rdata->pkt_info.src_name); - - /* RFC 3581: - * If message contains "rport" param, put the received port there. - */ - if (rdata->msg_info.via->rport_param == 0) { - rdata->msg_info.via->rport_param = rdata->pkt_info.src_port; + /* For request: */ + if (rdata->msg_info.msg->type == PJSIP_REQUEST_MSG) { + /* always add received parameter to the via. */ + pj_strdup2(rdata->tp_info.pool, + &rdata->msg_info.via->recvd_param, + rdata->pkt_info.src_name); + + /* RFC 3581: + * If message contains "rport" param, put the received port there. + */ + if (rdata->msg_info.via->rport_param == 0) { + rdata->msg_info.via->rport_param = rdata->pkt_info.src_port; + } } /* Drop response message if it has more than one Via. |