Skip to content

Commit d7ffe11

Browse files
authored
chan_echolink: Remove leadings zeros from node number (#348)
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
1 parent b0108d7 commit d7ffe11

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

channels/chan_echolink.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ static int is_rtcp_sdes(const unsigned char *pkt, int len)
12031203
/*!
12041204
* \brief Echolink call.
12051205
* \param ast Pointer to Asterisk channel.
1206-
* \param dest Pointer to Destination (echolink node number).
1206+
* \param dest Pointer to Destination (echolink node number - format 'el0/009999').
12071207
* \param timeout Timeout.
12081208
* \retval -1 if not successful.
12091209
* \retval 0 if successful.
@@ -1242,6 +1242,13 @@ static int el_call(struct ast_channel *ast, const char *dest, int timeout)
12421242
} else {
12431243
cp = str;
12441244
}
1245+
/* Advance the pointer past the leading zeros */
1246+
while (*cp) {
1247+
if(*cp != '0') {
1248+
break;
1249+
}
1250+
cp++;
1251+
}
12451252

12461253
/* get the ip address for the node */
12471254
ast_mutex_lock(&el_db_lock);

0 commit comments

Comments
 (0)