@@ 77-89 (lines=13) @@ | ||
74 | logger.debug("- incoming.remote_uri: %s", call.info().remote_uri) |
|
75 | logger.debug("- current.remote_uri : %s", DoorPi().sipphone.current_call.info().remote_uri) |
|
76 | ||
77 | if call.info().remote_uri == DoorPi().sipphone.current_call.info().remote_uri: |
|
78 | logger.info("Current call is incoming call - quitting current and connecting to incoming. Maybe connection reset?") |
|
79 | DoorPi().event_handler('OnCallReconnect', __name__, {'remote_uri': call.info().remote_uri}) |
|
80 | DoorPi().current_call.hangup() |
|
81 | self.answer_call(call) |
|
82 | DoorPi().event_handler('AfterCallReconnect', __name__) |
|
83 | return |
|
84 | else: |
|
85 | logger.info("Incoming and current call are different - sending busy signal to incoming call") |
|
86 | DoorPi().event_handler('OnCallBusy', __name__, {'remote_uri': call.info().remote_uri}) |
|
87 | call.answer(code = 494, reason = "Security Agreement Required") |
|
88 | DoorPi().event_handler('AfterCallBusy', __name__) |
|
89 | return |
|
90 | ||
91 | if DoorPi().sipphone.is_admin_number(call.info().remote_uri): |
|
92 | logger.debug("Incoming call from trusted admin number %s -> autoanswer", call.info().remote_uri) |
|
@@ 91-102 (lines=12) @@ | ||
88 | DoorPi().event_handler('AfterCallBusy', __name__) |
|
89 | return |
|
90 | ||
91 | if DoorPi().sipphone.is_admin_number(call.info().remote_uri): |
|
92 | logger.debug("Incoming call from trusted admin number %s -> autoanswer", call.info().remote_uri) |
|
93 | DoorPi().event_handler('OnCallIncoming', __name__, {'remote_uri': call.info().remote_uri}) |
|
94 | self.answer_call(call) |
|
95 | DoorPi().event_handler('AfterCallIncoming', __name__) |
|
96 | return |
|
97 | else: |
|
98 | logger.debug("Incoming call ist not from a trusted admin number %s -> sending busy signal", call.info().remote_uri) |
|
99 | DoorPi().event_handler('OnCallReject', __name__, {'remote_uri': call.info().remote_uri}) |
|
100 | call.answer(code = 494, reason = "Security Agreement Required") |
|
101 | DoorPi().event_handler('AfterCallReject', __name__) |
|
102 | return |