Commit e6c862bb authored by Jérome Perrin's avatar Jérome Perrin

slapos.cookbook:siptester: remove

parent 1e076bfa
......@@ -157,7 +157,6 @@ setup(name=name,
'signalwrapper= slapos.recipe.signal_wrapper:Recipe',
'simplelogger = slapos.recipe.simplelogger:Recipe',
'simplehttpserver = slapos.recipe.simplehttpserver:Recipe',
'siptester = slapos.recipe.siptester:SipTesterRecipe',
'slapconfiguration = slapos.recipe.slapconfiguration:Recipe',
'slapconfiguration.serialised = slapos.recipe.slapconfiguration:Serialised',
'slapconfiguration.jsondump = slapos.recipe.slapconfiguration:JsonDump',
......
import os
import pkg_resources
from slapos.recipe.librecipe import BaseSlapRecipe
class SipTesterRecipe(BaseSlapRecipe):
def __init__(self, buildout, name, options):
BaseSlapRecipe.__init__(self, buildout, name, options)
self.pjsua_configuration_file = os.path.join(self.etc_directory,
'pjsua.conf')
def _createPJSUAConfiguration(self, template_name):
pjsua_input = pkg_resources.resource_string(__name__, os.path.join(
'template', template_name))
if self._writeFile(self.pjsua_configuration_file,
pjsua_input % self.options):
# XXX: How to inform slap/slapgrid that something changed and it might
# be not bad idea to restart CP?
pass
return self.pjsua_configuration_file
def _install(self):
path = self._createPJSUAConfiguration(self.config_template)
d = {}
d.update(self.options)
d['pjsua_configuration_file'] = self.pjsua_configuration_file
# XXX Hardcoded path
d['pjsua_binary'] = os.path.join(self.buildout['software_definition'
]['software_home'].strip(), 'parts', 'pjproject-1.7', 'bin', 'pjsua')
d['siptester_binary'] = os.path.join(self.buildout['software_definition'
]['software_home'].strip(), 'bin', 'siptester')
self.running_wrapper_location = pkg_resources.resource_filename(__name__, os.path.join(
'template',
self.wrapper_template))
self._createRunningWrapper(d)
return [path, wrapper_path]
def update(self):
return self.install()
class ReceiverRecipe(SipTesterRecipe):
config_template = "pjsua_receiver.conf.in"
wrapper_template = "init_receiver.in"
class CallerRecipe(SipTesterRecipe):
config_template = "pjsua_caller.conf.in"
wrapper_template = "init_caller.in"
def _install(self):
# First of all, ask for a sipreceiver
self.request(self.software_release_url, 'sipreceiver')
return SipTesterRecipe._install(self)
#!/bin/sh
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec %(siptester_binary)s %(pjsua_binary)s %(pjsua_configuration_file)s %(caller_destination)s
#!/bin/sh
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec %(siptester_binary)s %(pjsua_binary)s %(pjsua_configuration_file)s
#
# Logging options:
#
--log-level 0
--app-log-level 0
#
# Account 0:
#
--id %(caller_id)s
--registrar %(caller_registrar)s
--realm %(caller_realm)s
--username %(caller_username)s
--password %(caller_password)s
--reg-timeout 300
#
# Network settings:
#
--local-port 5060
#
# Media settings:
#
--null-audio
--playback-lat 100
--rtp-port 4000
#
# User agent:
#
--max-calls 4
--duration 300
#
# Logging options:
#
--log-level 0
--app-log-level 0
#
# Account 0:
#
--id %(receiver_id)s
--registrar %(receiver_registrar)s
--realm %(receiver_realm)s
--username %(receiver_username)s
--password %(receiver_password)s
--reg-timeout 300
#
# Network settings:
#
--local-port 5060
#
# Media settings:
#
--null-audio
--auto-play
--play-file %(wav_path)s
--playback-lat 100
--rtp-port 4000
#
# User agent:
#
--auto-answer 200
--max-calls 4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment