Skip to content

Commit

Permalink
chan_echolink: Remove leadings zeros from node number (#348)
Browse files Browse the repository at this point in the history
This changes chan_echolink to remove leading zeros in the node number prior to validation in the internal database.

app_rpt requires node numbers to be 6 digits so we will receive some numbers padded with leading zeros.

This closes #347
  • Loading branch information
KB4MDD authored Jul 7, 2024
1 parent b0108d7 commit d7ffe11
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion channels/chan_echolink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ static int is_rtcp_sdes(const unsigned char *pkt, int len)
/*!
* \brief Echolink call.
* \param ast Pointer to Asterisk channel.
* \param dest Pointer to Destination (echolink node number).
* \param dest Pointer to Destination (echolink node number - format 'el0/009999').
* \param timeout Timeout.
* \retval -1 if not successful.
* \retval 0 if successful.
Expand Down Expand Up @@ -1242,6 +1242,13 @@ static int el_call(struct ast_channel *ast, const char *dest, int timeout)
} else {
cp = str;
}
/* Advance the pointer past the leading zeros */
while (*cp) {
if(*cp != '0') {
break;
}
cp++;
}

/* get the ip address for the node */
ast_mutex_lock(&el_db_lock);
Expand Down

0 comments on commit d7ffe11

Please sign in to comment.