Changeset 4581 for pjproject/trunk/pjsip-apps/src/python/pjsua.py
- Timestamp:
- Aug 9, 2013 8:39:20 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/python/pjsua.py
r2976 r4581 475 475 the public address from STUN or from the selected 476 476 local interface. Format is "host:port". 477 qos_type -- High level traffic classification. 478 Enumerator: 479 0: PJ_QOS_TYPE_BEST_EFFORT 480 Best effort traffic (default value). Any QoS function calls with 481 specifying this value are effectively no-op 482 1: PJ_QOS_TYPE_BACKGROUND 483 Background traffic. 484 2: PJ_QOS_TYPE_VIDEO 485 Video traffic. 486 3: PJ_QOS_TYPE_VOICE 487 Voice traffic. 488 4: PJ_QOS_TYPE_CONTROL 489 Control traffic. 490 qos_params_flags -- Determines which values to set, bitmask of pj_qos_flag. 491 PJ_QOS_PARAM_HAS_DSCP = 1 492 PJ_QOS_PARAM_HAS_SO_PRIO = 2 493 PJ_QOS_PARAM_HAS_WMM = 4 494 qos_params_dscp_val -- The 6 bits DSCP value to set. 495 qos_params_so_prio -- Socket SO_PRIORITY value. 496 qos_params_wmm_prio -- Standard WMM priorities. 497 Enumerator: 498 0: PJ_QOS_WMM_PRIO_BULK_EFFORT: Bulk effort priority 499 1: PJ_QOS_WMM_PRIO_BULK: Bulk priority. 500 2: PJ_QOS_WMM_PRIO_VIDEO: Video priority 501 3: PJ_QOS_WMM_PRIO_VOICE: Voice priority. 477 502 """ 478 503 port = 0 479 504 bound_addr = "" 480 505 public_addr = "" 506 507 qos_type = 0 508 qos_params_flags = 0 509 qos_params_dscp_val = 0 510 qos_params_so_prio = 0 511 qos_params_wmm_prio = 0 512 513 481 514 482 515 def __init__(self, port=0, … … 486 519 self.public_addr = public_addr 487 520 521 def _cvt_from_pjsua(self, cfg): 522 self.port = cfg.port 523 self.bound_addr = cfg.bound_addr 524 self.public_addr = cfg.public_addr 525 self.qos_type = cfg.qos_type 526 self.qos_params_flags = cfg.qos_params_flags 527 self.qos_params_dscp_val = cfg.qos_params_dscp_val 528 self.qos_params_so_prio = cfg.qos_params_so_prio 529 self.qos_params_wmm_prio = cfg.qos_params_wmm_prio 530 488 531 def _cvt_to_pjsua(self): 489 532 cfg = _pjsua.transport_config_default() … … 491 534 cfg.bound_addr = self.bound_addr 492 535 cfg.public_addr = self.public_addr 536 cfg.qos_type = self.qos_type 537 cfg.qos_params_flags = self.qos_params_flags 538 cfg.qos_params_dscp_val = self.qos_params_dscp_val 539 cfg.qos_params_so_prio = self.qos_params_so_prio 540 cfg.qos_params_wmm_prio = self.qos_params_wmm_prio 541 493 542 return cfg 494 543 … … 705 754 transport such as TLS is required, 2=end-to- 706 755 end secure transport is required (i.e. "sips"). 756 rtp_transport_cfg -- the rtp-transport-configuration that is usede, when 757 a rtp-connection is being established. 707 758 """ 708 759 priority = 0 … … 724 775 use_srtp = 0 725 776 srtp_secure_signaling = 1 777 rtp_transport_cfg = None 726 778 727 779 def __init__(self, domain="", username="", password="", … … 749 801 self.build_config(domain, username, password, 750 802 display, registrar, proxy) 803 self.rtp_transport_cfg = _pjsua.transport_config_default() 751 804 752 805 def build_config(self, domain, username, password, display="", 753 registrar="", proxy="" ):806 registrar="", proxy="", rtp_transport_cfg = None): 754 807 """ 755 808 Construct account config. If domain argument is specified, … … 785 838 if username != "": 786 839 self.auth_cred.append(AuthCred("*", username, password)) 840 841 if (rtp_transport_cfg is not None): 842 self.rtp_transport_cfg = rtp_transport_cfg 843 else: 844 self.rtp_transport_cfg = _pjsua.Transport_Config() 787 845 788 846 def _cvt_from_pjsua(self, cfg): … … 808 866 self.use_srtp = cfg.use_srtp 809 867 self.srtp_secure_signaling = cfg.srtp_secure_signaling 868 if (self.rtp_transport_cfg is not None): 869 self.rtp_transport_cfg._cvt_from_pjsua(cfg.rtp_transport_cfg) 810 870 811 871 def _cvt_to_pjsua(self): … … 828 888 c.data = cred.passwd 829 889 cfg.cred_info.append(c) 890 830 891 cfg.auth_initial_send = self.auth_initial_send 831 892 cfg.auth_initial_algorithm = self.auth_initial_algorithm … … 836 897 cfg.use_srtp = self.use_srtp 837 898 cfg.srtp_secure_signaling = self.srtp_secure_signaling 899 900 cfg.rtp_transport_cfg = self.rtp_transport_cfg._cvt_to_pjsua() 901 838 902 return cfg 839 903
Note: See TracChangeset
for help on using the changeset viewer.