> send_str "ATZ&F1M0S0=0S40=6S27=16+FCLASS=0\r"
^
I'm not sure if this is the problem, but Z is a reset. It clears
the command line; your modem likely does not see the rest and is
reset to whatever is in the first memory space in VRAM.
Get rid of that Z and it might work.