diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-01-14 00:39:45 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-01-14 00:39:45 +0000 |
commit | 37ebd8262c2fded33381779df58351ba11c050de (patch) | |
tree | 2fc55477ce7f52492bf7d8de73bb1e5e99322805 /pjsip/src | |
parent | 2fe4e4e9985b9c4cbff7209a9c876a314abc9779 (diff) |
Continuing work on ticket #50: make explicit transport selection works for sending response
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@882 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src')
-rw-r--r-- | pjsip/src/pjsip/sip_dialog.c | 11 | ||||
-rw-r--r-- | pjsip/src/pjsip/sip_transaction.c | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/pjsip/src/pjsip/sip_dialog.c b/pjsip/src/pjsip/sip_dialog.c index 7b97e5b8..7858f086 100644 --- a/pjsip/src/pjsip/sip_dialog.c +++ b/pjsip/src/pjsip/sip_dialog.c @@ -1325,6 +1325,17 @@ PJ_DEF(pj_status_t) pjsip_dlg_send_response( pjsip_dialog *dlg, /* Must acquire dialog first, to prevent deadlock */ pjsip_dlg_inc_lock(dlg); + /* If the dialog is locked to transport, make sure that transaction + * is locked to the same transport too. + */ + if (dlg->tp_sel.type != tsx->tp_sel.type || + dlg->tp_sel.u.ptr != tsx->tp_sel.u.ptr) + { + status = pjsip_tsx_set_transport(tsx, &dlg->tp_sel); + pj_assert(status == PJ_SUCCESS); + } + + /* Ask transaction to send the response */ status = pjsip_tsx_send_msg(tsx, tdata); pjsip_dlg_dec_lock(dlg); diff --git a/pjsip/src/pjsip/sip_transaction.c b/pjsip/src/pjsip/sip_transaction.c index a0574ca4..4dc46520 100644 --- a/pjsip/src/pjsip/sip_transaction.c +++ b/pjsip/src/pjsip/sip_transaction.c @@ -1374,7 +1374,7 @@ PJ_DEF(pj_status_t) pjsip_tsx_set_transport(pjsip_transaction *tsx, struct tsx_lock_data lck; /* Must be UAC transaction */ - PJ_ASSERT_RETURN(tsx && sel && tsx->role == PJSIP_ROLE_UAC, PJ_EINVAL); + PJ_ASSERT_RETURN(tsx && sel, PJ_EINVAL); /* Start locking the transaction. */ lock_tsx(tsx, &lck); |