-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add support for a info message on the echolink connect page #432
base: master
Are you sure you want to change the base?
Conversation
@@ -1820,6 +1825,23 @@ static void send_info(const void *nodep, const VISIT which, const int depth) | |||
ast_log(LOG_WARNING, "Exceeded buffer size"); | |||
return; | |||
} | |||
|
|||
if (instp->mymessage[0] != '\0') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment in English explaining what you are trying to do here (convert all the "\n" to "\n")
Also, I'm curious why you choose to modify the original buffer here, it seems like the memmove's will therefore only happen the first time? In that case why not choose to do that when the buffer is initialized to begin with? That might be a little bit more logical. Alternately, if you wanted to leave the original buffer intact, you could move the snprintf calls into the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be resolved.
channels/chan_echolink.c
Outdated
if (instp->mymessage[0] != '\0') { | ||
char *p = instp->mymessage; | ||
while ((p = strstr(p, "\\n")) != NULL) { | ||
*p = '\n'; // Replace the literal \n with a newline character |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Asterisk coding guidelines include :
* Don't use C++ type (//) comments.
and we're trying to follow those conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be resolved.
i += j; | ||
|
||
if (instp->mymessage[0] != '\0') { | ||
char *p = instp->mymessage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend moving your \n replacement to the store_config routine. This would be around line 3847 where you store the message from the config file. The replacement only needs to happen one time. (The existing code will only do that replacement once, but we will use a few cycles testing the message every time we send the info message.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a good change to make.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@firealarmss What do you think about the requested change? If OK, can you update your changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Allan-N I will make the requested change in the near future.
Adds a feature to display a set message (from the config file) on the echolink app when connected.