def call_requester_node(): username = pwd.getpwuid(os.getuid()).pw_name fqdn = socket.getfqdn() my_sip_address = "sip:" + username + "@" + fqdn rospy.init_node('call_requester') audio_device_id = rospy.get_param('audio_device', 'ALSA: default device') phone = Linphone( audio_dev_id = audio_device_id, termination_condition = rospy.is_shutdown ) phone.autoanswer() try: while not rospy.is_shutdown(): request_call( my_sip_address ) if phone.in_a_call(): print "Call started." rospy.sleep(.1) while phone.in_a_call() and not rospy.is_shutdown(): rospy.sleep(.1) print "Call ended." except rospy.ROSInterruptException: print "Interrupt!" except IOError as ioerr: if ioerr.errno == errno.EINTR: print "Interrupt!" else: raise