<?xml version="1.0" encoding="UTF-8"?> | |||||
<!-- You may freely edit this file. See commented blocks below for --> | |||||
<!-- some examples of how to customize the build. --> | |||||
<!-- (If you delete it and reopen the project it will be recreated.) --> | |||||
<!-- By default, only the Clean and Build commands use this build script. --> | |||||
<!-- Commands such as Run, Debug, and Test only use this build script if --> | |||||
<!-- the Compile on Save feature is turned off for the project. --> | |||||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> | |||||
<!-- in the project's Project Properties dialog box.--> | |||||
<project name="Phone" default="default" basedir="."> | |||||
<description>Builds, tests, and runs the project Phone.</description> | |||||
<import file="nbproject/build-impl.xml"/> | |||||
<!-- | |||||
There exist several targets which are by default empty and which can be | |||||
used for execution of your tasks. These targets are usually executed | |||||
before and after some main targets. They are: | |||||
-pre-init: called before initialization of project properties | |||||
-post-init: called after initialization of project properties | |||||
-pre-compile: called before javac compilation | |||||
-post-compile: called after javac compilation | |||||
-pre-compile-single: called before javac compilation of single file | |||||
-post-compile-single: called after javac compilation of single file | |||||
-pre-compile-test: called before javac compilation of JUnit tests | |||||
-post-compile-test: called after javac compilation of JUnit tests | |||||
-pre-compile-test-single: called before javac compilation of single JUnit test | |||||
-post-compile-test-single: called after javac compilation of single JUunit test | |||||
-pre-jar: called before JAR building | |||||
-post-jar: called after JAR building | |||||
-post-clean: called after cleaning build products | |||||
(Targets beginning with '-' are not intended to be called on their own.) | |||||
Example of inserting an obfuscator after compilation could look like this: | |||||
<target name="-post-compile"> | |||||
<obfuscate> | |||||
<fileset dir="${build.classes.dir}"/> | |||||
</obfuscate> | |||||
</target> | |||||
For list of available properties check the imported | |||||
nbproject/build-impl.xml file. | |||||
Another way to customize the build is by overriding existing main targets. | |||||
The targets of interest are: | |||||
-init-macrodef-javac: defines macro for javac compilation | |||||
-init-macrodef-junit: defines macro for junit execution | |||||
-init-macrodef-debug: defines macro for class debugging | |||||
-init-macrodef-java: defines macro for class execution | |||||
-do-jar: JAR building | |||||
run: execution of project | |||||
-javadoc-build: Javadoc generation | |||||
test-report: JUnit report generation | |||||
An example of overriding the target for project execution could look like this: | |||||
<target name="run" depends="Phone-impl.jar"> | |||||
<exec dir="bin" executable="launcher.exe"> | |||||
<arg file="${dist.jar}"/> | |||||
</exec> | |||||
</target> | |||||
Notice that the overridden target depends on the jar target and not only on | |||||
the compile target as the regular run target does. Again, for a list of available | |||||
properties which you can use, check the target you are overriding in the | |||||
nbproject/build-impl.xml file. | |||||
--> | |||||
<!-- Change the value to the name of the final jar without .jar --> | |||||
<target name="-post-jar"> | |||||
<property name="store.jar.name" value="Phone"/> | |||||
<property name="store.dir" value="dist"/> | |||||
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/> | |||||
<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/> | |||||
<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip"> | |||||
<zipgroupfileset dir="dist" includes="*.jar"/> | |||||
<zipgroupfileset dir="lib" includes="*.jar"/> | |||||
<manifest> | |||||
<attribute name="Main-Class" value="${main.class}"/> | |||||
</manifest> | |||||
</jar> | |||||
<zip destfile="${store.jar}"> | |||||
<zipfileset src="${store.dir}/temp_final.jar" | |||||
excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/> | |||||
</zip> | |||||
<delete file="${store.dir}/temp_final.jar"/> | |||||
</target> | |||||
</project> |
Manifest-Version: 1.0 | |||||
X-COMMENT: Main-Class will be added automatically by build | |||||
build.xml.data.CRC32=f69c57db | |||||
build.xml.script.CRC32=53e451ff | |||||
build.xml.stylesheet.CRC32=f85dc8f2@1.90.1.48 | |||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. | |||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. | |||||
nbproject/build-impl.xml.data.CRC32=f69c57db | |||||
nbproject/build-impl.xml.script.CRC32=2b6978ab | |||||
nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.90.1.48 |
#Tue Jun 11 17:15:12 CEST 2019 | |||||
excludes= | |||||
javac.test.classpath=\ | |||||
${javac.classpath}:\ | |||||
${build.classes.dir}:\ | |||||
${libs.junit_4.classpath}:\ | |||||
${libs.hamcrest.classpath} | |||||
run.classpath=${javac.classpath}\:${build.classes.dir} | |||||
javac.processorpath=${javac.classpath} | |||||
dist.javadoc.dir=${dist.dir}/javadoc | |||||
test.src.dir=test | |||||
file.reference.junit-4.12.jar=lib\\junit-4.12.jar | |||||
run.modulepath=${javac.modulepath} | |||||
annotation.processing.enabled=true | |||||
file.reference.jain-sip-ri-1.2.327.jar=lib\\jain-sip-ri-1.2.327.jar | |||||
build.sysclasspath=ignore | |||||
debug.modulepath=${run.modulepath} | |||||
javac.compilerargs= | |||||
javadoc.noindex=false | |||||
javadoc.private=false | |||||
file.reference.log4j-1.2.17.jar=lib\\log4j-1.2.17.jar | |||||
javadoc.author=false | |||||
endorsed.classpath= | |||||
main.class=phone.Start | |||||
junit.selected.version=4 | |||||
source.encoding=UTF-8 | |||||
javac.source=11 | |||||
includes=** | |||||
javadoc.use=true | |||||
jar.compress=false | |||||
javadoc.nonavbar=false | |||||
annotation.processing.enabled.in.editor=false | |||||
javadoc.notree=false | |||||
annotation.processing.processors.list= | |||||
javac.deprecation=false | |||||
application.vendor=Normal | |||||
jlink.launcher=true | |||||
javadoc.additionalparam= | |||||
jlink.launcher.name=Phone | |||||
build.generated.sources.dir=${build.dir}/generated-sources | |||||
javadoc.splitindex=true | |||||
javac.processormodulepath= | |||||
run.jvmargs= | |||||
jlink.additionalmodules= | |||||
javadoc.encoding=${source.encoding} | |||||
javac.classpath=${file.reference.jain-sip-api-1.2.1.4.jar}\:${file.reference.jain-sip-ri-1.2.327.jar}\:${file.reference.junit-4.12.jar}\:${file.reference.log4j-1.2.17.jar} | |||||
mkdist.disabled=false | |||||
run.test.modulepath=${javac.test.modulepath} | |||||
build.classes.excludes=**/*.java,**/*.form | |||||
dist.jlink.dir=${dist.dir}/jlink | |||||
dist.jar=${dist.dir}/Phone.jar | |||||
build.classes.dir=${build.dir}/classes | |||||
debug.test.modulepath=${run.test.modulepath} | |||||
build.test.classes.dir=${build.dir}/test/classes | |||||
file.reference.jain-sip-api-1.2.1.4.jar=lib\\jain-sip-api-1.2.1.4.jar | |||||
javadoc.windowtitle= | |||||
build.test.results.dir=${build.dir}/test/results | |||||
dist.dir=dist | |||||
build.dir=build | |||||
dist.archive.excludes= | |||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output | |||||
build.generated.dir=${build.dir}/generated | |||||
javadoc.version=false | |||||
application.title=Phone | |||||
javac.test.modulepath=${javac.modulepath} | |||||
debug.test.classpath=${run.test.classpath} | |||||
javac.external.vm=true | |||||
javac.target=11 | |||||
platform.active=default_platform | |||||
manifest.file=manifest.mf | |||||
javadoc.html5=false | |||||
javac.test.processorpath=${javac.test.classpath} | |||||
meta.inf.dir=${src.dir}/META-INF | |||||
run.test.classpath=${javac.test.classpath}\:${build.test.classes.dir} | |||||
dist.jlink.output=${dist.jlink.dir}/Phone | |||||
annotation.processing.run.all.processors=true | |||||
javac.modulepath= | |||||
src.dir=src | |||||
jlink.additionalparam= | |||||
debug.classpath=${run.classpath} |
<?xml version="1.0" encoding="UTF-8"?> | |||||
<project xmlns="http://www.netbeans.org/ns/project/1"> | |||||
<type>org.netbeans.modules.java.j2seproject</type> | |||||
<configuration> | |||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3"> | |||||
<name>Phone</name> | |||||
<source-roots> | |||||
<root id="src.dir"/> | |||||
</source-roots> | |||||
<test-roots> | |||||
<root id="test.src.dir"/> | |||||
</test-roots> | |||||
</data> | |||||
</configuration> | |||||
</project> |
import logger.OhmLogger; | import logger.OhmLogger; | ||||
/** | /** | ||||
* | |||||
* Erstellt den Trying Header, wird als erstes gesendet sobald man einen Anruf bekommt | |||||
* @author Jan | * @author Jan | ||||
*/ | */ | ||||
public class SIP100Trying | public class SIP100Trying | ||||
AllowHeader allow = headerFactory.createAllowHeader("NOTIFY,INVITE,ACK,CANCEL,BYE,REFER,INFO,OPTIONS,MESSAGE"); | AllowHeader allow = headerFactory.createAllowHeader("NOTIFY,INVITE,ACK,CANCEL,BYE,REFER,INFO,OPTIONS,MESSAGE"); | ||||
tryResponse.addHeader(supp); | tryResponse.addHeader(supp); | ||||
tryResponse.addHeader(allow); | tryResponse.addHeader(allow); | ||||
lgTry.info("100-Trying Header erstellt"); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { |
import javax.sip.message.Response; | import javax.sip.message.Response; | ||||
import logger.OhmLogger; | import logger.OhmLogger; | ||||
/** | /** | ||||
* | |||||
* Erstellt den Ringing Header, wird als zweites gesendet sobald man einen Anruf bekommt | |||||
* Wiederholen bis User das Telefon abnimmt oder nichtmehr angerufen wird | |||||
* | |||||
* @author Jan | * @author Jan | ||||
*/ | */ | ||||
public class SIP180Ringing implements Runnable | public class SIP180Ringing implements Runnable | ||||
{ | { | ||||
private RequestEvent requestEvent; | private RequestEvent requestEvent; | ||||
private ExecutorService threadring; | |||||
private ExecutorService threadring; //für wiederholtes senden des Ringing Headers | |||||
private boolean callIncoming; | private boolean callIncoming; | ||||
private Response responseRing; | private Response responseRing; | ||||
private MessageFactory messageFactory; | private MessageFactory messageFactory; | ||||
responseRing.addHeader(headerFactory.createSupportedHeader("replace,path,timer")); | responseRing.addHeader(headerFactory.createSupportedHeader("replace,path,timer")); | ||||
responseRing.addHeader(this.headerFactory.createAllowHeader("NOTIFY,INVITE,ACK,CANCEL,BYE,REFER,INFO,OPTIONS,MESSAGE")); | responseRing.addHeader(this.headerFactory.createAllowHeader("NOTIFY,INVITE,ACK,CANCEL,BYE,REFER,INFO,OPTIONS,MESSAGE")); | ||||
responseRing.addHeader(this.headerFactory.createAllowEventsHeader("talk,hold,refer")); //für was wird er gebraucht | responseRing.addHeader(this.headerFactory.createAllowEventsHeader("talk,hold,refer")); //für was wird er gebraucht | ||||
lgRing.info("Ringing Header erfolgreich erstellt"); | |||||
lgRing.info("180-Ringing Header erstellt"); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
{ | { | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* @return the responseRing | * @return the responseRing | ||||
*/ | */ |
response.addHeader((CallIdHeader) this.requestEvent.getRequest().getHeader("Call-ID")); | response.addHeader((CallIdHeader) this.requestEvent.getRequest().getHeader("Call-ID")); | ||||
response.addHeader(allow); | response.addHeader(allow); | ||||
response.addHeader(allowevents); | response.addHeader(allowevents); | ||||
lg200Ok.info("200Ok Header erfolgreich erstellt"); | |||||
lg200Ok.info("200-OK Header erstellt"); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { |
ContentTypeHeader content = headerFactory.createContentTypeHeader("application", "sdp"); | ContentTypeHeader content = headerFactory.createContentTypeHeader("application", "sdp"); | ||||
inviterequest.addHeader(content); | inviterequest.addHeader(content); | ||||
inviterequest.setContent(sessionDescription, content); | inviterequest.setContent(sessionDescription, content); | ||||
System.out.println(inviterequest); | |||||
lgInvite.info("Invitation Header erstellt"); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { |
request.addHeader(contactHeader); | request.addHeader(contactHeader); | ||||
request.addHeader(allow); | request.addHeader(allow); | ||||
request.addHeader(expire); | request.addHeader(expire); | ||||
lgRegister.info("Erfolgreiche Register-Header erstellt"); | |||||
lgRegister.info("Register Header erstellt"); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { |
} | } | ||||
} | } | ||||
sessionDescription.setAttributes(mediavec); | sessionDescription.setAttributes(mediavec); | ||||
lgSessionDescription.info("SDP Header erstellt"); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { |