Module: kamailio
Branch: master
Commit: 72cc3d46c39791d50927508114bdd1faa4a83f4c
URL:
https://github.com/kamailio/kamailio/commit/72cc3d46c39791d50927508114bdd1f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-04-26T10:14:58+02:00
topos: uniform processing for requests during early dialog
- requests that are handled during 1xx state, like PRACK, UPDATE, BYE
---
Modified: src/modules/topos/tps_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/72cc3d46c39791d50927508114bdd1f…
Patch:
https://github.com/kamailio/kamailio/commit/72cc3d46c39791d50927508114bdd1f…
---
diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c
index 2389026d14..bf5815fa76 100644
--- a/src/modules/topos/tps_msg.c
+++ b/src/modules/topos/tps_msg.c
@@ -834,35 +834,31 @@ int tps_request_received(sip_msg_t *msg, int dialog)
tps_storage_lock_get(&lkey);
- if((get_cseq(msg)->method_id)&(METHOD_PRACK)) {
- if(tps_storage_link_msg(msg, &mtsd, TPS_DIR_DOWNSTREAM)<0) {
+ if(tps_storage_load_dialog(msg, &mtsd, &stsd) < 0) {
+ goto error;
+ }
+ if(((get_cseq(msg)->method_id) & (METHOD_BYE|METHOD_PRACK|METHOD_UPDATE))
+ && stsd.b_contact.len <= 0) {
+ /* no B-side contact, look for INVITE transaction record */
+ memset(&stsd, 0, sizeof(tps_data_t));
+ if((get_cseq(msg)->method_id) & (METHOD_UPDATE)) {
+ /* detect direction - via from-tag */
+ if(tps_dlg_detect_direction(msg, &stsd, &direction) < 0) {
+ goto error;
+ }
+ }
+ if(tps_storage_link_msg(msg, &mtsd, direction) < 0) {
goto error;
}
- if(tps_storage_load_branch(msg, &mtsd, &stsd, 1)<0) {
+ if(tps_storage_load_branch(msg, &mtsd, &stsd, 1) < 0) {
goto error;
}
use_branch = 1;
} else {
- if(tps_storage_load_dialog(msg, &mtsd, &stsd) < 0) {
+ /* detect direction - via from-tag */
+ if(tps_dlg_detect_direction(msg, &stsd, &direction) < 0) {
goto error;
}
- if(((get_cseq(msg)->method_id) & (METHOD_BYE))
- && stsd.b_contact.len <= 0) {
- /* BYE but not B-side contact, look for INVITE transaction record */
- memset(&stsd, 0, sizeof(tps_data_t));
- if(tps_storage_link_msg(msg, &mtsd, TPS_DIR_DOWNSTREAM) < 0) {
- goto error;
- }
- if(tps_storage_load_branch(msg, &mtsd, &stsd, 1) < 0) {
- goto error;
- }
- use_branch = 1;
- } else {
- /* detect direction - via from-tag */
- if(tps_dlg_detect_direction(msg, &stsd, &direction) < 0) {
- goto error;
- }
- }
}
mtsd.direction = direction;