Skip to content

Commit

Permalink
cdp: remove unnecessary checks inside Send_ASR()
Browse files Browse the repository at this point in the history
- updates to log messages
  • Loading branch information
miconda committed Jun 13, 2023
1 parent 6a19434 commit db31ddb
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/modules/cdp/authstatemachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,11 +971,12 @@ void Send_ASR(cdp_session_t *s, AAAMessage *msg)
AAA_AVP *avp = 0;
peer *p = 0;
char x[4];
LM_DBG("Send_ASR() : sending ASR\n");

LM_DBG("sending ASR\n");
asr = AAACreateRequest(s->application_id, IMS_ASR, Flag_Proxyable, s);

if(!asr) {
LM_ERR("Send_ASR(): error creating ASR!\n");
LM_ERR("error creating ASR!\n");
return;
}

Expand All @@ -992,14 +993,14 @@ void Send_ASR(cdp_session_t *s, AAAMessage *msg)

p = get_routing_peer(s, asr);
if(!p) {
LM_ERR("unable to get routing peer in Send_ASR \n");
if(asr)
AAAFreeMessage(&asr); //needed in frequency
LM_ERR("unable to get routing peer\n");
AAAFreeMessage(&asr); //needed in frequency
}

if(!peer_send_msg(p, asr)) {
if(asr)
AAAFreeMessage(&asr); //needed in frequency
} else
LM_ERR("unable to send message\n");
AAAFreeMessage(&asr); //needed in frequency
} else {
LM_DBG("success sending ASR\n");
}
}

0 comments on commit db31ddb

Please sign in to comment.