Exemple #1
0
 def _onmncc_setup_req(self, e):
     msg = mncc_msg(msg_type=mncc.MNCC_SETUP_REQ,
                    callref=self.callref,
                    fields=mncc.MNCC_F_CALLED | mncc.MNCC_F_CALLING
                    | mncc.MNCC_F_BEARER_CAP,
                    calling=mncc_number(self.calling),
                    called=mncc_number(self.called),
                    bearer_cap=mncc_bearer_cap(self.codecs_permitted))
     self.mncc_ref.tell({'type': 'send', 'msg': msg})
Exemple #2
0
 def _onmncc_call_conf_ind(self, e):
     msg_in = e.args[0]
     codec = self.find_matching_codec(msg_in.bearer_cap.speech_ver)
     log.info('%s: CALL-CONF.ind(selected codec = %s)' % (self, codec))
     # select the according lchan_mode
     lchan_mode = codec.to_lchan_mode()
     msg = mncc_msg(msg_type=mncc.MNCC_LCHAN_MODIFY,
                    callref=msg_in.callref,
                    lchan_mode=lchan_mode)
     self.mncc_ref.tell({'type': 'send', 'msg': msg})
Exemple #3
0
 def _onmncc_setup_cnf(self, e):
     # send MNCC_SETUP_COMPL_REQ to MNCC interface, causing
     # CC-CONNECT-ACK to be sent to MS
     msg = mncc_msg(msg_type=mncc.MNCC_SETUP_COMPL_REQ,
                    callref=self.callref)
     self.mncc_ref.tell({'type': 'send', 'msg': msg})
     # ask to create the RTP socket in RTP bridge mode
     if self.rtp_bridge:
         msg = mncc_rtp_msg(msg_type=mncc.MNCC_RTP_CREATE,
                            callref=self.callref)
         self.mncc_ref.tell({'type': 'send', 'msg': msg})
     # directly transition into the ACTIVE state
     self.fsm.mncc_setup_compl_req()
Exemple #4
0
 def _do_mncc_hold_ind(self, msg_in):
     # reject any hold requests
     msg = mncc_msg(msg_type=mncc.MNCC_HOLD_REJ, callref=self.callref)
     self.mncc_ref.tell({'type': 'send', 'msg': msg})
Exemple #5
0
 def _do_mncc_stop_dtmf_ind(self, msg_in):
     msg = mncc_msg(msg_type=mncc.MNCC_STOP_DTMF_RSP,
                    callref=self.callref,
                    fields=mncc.MNCC_F_KEYPAD,
                    keypad=msg_in.keypad)
     self.mncc_ref.tell({'type': 'send', 'msg': msg})
Exemple #6
0
 def _onmncc_disc_ind(self, e):
     # send MNCC_RELEASE_REQ
     msg = mncc_msg(msg_type=mncc.MNCC_REL_REQ, callref=self.callref)
     self.mncc_ref.tell({'type': 'send', 'msg': msg})
Exemple #7
0
 def _onmncc_disc_req(self, e):
     msg = mncc_msg(msg_type=mncc.MNCC_DISC_REQ, callref=self.callref)
     self.mncc_ref.tell({'type': 'send', 'msg': msg})