def createAsteriskConfig(self):
        needModule("res_crypto")
        needModule("chan_sip")

        self.dial = "SIP/${ARG1}@%s" % (self.name)

        # What to do with incoming calls
        self.createIncomingContext()

        c = AstConf("sip.conf")
        c.setSection("general")
        c.append("register=%s@%s/%s" % (self.name, self.host, self.name))

        if not c.hasSection(self.name):
            c.setSection(self.name)
            c.append("type=friend")
            c.append("user=%s" % self.name)
            c.append("host=%s" % self.host)
            c.append("context=in-%s" % self.name)
            c.append("canreinvite=no")
            c.append("dtmfmode=rfc2833")
            if self.nat:
                c.append("nat=yes")
            c.append("insecure=very")

        if panelutils.isConfigured() == 1 and self.panel:
            panelutils.createTrunkButton(self)
	def createAsteriskConfig(self):
		needModule("res_crypto")
		needModule("chan_sip")

		#Dial part to use on dialout macro
		self.dial = "SIP/${ARG1}@%s" % (self.host)
		if self.forward:
			self.dial += "/{$ARG1}" 
		
		#What to do with incoming calls
		self.createIncomingContext()
		
		c = AstConf("sip.conf")
		c.setSection("general")
		c.append("register=%s:%s@%s" % (self.id, self.pw, self.host))

		if not c.hasSection(self.name):
			c.setSection(self.name)
			c.append("type=friend")
			c.append("username=%s" % self.id)
			c.append("secret=%s" % self.pw)
			c.append("host=%s" % self.host)
			c.append("context=in-%s" % self.name)
			c.append("auth=md5")
			c.append("canreinvite=no")
			if self.nat:
				c.append("nat=yes")

		if panelutils.isConfigured() == 1 and self.panel:
			panelutils.createTrunkButton(self)
	def createAsteriskConfig(self):
		needModule("res_crypto")
		needModule("chan_iax2")

		#Dial part to use on dialout macro
		self.dial = "IAX2/%s/${ARG1}" % self.name
		#What to do with incoming calls
		self.createIncomingContext()
		
		c = AstConf("iax.conf")
		if not c.hasSection(self.name):
			c.setSection(self.name)
			c.append("type=friend")
			c.append("host=%s" % self.host)
			c.append("username=%s" % self.name)
			c.append("context=in-%s" % self.name)
			c.append("bandwidth=%s" % self.bandwidth)
			c.append("qualify=yes")
			if self.trunk:
				c.append("trunk=yes")
			if self.auth == "rsa" and self.inkeys and self.outkey:		
				c.append("auth=rsa")
				c.append("inkeys=%s" % self.inkeys)
				c.append("outkey=%s" % self.outkey)
			elif self.auth == "md5":
				c.append("auth=md5")
				c.append("secret= %s" % self.pw)
			elif self.auth == "plain":
				c.append("secret= %s" % self.pw)

		if panelutils.isConfigured() == 1 and self.panel:
			panelutils.createTrunkButton(self)
	def createAsteriskConfig(self):
		needModule("res_crypto")
		needModule("chan_sip")

		#Dial part to use on dialout macro
		#If we use the host it will not use authentication
		#it's safe to use the peer name 
		self.dial = "SIP/${ARG1}@%s" % (self.name)
		
		#What to do with incoming calls
		self.createIncomingContext()
		
		c = AstConf("sip.conf")
		if not c.hasSection(self.name):
			c.setSection(self.name)
			c.append("type=friend")
			c.append("username=%s" % self.name)
			c.append("regexten=%s" % self.name)
			c.append("fromuser=%s" % self.name)
			c.append("secret=%s" % self.pw)
			c.append("host=dynamic")
			c.append("insecure=very")
			c.append("context=in-%s" % self.name)
			c.append("canreinvite=no")
			c.append("dtmfmode=inband")
			c.append("call-limit=1")
			if self.nat:
				c.append("nat=yes")
			c.append("qualify=yes")
			c.append("disallow=all")
			c.append("allow=ulaw")
			c.append("allow=alaw")

		if panelutils.isConfigured() == 1 and self.panel:
			panelutils.createTrunkButton(self)
	def createAsteriskConfig(self):
		needModule("app_meetme")

		c = AstConf("extensions.conf")
		c.setSection("apps")
		c.appendExten(self.ext, "Answer")
		c.appendExten(self.ext, "Wait(1)")
		# 'd' -- dynamically add conference
		# 'p' -- allow user to exit the conference by pressing '#'
		if not self.confno:
			self.confno = self.ext
		c.appendExten(self.ext, "MeetMe(%s,dp)" % self.confno)

		c = AstConf("meetme.conf")
		c.setSection("rooms")
		if self.pin:
			c.append("conf=%s,%s" % (self.confno, self.pin))
		else:
			c.append("conf=%s" % self.confno)
		
		try:
			if panelutils.isConfigured() == 1 and self.panel:
				panelutils.createMeetmeButton(self)
		except AttributeError:
			pass
	def createAsteriskConfig(self):
		needModule("chan_zap")
		needModule("app_meetme")

		c = AstConf("extensions.conf")
		c.setSection(self.pbx)
		c.appendExten(self.ext, "Answer", self.pbx)
		c.appendExten(self.ext, "Set(TIMEOUT(absolute)=%d)" % self.timeout, self.pbx)
		# 'd' -- dynamically add conference
		# 'P' -- always prompt pin
		args=""
		if self.confno:
			args += "%d" % self.confno
		args += "|d"
		if self.pin:
			args += "P|%d" % self.pin
		c.appendExten(self.ext, "MeetMe(%s)" % args, self.pbx)

		if self.confno:
			c = AstConf("meetme.conf")
			c.setSection("rooms")
			room = str(self.confno)
			if self.pin:
				room += ",%d" % self.pin
			c.append("conf=%s" % room)
		try:
			if panelutils.isConfigured() == 1 and self.panel:
				panelutils.createMeetmeButton(self)
		except AttributeError:
			pass
	def createAsteriskConfig(self):
		needModule("chan_zap")

		c = AstConf("zaptel.conf")
		c.setSection("")
		c.destar_comment = False
		c.append("fxs%s=%s" % (self.signalling[4:], self.channels))
		c.append("")

		# Create config for chan_zap:
		c = AstConf("zapata.conf")
		c.append("")
		c.append("; Zaptel Trunk %s" % self.name)
		c.append("context=in-%s" % self.name)
		c.append("callerid=asreceived")
		c.appendValue(self, "signalling")
		c.appendValue(self, "rxgain")
		c.appendValue(self, "txgain")
		if self.group:
			c.appendValue(self, "group")
		c.append("channel=%s" % self.channels)
		c.append("")

		#Dial part to use on dialout macro
		if self.group:
			self.dial = "Zap/g%d/%sww${ARG1}" % (self.group, self.prefix)
		else:
			self.dial = "Zap/%s/%sww${ARG1}" % (self.channels, self.prefix)
		
		#What to do with incoming calls
		self.createIncomingContext()

		if panelutils.isConfigured() == 1 and self.panel:
			panelutils.createTrunkButton(self)
