mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 06:34:19 +00:00
add fsk callerid stuff to analog fxo
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@220 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
1 parent
690b929ea6
commit
fa760fe233
7 files changed
+182
-37
No files matched your search
@@ -7,7 +7,8 @@ int main(int argc, char *argv[])
|
||||
int16_t buf[160] = {0};
|
||||
ssize_t len = 0;
|
||||
int type, mlen;
|
||||
char str[128];
|
||||
char *sp;
|
||||
char str[128] = "";
|
||||
char fbuf[256];
|
||||
|
||||
if (argc < 2 || zap_fsk_demod_init(&state, 8000, fbuf, sizeof(fbuf))) {
|
||||
@@ -26,10 +27,14 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
while(zap_fsk_data_parse(&state, &type, &mlen, str, sizeof(str)) == ZAP_SUCCESS) {
|
||||
printf("TYPE %d LEN %d VAL [%s]\n", type, mlen, str);
|
||||
while(zap_fsk_data_parse(&state, &type, &sp, &mlen) == ZAP_SUCCESS) {
|
||||
zap_copy_string(str, sp, mlen+1);
|
||||
*(str+mlen) = '\0';
|
||||
zap_clean_string(str);
|
||||
printf("TYPE %d (%s) LEN %d VAL [%s]\n", type, zap_mdmf_type2str(type), mlen, str);
|
||||
}
|
||||
|
||||
zap_fsk_demod_destroy(&state);
|
||||
|
||||
close(fd);
|
||||
}
|
||||
Reference in new issue
Block a user