wdoekes / asterisk-chan-dongle

chan_dongle channel driver for Huawei UMTS cards, works with Asterisk 14+
Other
298 stars 104 forks source link

Sending newline in SMS via AMI #92

Closed miopa closed 4 years ago

miopa commented 4 years ago

AMI is a telnet based protocol in which literal newline can't be passed. One possible solution is encoding the newline with '\n' or '\r' sequence in the SMS text

miopa commented 4 years ago

Is updating the message string in place a better way?

wdoekes commented 4 years ago

Is updating the message string in place a better way?

Neither better nor worse. It might provide better cpu cache locality? But that's a really totally irrelevant optimization here.

Using what already exists is what matters here :)

wdoekes commented 4 years ago

AMI is a telnet based protocol

Oh, and don't call it telnet-based. It's a text-based protocol. The fact that some people use the telnet(1) application when they want netcat(1) creates this confusion. Don't spread it.

miopa commented 4 years ago

Also, please squash your commits to a single one and update the commit msg.

I'll send a new PR if code is good, that seems easier right now

wdoekes commented 4 years ago

astman_send_error ( <- one space too many.

Other than that, LGTM!

miopa commented 4 years ago

Merged in https://github.com/wdoekes/asterisk-chan-dongle/pull/101