Esempio n. 8
0
	def fixup(self):
		Cfg.fixup(self)
		useContext("phones")

		if panelutils.isConfigured() == 1:
			for v in self.variables:
				if v.name == "panelLab" or v.name == "panel":
					v.hide = False

		global config_entries
		dialouts=False
		for obj in config_entries:
			if obj.groupName == 'Dialout':
				dialouts=True
				alreadyappended = False
				for v in self.variables:	
					if v.name == "dialout_"+obj.name:
						alreadyappended = True
				if not alreadyappended:
					self.variables.append(VarType("dialout_%s" % obj.name, title=_("%s") % obj.name, type="bool", optional=True,render_br=False))
					self.variables.append(VarType("dialout_%s_secret" % obj.name, title=_("Password:"******"Dialout" or v.name=="timeout":
					v.hide = False
	
		queues=False
		for obj in config_entries:
			if obj.__class__.__name__ == 'CfgPhoneQueue':
				queues=True
		if queues:
			for v in self.variables:
				if v.name == "QueueLab" or v.name == "queues":
					v.hide = False
	def createAsteriskConfig(self):
		needModule("chan_zap")

		c = AstConf("zaptel.conf")
		c.setSection("")
		c.destar_comment = False
		c.append("# %s" % self.name)
		c.append("dynamic=eth,%s/%s,%d,%d" % (self.localdriver, self.address, self.numchannels, self.timing))
		c.append("bchan=%s" % self.channels)
		if self.coding:
			c.append("%s => %s" % (self.coding,self.channels))
		c.append("dchan=%s" % self.dchannel)
		c.append("")

		# Create config for chan_zap:
		c = AstConf("zapata.conf")
		c.append("")
		c.append("; Zaptel Trunk %s" % self.name)
		c.appendValue(self, "signalling")
		c.append("context=in-%s" % self.name)
		c.append("usecallerid=yes")
		c.append("callerid=asreceived")
		c.append("hidecallerid=no")
		c.append("callwaiting=no")
		c.append("usecallingpres=yes")
		c.append("callwaitingcallerid=no")
		c.append("threewaycalling=yes")
		c.append("transfer=yes")
		c.append("cancallforward=yes")
		c.append("callreturn=no")
		c.append("echocancel=yes")
		c.append("echocancelwhenbridged=yes")
		c.append("echotraining=yes")
		c.append("relaxdtmf=yes")
		c.append("immediate=no")
		c.append("busydetect=no")
		if self.pridialplan:
			c.appendValue(self, "pridialplan")
		if self.group:
			c.appendValue(self, "group")
		if self.switchtype:
			c.appendValue(self, "switchtype")
		if self.coding:
			c.append("%s => %s" % (self.coding,self.channels))
		c.append("channel=%s" % self.channels)
		c.append("")

		#Dial part to use on dialout macro
		self.dial = ""
		if self.group:
			self.dial = "Zap/g%d/${ARG1}" % (self.group)
		else:
			self.dial = "Zap/%s/${ARG1}" % (self.channels)
		
		#What to do with incoming calls
		self.createIncomingContext()

		if panelutils.isConfigured() == 1 and self.panel:
			panelutils.createTrunkButton(self)
	def fixup(self):
		Cfg.fixup(self)
		useContext("phones")

		if panelutils.isConfigured() == 1:
			for v in self.variables:
				if v.name == "panelLab" or v.name == "panel":
					v.hide = False
Esempio n. 11
0
 def createPanelConfig(self):
     try:
         if panelutils.isConfigured() == 1 and self.panel:
             if self.technology == "AGENT":
                 panelutils.createAgentButton(self)
             else:
                 panelutils.createExtButton(self)
     except AttributeError:
         pass
    def createAsteriskConfig(self):
        needModule("chan_dahdi")

        # Create config for chan_dahdi:
        c = AstConf("chan_dahdi.conf")
        c.append("")
        c.append("; DAHDItel Trunk %s" % self.name)
        if self.group:
            c.appendValue(self, "group")
        c.appendValue(self, "signalling")
        c.appendValue(self, "switchtype")
        c.append("resetinterval=never")
        c.append("prilocaldialplan=local")
        c.appendValue(self, "pridialplan")
        contextin = "in-%s" % self.name
        c.append("context=%s" % contextin)
        c.append("usecallerid=yes")
        c.append("callerid=asreceived")
        c.append("hidecallerid=no")
        c.append("callwaiting=no")
        c.append("usecallingpres=yes")
        c.append("callwaitingcallerid=no")
        c.append("threewaycalling=yes")
        c.append("transfer=yes")
        c.append("cancallforward=yes")
        c.append("callreturn=no")
        c.append("echocancel=yes")
        c.append("echocancelwhenbridged=yes")
        c.append("echotraining=yes")
        c.append("relaxdtmf=yes")
        c.append("immediate=no")
        c.append("busydetect=no")
        c.appendValue(self, "rxgain")
        c.appendValue(self, "txgain")
        c.append("channel=%s" % self.channels)
        c.append("")

        # Dial part to use on dialout macro
        if self.group:
            self.dial = "DAHDI/%s%s/${ARG1}" % (self.dialmethod, self.group)
        else:
            self.dial = "DAHDI/%s/${ARG1}" % (self.channels)

            # What to do with incoming calls
        self.createIncomingContext()

        if panelutils.isConfigured() == 1 and self.panel:
            p = AstConf("op_buttons.cfg")
            chgrp = self.channels.split(",")
            for gr in chgrp:
                gr_start_end = gr.split("-")
                for ch in range(int(gr_start_end[0]), int(gr_start_end[1]) + 1):
                    p.setSection("%s/%d" % (self.technology, ch))
                    p.append("Position=n")
                    p.append("Icon=2")
                    p.append("Extension=-1")
                    p.append("Label=%s-%d" % (self.name, ch))
Esempio n. 13
0
	def createAsteriskConfig(self):
		needModule("res_crypto")
		needModule("chan_sip")

		#Dial part to use on dialout macro
		#If we use the host it will not use authentication
		#it's safe to use the peer name 
		if self.register:
			self.dial = "SIP/${ARG1}@%s" % (self.name)
		else:
			self.dial = "SIP/${ARG1}@%s" % (self.host)
			if self.forward:
				self.dial += "/${ARG1}" 
		
		#What to do with incoming calls
		self.createIncomingContext()
		
		c = AstConf("sip.conf")
		c.setSection("general")
		if self.register:
			if not self.port:
				registerstr = "register => %s:%s@%s" % (self.id, self.pw, self.host)
			else:
				registerstr = "register => %s:%s@%s:%s" % (self.id, self.pw, self.host, self.port)
			if self.forward: 
				registerstr += "/%s" % self.id
			c.append(registerstr)

		if not c.hasSection(self.name):
			c.setSection(self.name)
			c.append("type=friend")
			c.append("username=%s" % self.id)
			c.append("fromuser=%s" % self.id)
			c.append("secret=%s" % self.pw)
			c.append("host=%s" % self.host)
			if self.port:
				c.append("port=%s" % self.port)
			if self.dtmfmode:
				c.append("dtmfmode=%s" % self.dtmfmode)
			c.append("context=in-%s" % self.name)
			if self.fromdomain:
				c.append("fromdomain=%s" % self.fromdomain)
			if self.nat:
				c.append("nat=yes")
			if self.insecure:
				c.append("insecure=port,invite")
			if self.t38enable:
				c.append("t38pt_udptl=yes")
				c.append("canreinvite=yes")
			else:
				c.append("canreinvite=no")

		if panelutils.isConfigured() == 1 and self.panel:
			panelutils.createTrunkButton(self)
	def createAsteriskConfig(self):
		needModule("chan_zap")

		c = AstConf("zaptel.conf")
		c.setSection("")
		c.destar_comment = False
		for n in range(self.cards):
			c.append("span=%d,1,3,ccs,ami" % (self.channels + n))
		for n in range(self.cards):
			c.append("bchan=%d-%d" % (self.channels + n * 3, self.channels + n * 3 + 1))
			c.append("dchan=%d" % (self.channels + n * 3 + 2))
		c.append("alaw=%d-%d" % (self.channels + n * 3, self.channels + n * 3 + 2))
		c.append("")

		# Create config for chan_zap:
		c = AstConf("zapata.conf")
		c.append("")
		c.append("nationalprefix = 0")
		c.append("internationalprefix = 00")
		c.append("pridialplan = dynamic")
		c.append("prilocaldialplan = local")
		c.append("echocancel=no")
		c.append("echotraining = 300")
		c.append("echocancelwhenbridged=no")
		
		c.append("switchtype=euroisdn")
		c.append("signalling=%s" % self.signalling)

		c.append("; ISDN Trunk %s" % self.name)
		c.append("context=in-%s" % self.name)
		if self.group:
			c.appendValue(self, "group")

		chanstr = ""
		for n in range(self.cards):
		    if chanstr:
			chanstr = chanstr + ","
		    chanstr = chanstr + "%d-%d" % (self.channels + n * 3 , self.channels + 1 + n * 3 )
		c.append("channel=%s" % chanstr)
		c.append("")

		#Dial part to use on dialout macro
		if self.group:
			self.dial = "Zap/g%d/${ARG1}" % (self.group)
		
		#What to do with incoming calls
		self.createIncomingContext()

		if panelutils.isConfigured() == 1 and self.panel:
			panelutils.createTrunkButton(self)
	def createAsteriskConfig(self):
		needModule("chan_zap")
		needModule("app_meetme")

		c = AstConf("extensions.conf")
		c.setSection(self.pbx)

		mon_line=""
		if self.record:
			needModule("app_mixmonitor")
			options = ""
			if self.recordappend:
				options = 'a' 
			if self.heardvol == self.spokenvol:
				options = options+'W(%s)' % (self.heardvol)
			else:          
				options = options+'v(%s)V(%s)' % (self.heardvol, self.spokenvol)        
			if self.recordfilename:
				mon_line = "MixMonitor(%s.%s|%s)" % (self.recordfilename,self.recordfileformat,options)
			else:
				mon_line = "MixMonitor(${TIMESTAMP}-${CALLERIDNAME}(${CALLERIDNUM})-${EXTEN}.%s|%s)" % (self.recordfileformat,options)

		c.appendExten(self.ext, "Answer")
		if mon_line:
			c.appendExten(self.ext, mon_line)
		c.appendExten(self.ext, "Set(TIMEOUT(absolute)=%d)" % self.timeout)
		# 'd' -- dynamically add conference
		# 'P' -- always prompt pin
		args=""
		if self.confno:
			args += "%d" % self.confno
		args += "|d"
		if self.pin:
			args += "P|%d" % self.pin
		c.appendExten(self.ext, "MeetMe(%s)" % args)

		if self.confno:
			c = AstConf("meetme.conf")
			c.setSection("rooms")
			room = str(self.confno)
			if self.pin:
				room += ",%d" % self.pin
			c.append("conf=%s" % room)
		try:
			if panelutils.isConfigured() == 1 and self.panel:
				panelutils.createMeetmeButton(self)
		except AttributeError:
			pass
	def createAsteriskConfig(self):
		needModule("chan_zap")

		# Create config for chan_zap:
		c = AstConf("zapata.conf")
		c.append("")
		c.append("; Zaptel Trunk %s" % self.name)
		if self.group:
			c.appendValue(self, "group")
		contextin = "in-%s" % self.name
		c.append("context=%s" % contextin)
		c.append("callerid=asreceived")
		c.append("usecallerid=yes")
		c.append("hidecallerid=no")
		c.append("callwaiting=no")
		c.append("usecallingpres=yes")
		c.append("callwaitingcallerid=no")
		c.append("threewaycalling=yes")
		c.append("transfer=yes")
		c.append("cancallforward=yes")
		c.append("callreturn=no")
		c.append("echocancel=yes")
		c.append("echocancelwhenbridged=yes")
		c.append("echotraining=yes")
		c.append("relaxdtmf=yes")
		c.append("immediate=no")
		c.append("busydetect=no")
		c.appendValue(self, "signalling")
		c.appendValue(self, "switchtype")
		c.appendValue(self, "rxgain")
		c.appendValue(self, "txgain")
		c.append("channel=%s" % self.channels)
		c.append("")

		#Dial part to use on dialout macro
		if self.group:
			self.dial = "Zap/g%s/${ARG1}" % (self.group)
		else:
			self.dial = "Zap/%s/${ARG1}" % (self.channels)
		
		#What to do with incoming calls
		self.createIncomingContext()

		if panelutils.isConfigured() == 1 and self.panel:
			panelutils.createTrunkButton(self)
	def createAsteriskConfig(self):
		needModule("res_monitor")
		needModule("app_queue")

		c = AstConf("queues.conf")
		c.setSection(self.name)
		if self.moh:
			c.append("musiconhold=%s" % self.moh)
		c.appendValue(self, "strategy")
		if self.retry:
			c.appendValue(self, "retry")
		if self.timeout:
			c.appendValue(self, "timeout")
		if self.announce:
			c.append("announce-frequency=%s" % self.announcefrequency)
			c.append("announce-holdtime=%s" % self.announceholdtime)
		if self.monitor:
			c.append("monitor-format=%s" % self.monitorfileformat)
			if not self.monitorjoin:
				c.append("monitor-join=yes")
		
		extensions = AstConf("extensions.conf")
		extensions.setSection("phones")
		if self.ext:
			if self.monitor and self.monitorfilename:
				extensions.appendExten(self.ext, "SetVar(MONITOR_FILENAME=%s)" % self.monitorfilename)
			extensions.appendExten(self.ext, "SetMusicOnHold(%s)" % self.moh)
			extensions.appendExten(self.ext, "Queue(%s|Tth)" % self.name)
		if self.monitor and self.monitorfilename:
			extensions.appendExten(self.name, "SetVar(MONITOR_FILENAME=%s)" % self.monitorfilename)
		extensions.appendExten(self.name, "SetMusicOnHold(%s)" % self.moh)
		extensions.appendExten(self.name, "Queue(%s|Tth)" % self.name)
		
		try:
			if panelutils.isConfigured() == 1 and self.panel:
				panelutils.createQueueButton(self)
		except AttributeError:
			pass
Esempio n. 18
0
	def createAsteriskConfig(self):
		needModule("chan_dahdi")

		c = AstConf("system.conf")
		c.setSection("")
		c.destar_comment = False
		c.append("fxs%s=%s" % (self.signalling[4:], self.channels))
		c.append("")

		# Create config for chan_dahdi:
		c = AstConf("chan_dahdi.conf")
		c.append("")
		c.append("; DAHDItel Trunk %s" % self.name)
		c.append("context=in-%s" % self.name)
		c.append("callerid=asreceived")
                c.append("busydetect=yes")
                c.append("busycount=8")
		c.appendValue(self, "signalling")
		c.appendValue(self, "rxgain")
		c.appendValue(self, "txgain")
		if self.group:
			c.appendValue(self, "group")
		c.append("channel=%s" % self.channels)
		c.append("")

		#Dial part to use on dialout macro
		if self.group:
			self.dial = "DAHDI/g%d/${ARG1}" % (self.group)
		else:
			self.dial = "DAHDI/%s/${ARG1}" % (self.channels)
		
		#What to do with incoming calls
		self.createIncomingContext()

		if panelutils.isConfigured() == 1 and self.panel:
			panelutils.createTrunkButton(self)
Esempio n. 19
0
 def lookPanel(self):
     if panelutils.isConfigured() == 1:
         for v in self.variables:
             if v.name == "panelLab" or v.name == "panel":
                 v.hide = False
Esempio n. 20
0
	def createPanelConfig(self):
		try:
			if panelutils.isConfigured() == 1 and self.panel:
				panelutils.createExtButton(self)
		except AttributeError:
			pass