# HG changeset patch # User Mychaela Falconia # Date 1684712752 28800 # Node ID b3aeacc5722a4a45f3502c3e9c16836c6187d4bf # Parent fbfa72b114e8553e265e03c67dff0e818878b839 sip-manual-out: add pcm-fill command diff -r fbfa72b114e8 -r b3aeacc5722a sip-manual-out/rtp_tx.c --- a/sip-manual-out/rtp_tx.c Sun May 21 15:33:00 2023 -0800 +++ b/sip-manual-out/rtp_tx.c Sun May 21 15:45:52 2023 -0800 @@ -104,6 +104,13 @@ } void +set_pcm_fill_octet(oct) + unsigned oct; +{ + pcm_fill_octet = oct; +} + +void send_tfo_req(sig, codec) unsigned sig, codec; { diff -r fbfa72b114e8 -r b3aeacc5722a sip-manual-out/user_cmd.c --- a/sip-manual-out/user_cmd.c Sun May 21 15:33:00 2023 -0800 +++ b/sip-manual-out/user_cmd.c Sun May 21 15:45:52 2023 -0800 @@ -10,6 +10,30 @@ #include static void +pcm_fill_cmd(arg) + char *arg; +{ + char *cp; + unsigned octet; + + for (cp = arg; isspace(*cp); cp++) + ; + if (!isxdigit(*cp)) { +inv_syntax: fprintf(stderr, "error: pcm-fill command invalid syntax\n"); + return; + } + octet = strtoul(cp, &cp, 16); + if (*cp) + goto inv_syntax; + if (octet > 0xFF) { + fprintf(stderr, + "error: pcm-fill octet argument out of range\n"); + return; + } + set_pcm_fill_octet(octet); +} + +static void tfo_req_cmd(args) char *args; { @@ -67,6 +91,8 @@ send_bye_req(); else if (!strcmp(cp, "c") || !strcasecmp(cp, "cancel")) send_cancel_req(); + else if (!strncmp(cp, "pcm-fill", 8) && isspace(cp[8])) + pcm_fill_cmd(cp + 9); else if (!strncmp(cp, "tfo-req", 7) && isspace(cp[7])) tfo_req_cmd(cp + 8); else if (!strcmp(cp, "tfo-stop"))