Search code examples
protocolsat-commandmodemserial-communication

AT Modem - Audio Data Transmission - Escape DLE?


I am writing an application that communicates with an AT modem (in this case with a conexant cx93010 chipset, see manual here: https://www.manualslib.com/manual/1140976/Conexant-Cx93010.html). My application collects callerid information and uses various ways to get information based on that (blacklist-website queries, information on extension, local whitelists and blacklists etc.)

I would like to take this a few steps further and transmit and receive voice data for numerous reasons, i.e. answering machine, detecting when someone with a suppressed number calls and then play a predefined message and hang up.

I have already set up an interface to talk to the modem and get the callerid data that I want, and hang up calls based off of that.

My question is the following:

As my application receives audio data, doesn't said audio(!) bytestream randomly(!) include DLE messages as part of the audio data?

I have checked the manual and other resources, and nothing tells me if that is the case, and if so, how this is being handled?

-Are those random occurrences being escaped? If so, how?

-Or is it that audio data is send in chunks of a fixed size (based on codec?), and in between those chunks, intentional DLE messages may appear, so that way I can ignore DLE character occurrences for x amount of bytes?

Various code samples found on the net (basically all I could find) just ignore this. I am wondering if they are accurate implementations or just quick and dirty examples to show basic function and these corner cases have been forgotten over time.

Thank you in advance!


Solution

  • To close this up and especially because (at least to me) this already shows up in google searches up top, I would like to share the answer I have come up with myself.

    So, random DLE-bytes that are part of the data stream ("data" meaning "payload", and not the raw data) are (according to the manual) escaped by appending another DLE-byte to them. So occurrences of two DLE bytes together means you need to remove one of them and that singular DLE is part of the data. If you encounter a singular DLE in the raw stream it means that the next character is definitely an event code sent by the modem (DCE) to you (DTE), except for:

    The combination of DLE + SUB is used to escape two consecutively transmitted DLE bytes. This is done in order to not blow up the amount of raw data to be transmitted.

    That means that various examples simply receiving and interpreting raw data as audio data and/or send audio data without escaping are just inaccurate oversimplifications.

    Thank you to anyone who read my original question.