I run this bash function when a button is pressed, it calls my mobile, however when the call ends or I reject the call, it hangs in /dev/tty and does not return to the main program
#!/bin/bash printf %s\\n 'call sip:firstname.lastname@example.org' | cat - /dev/tty |twinkle -c
Here is the main program:
while(1): if lcd.buttonPressed(lcd.SELECT): os.system("./call.sh")
When phone is offline or call is rejected, it hangs and does not return back to the python program:
I would then have to press CTRL + C and CTRL + Z to exit which closes the python program too.
Is it possible to return back to the main program after a 408 Request timeout error or a 468 Busy Here message?
The answer was
mkfifo /tmp/pipe; exec 3<>/tmp/pipe; (trap '' TTIN TTOU; twinkle -c) <&3 & printf '\ncall sip:'email@example.com >&3 thanks to @mikeserv