Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topos: add enable_register_publish #3766

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/modules/topos/tps_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,12 @@ int tps_request_received(sip_msg_t *msg, int dialog)
unsigned int metid = 0;

LM_DBG("handling incoming request\n");
if(_tps_enable_register_publish == 0) {
if((get_cseq(msg)->method_id) & (METHOD_REGISTER | METHOD_PUBLISH))

/* nothing to do for REGISTER PUBLISH request */

if((get_cseq(msg)->method_id) & (METHOD_REGISTER | METHOD_PUBLISH)){
/* nothing to do for REGISTER PUBLISH when received */
return 0;
}

if(dialog == 0) {
/* nothing to do for initial request */
return 0;
Expand Down Expand Up @@ -1136,11 +1136,8 @@ int tps_reg_response_received(sip_msg_t *msg)
}

mtsd.direction = direction;

tps_storage_lock_release(&lkey);

tps_reappend_via(msg, &btsd, &btsd.x_via);
tps_append_xbranch(msg, &mtsd.x_vbranch1);

return 0;

Expand All @@ -1163,10 +1160,14 @@ int tps_request_sent(sip_msg_t *msg, int dialog, int local)

LM_DBG("handling outgoing request (%d, %d)\n", dialog, local);

if(_tps_enable_register_publish == 1) {
LM_DBG("_tps_enable_register_publish==1\n");
if((get_cseq(msg)->method_id) & (METHOD_REGISTER | METHOD_PUBLISH))

if((get_cseq(msg)->method_id) & (METHOD_REGISTER | METHOD_PUBLISH)){
if(_tps_enable_register_publish == 1) {
LM_DBG("_tps_enable_register_publish==1\n");
return tps_reg_request_sent(msg);
}else{
return 0;
}
}

memset(&mtsd, 0, sizeof(tps_data_t));
Expand Down Expand Up @@ -1337,7 +1338,10 @@ int tps_response_sent(sip_msg_t *msg)
int contact_keep = 0;

LM_DBG("handling outgoing response\n");

if((get_cseq(msg)->method_id) & (METHOD_REGISTER | METHOD_PUBLISH)){
/* nothing to do for REGISTER PUBLISH response sent*/
return 0;
}
memset(&mtsd, 0, sizeof(tps_data_t));
memset(&stsd, 0, sizeof(tps_data_t));
memset(&btsd, 0, sizeof(tps_data_t));
Expand All @@ -1353,10 +1357,6 @@ int tps_response_sent(sip_msg_t *msg)
}
mtsd.x_vbranch1 = xvbranch;
tps_remove_xbranch(msg);
if(_tps_enable_register_publish == 0) {
if((get_cseq(msg)->method_id) & (METHOD_REGISTER | METHOD_PUBLISH))
return 0;
}
if(get_cseq(msg)->method_id == METHOD_MESSAGE) {
tps_remove_headers(msg, HDR_RECORDROUTE_T);
tps_remove_headers(msg, HDR_CONTACT_T);
Expand Down