mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-08 05:11:51 +00:00
Merge branch 'master' into arnaldo.ftdm_channel_read_event
Conflicts: libs/freetdm/src/ftdm_io.c libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c
This commit is contained in:
@@ -70,10 +70,12 @@ config.status
|
||||
configure.lineno
|
||||
/freeswitch
|
||||
/fs_cli
|
||||
/fs_encode
|
||||
/fs_ivrd
|
||||
/libtool
|
||||
/modules.conf
|
||||
/quiet_libtool
|
||||
/tone2wav
|
||||
/scripts/fsxs
|
||||
/scripts/gentls_cert
|
||||
/a.out.dSYM
|
||||
|
||||
@@ -964,7 +964,9 @@ Global
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64.ActiveCfg = Release|x64
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64 Setup.ActiveCfg = Release|x64
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64 Setup.Build.0 = Release|x64
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x86 Setup.ActiveCfg = Release|Win32
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x86 Setup.Build.0 = Release|Win32
|
||||
{D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|Win32.ActiveCfg = Release|x64
|
||||
{D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|x64.ActiveCfg = Release|x64
|
||||
{D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|x64.Build.0 = Release|x64
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<param name="time-base-score" value="system"/>
|
||||
<param name="max-wait-time" value="0"/>
|
||||
<param name="max-wait-time-with-no-agent" value="0"/>
|
||||
<param name="max-wait-time-with-no-agent-time-reached" value="5"/>
|
||||
<param name="tier-rules-apply" value="false"/>
|
||||
<param name="tier-rule-wait-second" value="300"/>
|
||||
<param name="tier-rule-wait-multiply-level" value="true"/>
|
||||
|
||||
@@ -2,7 +2,16 @@
|
||||
<settings>
|
||||
<param name="listen-ip" value="0.0.0.0"/>
|
||||
<param name="listen-port" value="8031"/>
|
||||
<!-- Specify the first part of the node name
|
||||
(the host part after the @ will be autodetected)
|
||||
OR pass a complete nodename to avoid autodetection
|
||||
eg. freeswitch@example or freeswitch@example.com.
|
||||
If you pass a complete node name, the 'shortname' parameter has no effect. -->
|
||||
<param name="nodename" value="freeswitch"/>
|
||||
<!-- Specify this OR 'cookie-file' or $HOME/.erlang.cookie will be read -->
|
||||
<param name="cookie" value="ClueCon"/>
|
||||
<!-- Read a cookie from an arbitary erlang cookie file instead -->
|
||||
<!--<param name="cookie-file" value="/tmp/erlang.cookie"/>-->
|
||||
<param name="shortname" value="true"/>
|
||||
<!-- in additon to cookie, optionally restrict by ACL -->
|
||||
<!--<param name="apply-inbound-acl" value="lan"/>-->
|
||||
|
||||
@@ -1,17 +1,113 @@
|
||||
<configuration name="modules.conf" description="Modules">
|
||||
<modules>
|
||||
|
||||
<!-- Loggers (I'd load these first) -->
|
||||
<load module="mod_console"/>
|
||||
<load module="mod_logfile"/>
|
||||
<!-- <load module="mod_syslog"/> -->
|
||||
|
||||
<!--<load module="mod_yaml"/>-->
|
||||
|
||||
<!-- Multi-Faceted -->
|
||||
<!-- mod_enum is a dialplan interface, an application interface and an api command interface -->
|
||||
<load module="mod_enum"/>
|
||||
|
||||
<!-- XML Interfaces -->
|
||||
<!-- <load module="mod_xml_rpc"/> -->
|
||||
<!-- <load module="mod_xml_curl"/> -->
|
||||
<!-- <load module="mod_xml_cdr"/> -->
|
||||
|
||||
<!-- Event Handlers -->
|
||||
<load module="mod_cdr_csv"/>
|
||||
<!-- <load module="mod_event_multicast"/> -->
|
||||
<load module="mod_event_socket"/>
|
||||
<!-- <load module="mod_zeroconf"/> -->
|
||||
<!-- <load module="mod_erlang_event"/> -->
|
||||
|
||||
<!-- Directory Interfaces -->
|
||||
<!-- <load module="mod_ldap"/> -->
|
||||
|
||||
<!-- Endpoints -->
|
||||
<!-- <load module="mod_dingaling"/> -->
|
||||
<!-- <load module="mod_portaudio"/> -->
|
||||
<!-- <load module="mod_alsa"/> -->
|
||||
<load module="mod_sofia"/>
|
||||
<load module="mod_loopback"/>
|
||||
<!-- <load module="mod_woomera"/> -->
|
||||
<!-- <load module="mod_freetdm"/> -->
|
||||
<!-- <load module="mod_openzap"/> -->
|
||||
<!-- <load module="mod_unicall"/> -->
|
||||
<!-- <load module="mod_skinny"/> -->
|
||||
|
||||
<!-- Applications -->
|
||||
<load module="mod_commands"/>
|
||||
<load module="mod_conference"/>
|
||||
<load module="mod_db"/>
|
||||
<load module="mod_dptools"/>
|
||||
<load module="mod_expr"/>
|
||||
<load module="mod_fifo"/>
|
||||
<load module="mod_hash"/>
|
||||
<load module="mod_voicemail"/>
|
||||
<!--<load module="mod_directory"/>-->
|
||||
<!--<load module="mod_lcr"/>-->
|
||||
<load module="mod_esf"/>
|
||||
<load module="mod_fsv"/>
|
||||
<load module="mod_cluechoo"/>
|
||||
<load module="mod_valet_parking"/>
|
||||
<!--<load module="mod_spy"/>-->
|
||||
|
||||
<!-- SNOM Module -->
|
||||
<!--<load module="mod_snom"/>-->
|
||||
|
||||
<!-- Dialplan Interfaces -->
|
||||
<!-- <load module="mod_dialplan_directory"/> -->
|
||||
<load module="mod_dialplan_xml"/>
|
||||
<load module="mod_dialplan_asterisk"/>
|
||||
|
||||
<!-- Codec Interfaces -->
|
||||
<load module="mod_spandsp"/>
|
||||
<load module="mod_g723_1"/>
|
||||
<load module="mod_g729"/>
|
||||
<load module="mod_amr"/>
|
||||
<load module="mod_ilbc"/>
|
||||
<load module="mod_speex"/>
|
||||
<load module="mod_h26x"/>
|
||||
<load module="mod_siren"/>
|
||||
<!--<load module="mod_celt"/>-->
|
||||
|
||||
<!-- File Format Interfaces -->
|
||||
<load module="mod_sndfile"/>
|
||||
<load module="mod_native_file"/>
|
||||
<!--For icecast/mp3 streams/files-->
|
||||
<!--<load module="mod_shout"/>-->
|
||||
<!--For local streams (play all the files in a directory)-->
|
||||
<load module="mod_local_stream"/>
|
||||
<load module="mod_tone_stream"/>
|
||||
<load module="mod_file_string"/>
|
||||
|
||||
<!-- Timers -->
|
||||
|
||||
<!-- Languages -->
|
||||
<load module="mod_spidermonkey"/>
|
||||
<!-- <load module="mod_perl"/> -->
|
||||
<!-- <load module="mod_python"/> -->
|
||||
<!-- <load module="mod_java"/> -->
|
||||
<load module="mod_lua"/>
|
||||
|
||||
<!-- ASR /TTS -->
|
||||
<!-- <load module="mod_flite"/> -->
|
||||
<!-- <load module="mod_pocketsphinx"/> -->
|
||||
<!-- <load module="mod_cepstral"/> -->
|
||||
<!-- <load module="mod_tts_commandline"/> -->
|
||||
<!-- <load module="mod_rss"/> -->
|
||||
|
||||
<!-- Say -->
|
||||
<load module="mod_say_en"/>
|
||||
<load module="mod_say_ru"/>
|
||||
<!-- <load module="mod_say_zh"/> -->
|
||||
|
||||
<!-- Third party modules -->
|
||||
<!--<load module="mod_nibblebill"/>-->
|
||||
|
||||
</modules>
|
||||
</configuration>
|
||||
|
||||
@@ -4,14 +4,15 @@
|
||||
<!--
|
||||
Comma separated list of codecs to register with FreeSWITCH,
|
||||
by default (if this parameter is not set) all available codecs are registered.
|
||||
Valid codec values are: PCMU,PCMA,L16,G729,G726-32,GSM
|
||||
Valid codec values are: PCMU,PCMA,G729,G726-32,G722,GSM,G723,AMR,G7221,iLBC
|
||||
If this parameter is not specified only G729 will be registered
|
||||
<param name="register" value="all"/>
|
||||
-->
|
||||
|
||||
<!--
|
||||
List of codecs to not register with FreeSWITCH, by default this is empty,
|
||||
but you may want to not load PCMU and PCMA or may be others to not use your
|
||||
vocallo resources in codecs that are done well and fast in software.
|
||||
resources in codecs that are done well and fast in software.
|
||||
<param name="noregister" value="PCMU,PCMA"/>
|
||||
-->
|
||||
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
<key name="12" value="version"/>
|
||||
</cli-keybindings>
|
||||
|
||||
<default-ptimes>
|
||||
<!-- set this to overide the 20ms assumption of various codecs in the sdp with no ptime defined -->
|
||||
<!--<codec name="G729" ptime="40"/>-->
|
||||
</default-ptimes>
|
||||
|
||||
<settings>
|
||||
<!--Colorize the Console -->
|
||||
<param name="colorize-console" value="true"/>
|
||||
@@ -81,6 +86,7 @@
|
||||
<!-- <param name="core-db-dsn" value="dsn:username:password" /> -->
|
||||
<!-- The system will create all the db schemas automatically, set this to false to avoid this behaviour-->
|
||||
<!--<param name="auto-create-schemas" value="true"/>-->
|
||||
<!-- <param name="core-dbtype" value="MSSQL"/> -->
|
||||
</settings>
|
||||
|
||||
</configuration>
|
||||
|
||||
@@ -33,9 +33,10 @@
|
||||
<param name="ff-key" value="6"/>
|
||||
<param name="rew-key" value="4"/>
|
||||
<param name="skip-greet-key" value="#"/>
|
||||
<!--<param name="previous-message-key" value=""/>-->
|
||||
<!--<param name="next-message-key" value=""/>-->
|
||||
<!--<param name="skip-info-key" value=""/>-->
|
||||
<param name="previous-message-key" value="1"/>-->
|
||||
<param name="next-message-key" value="3"/>
|
||||
<param name="skip-info-key" value="*"/>
|
||||
<param name="repeat-message-key" value="0"/>
|
||||
<param name="record-silence-threshold" value="200"/>
|
||||
<param name="record-silence-hits" value="2"/>
|
||||
<param name="web-template-file" value="web-vm.tpl"/>
|
||||
|
||||
+758
-83
@@ -1,88 +1,763 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
NOTICE:
|
||||
|
||||
This context is usually accessed via authenticated callers on the sip profile on port 5060
|
||||
or transfered callers from the public context which arrived via the sip profile on port 5080.
|
||||
|
||||
Authenticated users will use the user_context variable on the user to determine what context
|
||||
they can access. You can also add a user in the directory with the cidr= attribute acl.conf.xml
|
||||
will build the domains ACL using this value.
|
||||
-->
|
||||
<!-- http://wiki.freeswitch.org/wiki/Dialplan_XML -->
|
||||
<include>
|
||||
<context name="public">
|
||||
<extension name="outbound-service">
|
||||
<condition field="destination_number" expression="^service$">
|
||||
</condition>
|
||||
</extension>
|
||||
<extension name="outbound132">
|
||||
<condition field="destination_number" expression="^132$">
|
||||
<action application="set" data="origination_caller_id_name=sipp"/>
|
||||
<action application="set" data="origination_caller_id_number=987654321"/>
|
||||
<action application="set" data="call_timeout=80"/>
|
||||
<action application="bridge" data="freetdm/grp1/a/132"/>
|
||||
</condition>
|
||||
</extension>
|
||||
<context name="default">
|
||||
|
||||
service <extension name="outbound">
|
||||
<condition field="destination_number" expression="(.*)">
|
||||
<action application="set" data="dialed_number=$1"/>
|
||||
<!-- <action application="answer"/> -->
|
||||
<action application="set" data="caller_id_name=sipp"/>
|
||||
<action application="set" data="effective_caller_id_number=987654321"/>
|
||||
<action application="set_profile_var" data="caller_ton=1"/>
|
||||
<action application="set_profile_var" data="caller_numplan=0"/>
|
||||
<action application="set_profile_var" data="destination_number_ton=1"/>
|
||||
<action application="set_profile_var" data="destination_number_numplan=0"/>
|
||||
<action application="bridge" data="freetdm/grp1/a/${dialed_number}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
<extension name="unloop">
|
||||
<condition field="${unroll_loops}" expression="^true$"/>
|
||||
<condition field="${sip_looped_call}" expression="^true$">
|
||||
<action application="deflect" data="${destination_number}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
</context>
|
||||
<context name="default">
|
||||
<extension name="fast-hangup">
|
||||
<condition field="destination_number" expression="123">
|
||||
<!-- <action application="sleep" data="1000"/> -->
|
||||
<!-- <action application="answer"/> -->
|
||||
<action application="answer"/>
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="playback" data="/usr/local/freeswitch/sounds/demo-congrats.gsm" />
|
||||
<action application="hangup" />
|
||||
</condition>
|
||||
</extension>
|
||||
<extension name="slow-hangup">
|
||||
<condition field="destination_number" expression="124">
|
||||
<action application="answer"/>
|
||||
<action application="playback" data="c:\cygwin\home\davidy\smg_freeswitch.netborder\Debug\sounds\tt-monkeys.gsm" />
|
||||
<action application="hangup" />
|
||||
</condition>
|
||||
</extension>
|
||||
<extension name="answer-then-bridge">
|
||||
<condition field="destination_number" expression="125">
|
||||
<action application="answer"/>
|
||||
<action application="bridge" data="sofia/$${domain}/123@192.168.1.144:5062"/>
|
||||
<action application="hangup" />
|
||||
</condition>
|
||||
</extension>
|
||||
<extension name="just-bridge">
|
||||
<condition field="destination_number" expression="126">
|
||||
<!-- <action application="sleep" data="20000" /> -->
|
||||
<!-- <action application="answer"/> -->
|
||||
<!-- <action application="info" /> -->
|
||||
<action application="log" data="DESTINATION_NUMBER [${destination_number}]" />
|
||||
<action application="log" data="CALLER_TON [${caller_ton}]" />
|
||||
<action application="log" data="CALLER_NPI [${caller_numplan}]" />
|
||||
<action application="log" data="DEST_TON [${destination_number_ton}]" />
|
||||
<action application="log" data="DEST_NPI [${destination_number_numplan}]" />
|
||||
<action application="bridge" data="sofia/$${domain}/123@192.168.1.145:5062"/>
|
||||
<action application="hangup" />
|
||||
</condition>
|
||||
</extension>
|
||||
<extension name="other">
|
||||
<condition field="destination_number" expression="(.*)">
|
||||
<action application="log" data="CID_NAME [${caller_id_name}]" />
|
||||
<action application="bridge" data="sofia/$${domain}/123@192.168.1.145:5062"/>
|
||||
<action application="hangup"/>
|
||||
</condition>
|
||||
</extension>
|
||||
</context>
|
||||
<!-- Example of doing things based on time of day.
|
||||
|
||||
year = 4 digit year. Example year="2009"
|
||||
yday = 1-365
|
||||
mon = 1-12
|
||||
mday = 1-31
|
||||
week = 1-52
|
||||
mweek= 1-6
|
||||
wday = 1-7
|
||||
hour = 0-23
|
||||
minute = 0-59
|
||||
minute-of-day = 1-1440
|
||||
|
||||
Example:
|
||||
<condition minute-of-day="540-1080"> (9am to 6pm EVERY day)
|
||||
do something ...
|
||||
</condition>
|
||||
-->
|
||||
<extension name="tod_example" continue="true">
|
||||
<condition wday="2-6" hour="9-18">
|
||||
<action application="set" data="open=true"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- Example of routing based on holidays
|
||||
|
||||
This example covers all US Federal holidays except for inauguration day.
|
||||
-->
|
||||
|
||||
<extension name="holiday_example" continue="true">
|
||||
<condition mday="1" mon="1">
|
||||
<!-- new year's day -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
<condition wday="2" mweek="3" mon="1">
|
||||
<!-- martin luther king day is the 3rd monday in january -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
<condition wday="2" mweek="3" mon="2">
|
||||
<!-- president's day is the 3rd monday in february -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
<condition wday="2" mon="5" mday="25-31">
|
||||
<!-- memorial day is the last monday in may (the only monday between the 25th and the 31st) -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
<condition mday="4" mon="7">
|
||||
<!-- independence day -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
<condition wday="2" mweek="1" mon="9">
|
||||
<!-- labor day is the 1st monday in september -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
<condition wday="2" mweek="2" mon="10">
|
||||
<!-- columbus day is the 2nd monday in october -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
<condition mday="11" mon="11">
|
||||
<!-- veteran's day -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
<condition wday="5-6" mweek="4" mon="11">
|
||||
<!-- thanksgiving is the 4th thursday in november and usually there's an extension for black friday -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
<condition mday="25" mon="12">
|
||||
<!-- Christmas -->
|
||||
<action application="set" data="open=false"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="global-intercept">
|
||||
<condition field="destination_number" expression="^886$">
|
||||
<action application="answer"/>
|
||||
<action application="intercept" data="${hash(select/${domain_name}-last_dial_ext/global)}"/>
|
||||
<action application="sleep" data="2000"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="group-intercept">
|
||||
<condition field="destination_number" expression="^\*8$">
|
||||
<action application="answer"/>
|
||||
<action application="intercept" data="${hash(select/${domain_name}-last_dial_ext/${callgroup})}"/>
|
||||
<action application="sleep" data="2000"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="intercept-ext">
|
||||
<condition field="destination_number" expression="^\*\*(\d+)$">
|
||||
<action application="answer"/>
|
||||
<action application="intercept" data="${hash(select/${domain_name}-last_dial_ext/$1)}"/>
|
||||
<action application="sleep" data="2000"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="redial">
|
||||
<condition field="destination_number" expression="^(redial|870)$">
|
||||
<action application="transfer" data="${hash(select/${domain_name}-last_dial/${caller_id_number})}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="global" continue="true">
|
||||
<condition field="${call_debug}" expression="^true$" break="never">
|
||||
<action application="info"/>
|
||||
</condition>
|
||||
<!--
|
||||
This is an example of how to auto detect if telephone-event is missing and activate inband detection
|
||||
-->
|
||||
<!--
|
||||
<condition field="${switch_r_sdp}" expression="a=rtpmap:(\d+)\stelephone-event/8000" break="never">
|
||||
<action application="set" data="rtp_payload_number=$1"/>
|
||||
<anti-action application="start_dtmf"/>
|
||||
</condition>
|
||||
-->
|
||||
<condition field="${sip_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$" break="never">
|
||||
<action application="set" data="sip_secure_media=true"/>
|
||||
<!-- Offer SRTP on outbound legs if we have it on inbound. -->
|
||||
<!-- <action application="export" data="sip_secure_media=true"/> -->
|
||||
</condition>
|
||||
|
||||
<condition>
|
||||
<action application="hash" data="insert/${domain_name}-spymap/${caller_id_number}/${uuid}"/>
|
||||
<action application="hash" data="insert/${domain_name}-last_dial/${caller_id_number}/${destination_number}"/>
|
||||
<action application="hash" data="insert/${domain_name}-last_dial/global/${uuid}"/>
|
||||
<action application="set" data="RFC2822_DATE=${strftime(%a, %d %b %Y %T %z)}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- If sip_req_host is not a local domain then this has to be an external sip uri -->
|
||||
<!--
|
||||
<extension name="external_sip_uri" continue="true">
|
||||
<condition field="source" expression="mod_sofia"/>
|
||||
<condition field="${outside_call}" expression="^$"/>
|
||||
<condition field="${domain_exists(${sip_req_host})}" expression="true">
|
||||
<anti-action application="bridge" data="sofia/${use_profile}/${sip_to_uri}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
-->
|
||||
<!--
|
||||
Snom button demo, call 9000 to make button 2 mapped to transfer the current call to a conference
|
||||
-->
|
||||
|
||||
<extension name="snom-demo-2">
|
||||
<condition field="destination_number" expression="^9001$">
|
||||
<action application="eval" data="${snom_bind_key(2 off DND ${sip_from_user} ${sip_from_host} ${sofia_profile_name} message notused)}"/>
|
||||
<action application="transfer" data="3000"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="snom-demo-1">
|
||||
<condition field="destination_number" expression="^9000$">
|
||||
<!--<key> <light> <label> <user> <host> <profile> <action_name> <action>-->
|
||||
<action application="eval" data="${snom_bind_key(2 on DND ${sip_from_user} ${sip_from_host} ${sofia_profile_name} message api+uuid_transfer ${uuid} 9001)}"/>
|
||||
<action application="playback" data="$${hold_music}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="eavesdrop">
|
||||
<condition field="destination_number" expression="^88(\d{4})$|^\*0(.*)$">
|
||||
<action application="answer"/>
|
||||
<action application="eavesdrop" data="${hash(select/${domain_name}-spymap/$1)}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="eavesdrop">
|
||||
<condition field="destination_number" expression="^779$">
|
||||
<action application="answer"/>
|
||||
<action application="set" data="eavesdrop_indicate_failed=tone_stream://%(500, 0, 320)"/>
|
||||
<action application="set" data="eavesdrop_indicate_new=tone_stream://%(500, 0, 620)"/>
|
||||
<action application="set" data="eavesdrop_indicate_idle=tone_stream://%(250, 0, 920)"/>
|
||||
<action application="eavesdrop" data="all"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="call_return">
|
||||
<condition field="destination_number" expression="^\*69$|^869$|^lcr$">
|
||||
<action application="transfer" data="${hash(select/${domain_name}-call_return/${caller_id_number})}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="del-group">
|
||||
<condition field="destination_number" expression="^80(\d{2})$">
|
||||
<action application="answer"/>
|
||||
<action application="group" data="delete:$1@${domain_name}:${sofia_contact(${sip_from_user}@${domain_name})}"/>
|
||||
<action application="gentones" data="%(1000, 0, 320)"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="add-group">
|
||||
<condition field="destination_number" expression="^81(\d{2})$">
|
||||
<action application="answer"/>
|
||||
<action application="group" data="insert:$1@${domain_name}:${sofia_contact(${sip_from_user}@${domain_name})}"/>
|
||||
<action application="gentones" data="%(1000, 0, 640)"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="call-group-simo">
|
||||
<condition field="destination_number" expression="^82(\d{2})$">
|
||||
<action application="bridge" data="{leg_timeout=15,ignore_early_media=true}${group(call:$1@${domain_name})}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="call-group-order">
|
||||
<condition field="destination_number" expression="^83(\d{2})$">
|
||||
<action application="bridge" data="{leg_timeout=15,ignore_early_media=true}${group(call:$1@${domain_name}:order)}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="extension-intercom">
|
||||
<condition field="destination_number" expression="^8(10[01][0-9])$">
|
||||
<action application="set" data="dialed_extension=$1"/>
|
||||
<action application="export" data="sip_auto_answer=true"/>
|
||||
<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
dial the extension (1000-1019) for 30 seconds and go to voicemail if the
|
||||
call fails (continue_on_fail=true), otherwise hang up after a successful
|
||||
bridge (hangup_after_bridge=true)
|
||||
-->
|
||||
<extension name="Local_Extension">
|
||||
<condition field="destination_number" expression="^(10[01][0-9])$">
|
||||
<action application="set" data="dialed_extension=$1"/>
|
||||
<action application="export" data="dialed_extension=$1"/>
|
||||
<!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
|
||||
<action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
|
||||
<action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
|
||||
<action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
|
||||
<action application="bind_meta_app" data="4 b s execute_extension::att_xfer XML features"/>
|
||||
<action application="set" data="ringback=${us-ring}"/>
|
||||
<action application="set" data="transfer_ringback=$${hold_music}"/>
|
||||
<action application="set" data="call_timeout=30"/>
|
||||
<!-- <action application="set" data="sip_exclude_contact=${network_addr}"/> -->
|
||||
<action application="set" data="hangup_after_bridge=true"/>
|
||||
<!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
|
||||
<action application="set" data="continue_on_fail=true"/>
|
||||
<action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
|
||||
<action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
|
||||
<action application="hash" data="insert/${domain_name}-last_dial_ext/${called_party_callgroup}/${uuid}"/>
|
||||
<action application="hash" data="insert/${domain_name}-last_dial_ext/global/${uuid}"/>
|
||||
<action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
|
||||
<!--<action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>-->
|
||||
<action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
|
||||
<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
|
||||
<action application="answer"/>
|
||||
<action application="sleep" data="1000"/>
|
||||
<action application="bridge" data="loopback/app=voicemail:default ${domain_name} ${dialed_extension}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="Local_Extension_Skinny">
|
||||
<condition field="destination_number" expression="^(11[01][0-9])$">
|
||||
<action application="bridge" data="skinny/internal/${destination_number}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="group_dial_sales">
|
||||
<condition field="destination_number" expression="^2000$">
|
||||
<action application="bridge" data="${group_call(sales@${domain_name})}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="group_dial_support">
|
||||
<condition field="destination_number" expression="^2001$">
|
||||
<action application="bridge" data="group/support@${domain_name}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="group_dial_billing">
|
||||
<condition field="destination_number" expression="^2002$">
|
||||
<action application="bridge" data="group/billing@${domain_name}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- voicemail operator extension -->
|
||||
<extension name="operator">
|
||||
<condition field="destination_number" expression="^(operator|0)$">
|
||||
<action application="set" data="transfer_ringback=$${hold_music}"/>
|
||||
<action application="transfer" data="1000 XML features"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- voicemail main extension -->
|
||||
<extension name="vmain">
|
||||
<condition field="destination_number" expression="^vmain$|^4000$|^\*98$">
|
||||
<action application="answer"/>
|
||||
<action application="sleep" data="1000"/>
|
||||
<action application="voicemail" data="check default ${domain_name}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
This extension is used by mod_portaudio so you can pa call sip:someone@example.com
|
||||
mod_portaudio will pass the entire string to the dialplan for routing.
|
||||
-->
|
||||
<extension name="sip_uri">
|
||||
<condition field="destination_number" expression="^sip:(.*)$">
|
||||
<action application="bridge" data="sofia/${use_profile}/$1"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
start a dynamic conference with the settings of the "default" conference profile in conference.conf.xml
|
||||
-->
|
||||
<extension name="nb_conferences">
|
||||
<condition field="destination_number" expression="^(30\d{2})$">
|
||||
<action application="answer"/>
|
||||
<action application="conference" data="$1-${domain_name}@default"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="wb_conferences">
|
||||
<condition field="destination_number" expression="^(31\d{2})$">
|
||||
<action application="answer"/>
|
||||
<action application="conference" data="$1-${domain_name}@wideband"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="uwb_conferences">
|
||||
<condition field="destination_number" expression="^(32\d{2})$">
|
||||
<action application="answer"/>
|
||||
<action application="conference" data="$1-${domain_name}@ultrawideband"/>
|
||||
</condition>
|
||||
</extension>
|
||||
<!-- MONO 48kHz conferences -->
|
||||
<extension name="cdquality_conferences">
|
||||
<condition field="destination_number" expression="^(33\d{2})$">
|
||||
<action application="answer"/>
|
||||
<action application="conference" data="$1-${domain_name}@cdquality"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- dial the FreeSWITCH conference via SIP-->
|
||||
<extension name="freeswitch_public_conf_via_sip">
|
||||
<condition field="destination_number" expression="^9(888|8888|1616|3232)$">
|
||||
<action application="export" data="hold_music=silence"/>
|
||||
<!--
|
||||
This will take the SAS from the b-leg and send it to the display on the a-leg phone.
|
||||
Known working with Polycom and Snom maybe others.
|
||||
-->
|
||||
<!--
|
||||
<action application="set" data="exec_after_bridge_app=${sched_api(+4 zrtp expand uuid_display ${uuid} \${uuid_getvar(\${uuid_getvar(${uuid} signal_bond)} zrtp_sas1_string )} \${uuid_getvar(\${uuid_getvar(${uuid} signal_bond)} zrtp_sas2_string )} )}"/>
|
||||
<action application="export" data="nolocal:zrtp_secure_media=true"/>
|
||||
-->
|
||||
<action application="bridge" data="sofia/${use_profile}/$1@conference.freeswitch.org"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
This extension will start a conference and invite a group.
|
||||
At anytime the participant can dial *2 to bridge directly to the boss.
|
||||
All other callers are then hung up on.
|
||||
-->
|
||||
<extension name="mad_boss_intercom">
|
||||
<condition field="destination_number" expression="^0911$">
|
||||
<action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss1"/>
|
||||
<action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
|
||||
<action application="set" data="conference_auto_outcall_timeout=60"/>
|
||||
<action application="set" data="conference_auto_outcall_flags=mute"/>
|
||||
<action application="set" data="conference_auto_outcall_prefix={sip_auto_answer=true,execute_on_answer='bind_meta_app 2 a s1 transfer::intercept:${uuid} inline'}"/>
|
||||
<action application="set" data="sip_exclude_contact=${network_addr}"/>
|
||||
<action application="conference_set_auto_outcall" data="${group_call(sales)}"/>
|
||||
<action application="conference" data="madboss_intercom1@default+flags{endconf|deaf}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
This extension will start a conference and invite a few of people.
|
||||
At anytime the participant can dial *2 to bridge directly to the boss.
|
||||
All other callers are then hung up on.
|
||||
-->
|
||||
<extension name="mad_boss_intercom">
|
||||
<condition field="destination_number" expression="^0912$">
|
||||
<action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss2"/>
|
||||
<action application="set" data="conference_auto_outcall_caller_id_number=0912"/>
|
||||
<action application="set" data="conference_auto_outcall_timeout=60"/>
|
||||
<action application="set" data="conference_auto_outcall_flags=mute"/>
|
||||
<action application="set" data="conference_auto_outcall_prefix={sip_auto_answer=true,execute_on_answer='bind_meta_app 2 a s1 transfer::intercept:${uuid} inline'}"/>
|
||||
<action application="set" data="sip_exclude_contact=${network_addr}"/>
|
||||
<action application="conference_set_auto_outcall" data="loopback/9664"/>
|
||||
<action application="conference" data="madboss_intercom2@default+flags{endconf|deaf}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--This extension will start a conference and invite several people upon entering -->
|
||||
<extension name="mad_boss">
|
||||
<condition field="destination_number" expression="^0913$">
|
||||
<!--These params effect the outcalls made once you join-->
|
||||
<action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss"/>
|
||||
<action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
|
||||
<action application="set" data="conference_auto_outcall_timeout=60"/>
|
||||
<action application="set" data="conference_auto_outcall_flags=none"/>
|
||||
<!--<action application="set" data="conference_auto_outcall_announce=say:You have been called into an emergency conference"/>-->
|
||||
<!--Add as many of these as you need, These are the people you are going to call-->
|
||||
<action application="conference_set_auto_outcall" data="loopback/9664"/>
|
||||
<action application="conference" data="madboss3@default"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- a sample IVR -->
|
||||
<extension name="ivr_demo">
|
||||
<condition field="destination_number" expression="^5000$">
|
||||
<action application="answer"/>
|
||||
<action application="sleep" data="2000"/>
|
||||
<action application="ivr" data="demo_ivr"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- Create a conference on the fly and pull someone in at the same time. -->
|
||||
<extension name="dynamic_conference">
|
||||
<condition field="destination_number" expression="^5001$">
|
||||
<action application="conference" data="bridge:mydynaconf:sofia/${use_profile}/1234@conference.freeswitch.org"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="rtp_multicast_page">
|
||||
<condition field="destination_number" expression="^pagegroup$|^7243$">
|
||||
<action application="answer"/>
|
||||
<action application="esf_page_group"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
Parking extensions... transferring calls to 5900 will park them in a queue.
|
||||
-->
|
||||
<extension name="park">
|
||||
<condition field="destination_number" expression="^5900$">
|
||||
<action application="set" data="fifo_music=$${hold_music}"/>
|
||||
<action application="fifo" data="5900@${domain_name} in"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
Parking pickup extension. Calling 5901 will pickup the call.
|
||||
-->
|
||||
<extension name="unpark">
|
||||
<condition field="destination_number" expression="^5901$">
|
||||
<action application="answer"/>
|
||||
<action application="fifo" data="5900@${domain_name} out nowait"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
Valet park retrieval, works with valet_park extension below.
|
||||
Retrieve a valet parked call by dialing 6000 + park number + #
|
||||
-->
|
||||
<extension name="valet_park">
|
||||
<condition field="destination_number" expression="^(6000)$">
|
||||
<action application="answer"/>
|
||||
<action application="valet_park" data="valet_parking_lot ask 1 11 10000 ivr/ivr-enter_ext_pound.wav"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
Valet park 6001-6099. Blind x-fer to 6001, 6002, etc. to valet park the call.
|
||||
Dial 6001, 6002, etc. to retrieve a call that is already valet parked.
|
||||
After call is retrieved, park extension is free for another call.
|
||||
-->
|
||||
<extension name="valet_park">
|
||||
<condition field="destination_number" expression="^(60\d[1-9])$">
|
||||
<action application="answer"/>
|
||||
<action application="valet_park" data="valet_parking_lot $1"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
|
||||
<!--
|
||||
This extension is used with Snom phones.
|
||||
|
||||
Set a function key to park+lot (lot being a number or name.)
|
||||
Set type to Park+Orbit. You can then park and pickup using
|
||||
the softkey on the phone. Should work with other phones.
|
||||
-->
|
||||
<extension name="park">
|
||||
<condition field="source" expression="mod_sofia"/>
|
||||
<condition field="destination_number" expression="park\+(\d+)">
|
||||
<action application="fifo" data="$1@${domain_name} in undef $${hold_music}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
<!--
|
||||
The extension is parking pickup with a to param of the fifo we are calling
|
||||
Some phones send things like orbit= and you can extract that info.
|
||||
-->
|
||||
<extension name="unpark">
|
||||
<condition field="source" expression="mod_sofia"/>
|
||||
<condition field="destination_number" expression="^parking$"/>
|
||||
<condition field="${sip_to_params}" expression="fifo\=(\d+)">
|
||||
<action application="answer"/>
|
||||
<action application="fifo" data="$1@${domain_name} out nowait"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
This extension is used with Linksys phones.
|
||||
|
||||
Set a Phone tab option Call Park Serv to yes. You can park and
|
||||
pickup using soft keys "park" and "unpark" found during
|
||||
active call when moving navigation button. The other option
|
||||
is to use phone's star codes (defaults to *38 and *39).
|
||||
-->
|
||||
<extension name="park">
|
||||
<condition field="source" expression="mod_sofia"/>
|
||||
<condition field="destination_number" expression="callpark"/>
|
||||
<condition field="${sip_refer_to}">
|
||||
<expression><![CDATA[<sip:callpark@${domain_name};orbit=(\d+)>]]></expression>
|
||||
<action application="fifo" data="$1@${domain_name} in undef $${hold_music}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
This extension is used with Linksys phones.
|
||||
|
||||
The extension is parking pickup with a to param of the fifo
|
||||
we are calling. Linksys sends orbit=<parkingslotnumber>
|
||||
and we extract that info.
|
||||
-->
|
||||
<extension name="unpark">
|
||||
<condition field="source" expression="mod_sofia"/>
|
||||
<condition field="destination_number" expression="pickup"/>
|
||||
<condition field="${sip_to_params}" expression="orbit\=(\d+)">
|
||||
<action application="answer"/>
|
||||
<action application="fifo" data="$1@${domain_name} out nowait"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
Here are some examples of how to override the ringback heard by the
|
||||
far end. You have two variables that you can use to override this.
|
||||
|
||||
ringback - used when a call isn't answered. (early media)
|
||||
transfer_ringback - used when the call is already answered. (post answer)
|
||||
-->
|
||||
|
||||
<!-- Demonstration of how to override the ringback in various situations -->
|
||||
<extension name="wait">
|
||||
<condition field="destination_number" expression="^wait$">
|
||||
<action application="pre_answer"/>
|
||||
<action application="sleep" data="20000"/>
|
||||
<action application="answer"/>
|
||||
<action application="sleep" data="1000"/>
|
||||
<action application="playback" data="voicemail/vm-goodbye.wav"/>
|
||||
<action application="hangup"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="fax_receive">
|
||||
<condition field="destination_number" expression="^9178$">
|
||||
<action application="answer" />
|
||||
<action application="playback" data="silence_stream://2000"/>
|
||||
<action application="rxfax" data="/tmp/rxfax.tif"/>
|
||||
<action application="hangup"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="fax_transmit">
|
||||
<condition field="destination_number" expression="^9179$">
|
||||
<action application="txfax" data="/tmp/txfax.tif"/>
|
||||
<action application="hangup"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- Send a 180 and let the far end generate ringback. -->
|
||||
<extension name="ringback_180">
|
||||
<condition field="destination_number" expression="^9180$">
|
||||
<action application="ring_ready"/>
|
||||
<action application="sleep" data="20000"/>
|
||||
<action application="answer"/>
|
||||
<action application="sleep" data="1000"/>
|
||||
<action application="playback" data="voicemail/vm-goodbye.wav"/>
|
||||
<action application="hangup"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- Send a 183 and send uk-ring as the ringtone. (early media) -->
|
||||
<extension name="ringback_183_uk_ring">
|
||||
<condition field="destination_number" expression="^9181$">
|
||||
<action application="set" data="ringback=$${uk-ring}"/>
|
||||
<action application="bridge" data="{ignore_early_media=true}loopback/wait"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- Send a 183 and use music as the ringtone. (early media) -->
|
||||
<extension name="ringback_183_music_ring">
|
||||
<condition field="destination_number" expression="^9182$">
|
||||
<action application="set" data="ringback=$${hold_music}"/>
|
||||
<action application="bridge" data="{ignore_early_media=true}loopback/wait"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- Answer the call and use music as the ringtone. (post answer) -->
|
||||
<extension name="ringback_post_answer_uk_ring">
|
||||
<condition field="destination_number" expression="^9183$">
|
||||
<action application="set" data="transfer_ringback=$${uk-ring}"/>
|
||||
<action application="answer"/>
|
||||
<action application="bridge" data="{ignore_early_media=true}loopback/wait"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- Answer the call and use music as the ringtone. (post answer) -->
|
||||
<extension name="ringback_post_answer_music">
|
||||
<condition field="destination_number" expression="^9184$">
|
||||
<action application="set" data="transfer_ringback=$${hold_music}"/>
|
||||
<action application="answer"/>
|
||||
<action application="bridge" data="{ignore_early_media=true}loopback/wait"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="ClueCon">
|
||||
<condition field="destination_number" expression="^9191$">
|
||||
<action application="set" data="effective_caller_id_name=ClueCon IVR"/>
|
||||
<action application="bridge" data="sofia/$${domain}/2000@bkw.org"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="show_info">
|
||||
<condition field="destination_number" expression="^9192$">
|
||||
<action application="answer"/>
|
||||
<action application="info"/>
|
||||
<action application="sleep" data="250"/>
|
||||
<action application="hangup"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="video_record">
|
||||
<condition field="destination_number" expression="^9193$">
|
||||
<action application="answer"/>
|
||||
<action application="record_fsv" data="/tmp/testrecord.fsv"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="video_playback">
|
||||
<condition field="destination_number" expression="^9194$">
|
||||
<action application="answer"/>
|
||||
<action application="play_fsv" data="/tmp/testrecord.fsv"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="delay_echo">
|
||||
<condition field="destination_number" expression="^9195$">
|
||||
<action application="answer"/>
|
||||
<action application="delay_echo" data="5000"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="echo">
|
||||
<condition field="destination_number" expression="^9196$">
|
||||
<action application="answer"/>
|
||||
<action application="echo"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="milliwatt">
|
||||
<condition field="destination_number" expression="^9197$">
|
||||
<action application="answer"/>
|
||||
<action application="playback" data="tone_stream://%(251,0,1004);loops=-1"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="tone_stream">
|
||||
<condition field="destination_number" expression="^9198$">
|
||||
<action application="answer"/>
|
||||
<action application="playback" data="tone_stream://path=${base_dir}/conf/tetris.ttml;loops=10"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!-- install zrtp_agent.lua into scripts (ZRTP == 9787) -->
|
||||
<extension name="zrtp_enrollement">
|
||||
<condition field="destination_number" expression="^9787$">
|
||||
<action application="lua" data="zrtp_agent.lua"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
You will no longer hear the bong tone. The wav file is playing stating the call is secure.
|
||||
The file will not play unless you have both TLS and SRTP active.
|
||||
-->
|
||||
|
||||
<extension name="hold_music">
|
||||
<condition field="destination_number" expression="^9664$"/>
|
||||
<condition field="${sip_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$">
|
||||
<action application="answer"/>
|
||||
<action application="execute_extension" data="is_secure XML features"/>
|
||||
<action application="playback" data="$${hold_music}"/>
|
||||
<anti-action application="set" data="zrtp_secure_media=true"/>
|
||||
<anti-action application="answer"/>
|
||||
<anti-action application="playback" data="silence_stream://2000"/>
|
||||
<anti-action application="execute_extension" data="is_zrtp_secure XML features"/>
|
||||
<anti-action application="playback" data="$${hold_music}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<!--
|
||||
You can place files in the default directory to get included.
|
||||
-->
|
||||
<X-PRE-PROCESS cmd="include" data="default/*.xml"/>
|
||||
|
||||
<!--
|
||||
<extension name="refer">
|
||||
<condition field="${sip_refer_to}">
|
||||
<expression><![CDATA[<sip:${destination_number}@${domain_name}>]]></expression>
|
||||
</condition>
|
||||
<condition field="${sip_refer_to}">
|
||||
<expression><![CDATA[<sip:(.*)@(.*)>]]></expression>
|
||||
<action application="set" data="refer_user=$1"/>
|
||||
<action application="set" data="refer_domain=$2"/>
|
||||
<action application="info"/>
|
||||
<action application="bridge" data="sofia/${use_profile}/${refer_user}@${refer_domain}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
-->
|
||||
<!--
|
||||
This is an example of how to override the RURI on an outgoing invite to a registered contact.
|
||||
-->
|
||||
<!--
|
||||
<extension name="ruri">
|
||||
<condition field="destination_number" expression="^ruri$">
|
||||
<action application="bridge" data="sofia/${ruri_profile}/${ruri_user}${regex(${sofia_contact(${ruri_contact})}|^[^\@]+(.*)|%1)}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="7004">
|
||||
<condition field="destination_number" expression="^7004$">
|
||||
<action application="set" data="ruri_profile=default"/>
|
||||
<action application="set" data="ruri_user=2000"/>
|
||||
<action application="set" data="ruri_contact=1001@${domain_name}"/>
|
||||
<action application="execute_extension" data="ruri"/>
|
||||
</condition>
|
||||
</extension>
|
||||
-->
|
||||
|
||||
<extension name="enum">
|
||||
<condition field="${module_exists(mod_enum)}" expression="true"/>
|
||||
<condition field="destination_number" expression="^(.*)$">
|
||||
<action application="transfer" data="$1 enum"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
</context>
|
||||
</include>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<!--the domain or ip (the right hand side of the @ in the addr-->
|
||||
<domain name="$${domain}">
|
||||
<params>
|
||||
<param name="dial-string" value="{presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}"/>
|
||||
<param name="dial-string" value="{sip_invite_domain=${dialed_domain},presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}"/>
|
||||
</params>
|
||||
|
||||
<variables>
|
||||
|
||||
@@ -42,6 +42,26 @@
|
||||
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
|
||||
<!-- <param name="shutdown-on-fail" value="true"/> -->
|
||||
<param name="sip-trace" value="no"/>
|
||||
|
||||
<!--
|
||||
Sometimes, in extremely rare edge cases, the Sofia SIP stack may stop
|
||||
responding. These options allow you to enable and control a watchdog
|
||||
on the Sofia SIP stack so that if it stops responding for the
|
||||
specified number of milliseconds, it will cause FreeSWITCH to shut
|
||||
down immediately. This is useful if you run in an HA environment and
|
||||
need to ensure automated recovery from such a condition. Note that if
|
||||
your server is idle a lot, the watchdog may fire due to not receiving
|
||||
any SIP messages. Thus, if you expect your system to be idle, you
|
||||
should leave the watchdog disabled. It can be toggled on and off
|
||||
through the FreeSWITCH CLI either on an individual profile basis or
|
||||
globally for all profiles. So, if you run in an HA environment with a
|
||||
master and slave, you should use the CLI to make sure the watchdog is
|
||||
only enabled on the master.
|
||||
-->
|
||||
<param name="watchdog-enabled" value="no"/>
|
||||
<param name="watchdog-step-timeout" value="30000"/>
|
||||
<param name="watchdog-event-timeout" value="30000"/>
|
||||
|
||||
<param name="log-auth-failures" value="true"/>
|
||||
<param name="forward-unsolicited-mwi-notify" value="false"/>
|
||||
|
||||
@@ -112,6 +132,8 @@
|
||||
<param name="record-template" value="${caller_id_number}.${target_domain}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
|
||||
<!--enable to use presence -->
|
||||
<param name="manage-presence" value="true"/>
|
||||
<!-- send a presence probe on each register to query devices to send presence instead of sending presence with less info -->
|
||||
<!--<param name="presence-probe-on-register" value="true"/>-->
|
||||
<!--<param name="manage-shared-appearance" value="true"/>-->
|
||||
<!-- used to share presence info across sofia profiles -->
|
||||
<!-- Name of the db to use for this profile -->
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<soft-key-set-sets>
|
||||
<soft-key-set-set name="default">
|
||||
<soft-key-set name="KeySetOnHook" value="SoftkeyNewcall,SoftkeyRedial"/>
|
||||
<soft-key-set name="KeySetOffHook" value=",SoftkeyNewcall,SoftkeyEndcall"/>
|
||||
<soft-key-set name="KeySetOffHook" value=",SoftkeyRedial,SoftkeyEndcall"/>
|
||||
<soft-key-set name="KeySetDigitsAfterDialingFirstDigit" value="SoftkeyBackspace,,SoftkeyEndcall"/>
|
||||
<soft-key-set name="KeySetConnected" value="SoftkeyEndcall,SoftkeyHold,SoftkeyNewcall,SoftkeyTransfer"/>
|
||||
<soft-key-set name="KeySetRingIn" value="SoftkeyAnswer,SoftkeyEndcall,SoftkeyNewcall"/>
|
||||
|
||||
+1
-1
@@ -195,7 +195,7 @@
|
||||
|
||||
<!-- various debug and defaults -->
|
||||
<X-PRE-PROCESS cmd="set" data="call_debug=false"/>
|
||||
<X-PRE-PROCESS cmd="set" data="console_loglevel=debug"/>
|
||||
<X-PRE-PROCESS cmd="set" data="console_loglevel=info"/>
|
||||
<X-PRE-PROCESS cmd="set" data="default_areacode=918"/>
|
||||
<X-PRE-PROCESS cmd="set" data="default_country=US"/>
|
||||
|
||||
|
||||
@@ -373,6 +373,11 @@ if test "x$have_libz" = "xyes" ; then
|
||||
APR_ADDTO(SWITCH_AM_LDFLAGS, -lz)
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(resolv, res_init, have_libresolv=yes, have_libresolv=no)
|
||||
if test "x$have_libresolv" = "xyes" ; then
|
||||
APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv)
|
||||
fi
|
||||
|
||||
ESL_LDFLAGS=
|
||||
PLATFORM_CORE_DEPLIBS=
|
||||
# tweak platform specific flags
|
||||
|
||||
@@ -17,13 +17,13 @@ my $USAGE = "
|
||||
FreeSWITCH Logger Utility
|
||||
|
||||
USAGE:
|
||||
-h --helpThis help
|
||||
-h --help This help
|
||||
-p --port <port> Choose port
|
||||
-P -pass <pass> Choose password
|
||||
-f --file <file> Output file
|
||||
-pb --paste-bin <name> Post to FreeSWITCH Paste Bin
|
||||
-sp --sip-profiles <list> List of SIP profiles to trace
|
||||
-sd --sip-debug <level> Set SIP debug level
|
||||
-sd --sip-debug <level> Set SIP debug level
|
||||
|
||||
No arguments given will trace profile 'internal' to STDOUT
|
||||
";
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetdm", "msvc\freetdm.2010.vcxproj", "{93B8812C-3EC4-4F78-8970-FFBFC99E167D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testanalog", "msvc\testanalog\testanalog.2010.vcxproj", "{BB833648-BAFF-4BE2-94DB-F8BB043C588C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testisdn", "msvc\testisdn\testisdn.2010.vcxproj", "{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_freetdm", "mod_freetdm\mod_freetdm.2010.vcxproj", "{FE3540C5-3303-46E0-A69E-D92F775687F1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_analog", "src\ftmod\ftmod_analog\ftmod_analog.2010.vcxproj", "{37C94798-6E33-4B4F-8EE0-C72A7DC91157}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_analog_em", "src\ftmod\ftmod_analog_em\ftmod_analog_em.2010.vcxproj", "{B3F49375-2834-4937-9D8C-4AC2EC911010}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_isdn", "src\ftmod\ftmod_isdn\ftmod_isdn.2010.vcxproj", "{729344A5-D5E9-434D-8EE8-AF8C6C795D15}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_pika", "src\ftmod\ftmod_pika\ftmod_pika.2010.vcxproj", "{E886B4D5-AB4F-4092-B8F4-3B06E1E462EF}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_wanpipe", "src\ftmod\ftmod_wanpipe\ftmod_wanpipe.2010.vcxproj", "{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_sangoma_boost", "src\ftmod\ftmod_sangoma_boost\ftmod_sangoma_boost.2010.vcxproj", "{D021EF2A-460D-4827-A0F7-41FDECF46F1B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testboost", "msvc\testboost\testboost.2010.vcxproj", "{2B1BAF36-0241-43E7-B865-A8338AD48E2E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsangomaboost", "msvc\testboost\testsangomaboost.2010.vcxproj", "{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_sangoma_isdn", "src\ftmod\ftmod_sangoma_isdn\ftmod_sangoma_isdn.2010.vcxproj", "{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_r2", "src\ftmod\ftmod_r2\ftmod_r2.2010.vcxproj", "{08C3EA27-A51D-47F8-B47D-B189C649CF30}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Debug|x64.Build.0 = Debug|x64
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Release|Win32.Build.0 = Release|Win32
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Release|x64.ActiveCfg = Release|x64
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Release|x64.Build.0 = Release|x64
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Debug|x64.Build.0 = Debug|x64
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Release|Win32.Build.0 = Release|Win32
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Release|x64.ActiveCfg = Release|x64
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Release|x64.Build.0 = Release|x64
|
||||
{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Release|x64.ActiveCfg = Release|x64
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|x64.Build.0 = Debug|x64
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.Build.0 = Release|Win32
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|x64.ActiveCfg = Release|x64
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|x64.Build.0 = Release|x64
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Debug|x64.Build.0 = Debug|x64
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Release|Win32.Build.0 = Release|Win32
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Release|x64.ActiveCfg = Release|x64
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Release|x64.Build.0 = Release|x64
|
||||
{B3F49375-2834-4937-9D8C-4AC2EC911010}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B3F49375-2834-4937-9D8C-4AC2EC911010}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B3F49375-2834-4937-9D8C-4AC2EC911010}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B3F49375-2834-4937-9D8C-4AC2EC911010}.Debug|x64.Build.0 = Debug|x64
|
||||
{B3F49375-2834-4937-9D8C-4AC2EC911010}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B3F49375-2834-4937-9D8C-4AC2EC911010}.Release|Win32.Build.0 = Release|Win32
|
||||
{B3F49375-2834-4937-9D8C-4AC2EC911010}.Release|x64.ActiveCfg = Release|x64
|
||||
{B3F49375-2834-4937-9D8C-4AC2EC911010}.Release|x64.Build.0 = Release|x64
|
||||
{729344A5-D5E9-434D-8EE8-AF8C6C795D15}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{729344A5-D5E9-434D-8EE8-AF8C6C795D15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{729344A5-D5E9-434D-8EE8-AF8C6C795D15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{729344A5-D5E9-434D-8EE8-AF8C6C795D15}.Release|x64.ActiveCfg = Release|x64
|
||||
{E886B4D5-AB4F-4092-B8F4-3B06E1E462EF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E886B4D5-AB4F-4092-B8F4-3B06E1E462EF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E886B4D5-AB4F-4092-B8F4-3B06E1E462EF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E886B4D5-AB4F-4092-B8F4-3B06E1E462EF}.Release|x64.ActiveCfg = Release|x64
|
||||
{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}.Release|x64.ActiveCfg = Release|x64
|
||||
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Debug|x64.Build.0 = Debug|x64
|
||||
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Release|Win32.Build.0 = Release|Win32
|
||||
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Release|x64.ActiveCfg = Release|x64
|
||||
{D021EF2A-460D-4827-A0F7-41FDECF46F1B}.Release|x64.Build.0 = Release|x64
|
||||
{2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Debug|x64.Build.0 = Debug|x64
|
||||
{2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Release|Win32.Build.0 = Release|Win32
|
||||
{2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Release|x64.ActiveCfg = Release|x64
|
||||
{2B1BAF36-0241-43E7-B865-A8338AD48E2E}.Release|x64.Build.0 = Release|x64
|
||||
{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}.Debug|x64.Build.0 = Debug|x64
|
||||
{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}.Release|Win32.Build.0 = Release|Win32
|
||||
{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}.Release|x64.ActiveCfg = Release|x64
|
||||
{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}.Release|x64.Build.0 = Release|x64
|
||||
{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}.Release|Win32.Build.0 = Release|Win32
|
||||
{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}.Release|x64.ActiveCfg = Release|Win32
|
||||
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Release|Win32.Build.0 = Release|Win32
|
||||
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Release|x64.ActiveCfg = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -149,6 +149,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
|
||||
static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
|
||||
static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
|
||||
static const char* channel_get_variable(switch_core_session_t *session, switch_event_t *var_event, const char *variable_name);
|
||||
ftdm_status_t ftdm_channel_from_event(ftdm_sigmsg_t *sigmsg, switch_core_session_t **sp);
|
||||
void dump_chan(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *stream);
|
||||
void dump_chan_xml(ftdm_span_t *span, uint32_t chan_id, switch_stream_handle_t *stream);
|
||||
@@ -425,8 +426,11 @@ static switch_status_t channel_on_routing(switch_core_session_t *session)
|
||||
tech_pvt = switch_core_session_get_private(session);
|
||||
assert(tech_pvt != NULL);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(channel));
|
||||
assert(tech_pvt->ftdmchan != NULL);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(channel));
|
||||
|
||||
ftdm_channel_call_indicate(tech_pvt->ftdmchan, FTDM_CHANNEL_INDICATE_PROCEED);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -837,9 +841,9 @@ static switch_status_t channel_receive_message_b(switch_core_session_t *session,
|
||||
assert(tech_pvt != NULL);
|
||||
|
||||
if (switch_test_flag(tech_pvt, TFLAG_DEAD)) {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_LOSE_RACE);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_LOSE_RACE);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (ftdm_channel_call_check_hangup(tech_pvt->ftdmchan)) {
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -852,7 +856,7 @@ static switch_status_t channel_receive_message_b(switch_core_session_t *session,
|
||||
switch (msg->message_id) {
|
||||
case SWITCH_MESSAGE_INDICATE_RINGING:
|
||||
{
|
||||
ftdm_channel_call_indicate(tech_pvt->ftdmchan, FTDM_CHANNEL_INDICATE_PROGRESS);
|
||||
ftdm_channel_call_indicate(tech_pvt->ftdmchan, FTDM_CHANNEL_INDICATE_RINGING);
|
||||
}
|
||||
break;
|
||||
case SWITCH_MESSAGE_INDICATE_PROGRESS:
|
||||
@@ -884,9 +888,9 @@ static switch_status_t channel_receive_message_fxo(switch_core_session_t *sessio
|
||||
assert(tech_pvt != NULL);
|
||||
|
||||
if (switch_test_flag(tech_pvt, TFLAG_DEAD)) {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_LOSE_RACE);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_LOSE_RACE);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -935,7 +939,7 @@ static switch_status_t channel_receive_message_fxs(switch_core_session_t *sessio
|
||||
!switch_channel_test_flag(channel, CF_EARLY_MEDIA) &&
|
||||
!switch_channel_test_flag(channel, CF_RING_READY)
|
||||
) {
|
||||
ftdm_channel_call_indicate(tech_pvt->ftdmchan, FTDM_CHANNEL_INDICATE_RING);
|
||||
ftdm_channel_call_indicate(tech_pvt->ftdmchan, FTDM_CHANNEL_INDICATE_RINGING);
|
||||
switch_channel_mark_ring_ready(channel);
|
||||
}
|
||||
break;
|
||||
@@ -1046,6 +1050,27 @@ switch_io_routines_t freetdm_io_routines = {
|
||||
/*.receive_message*/ channel_receive_message
|
||||
};
|
||||
|
||||
static const char* channel_get_variable(switch_core_session_t *session, switch_event_t *var_event, const char *variable_name)
|
||||
{
|
||||
const char *variable = NULL;
|
||||
|
||||
if (var_event) {
|
||||
if ((variable = switch_event_get_header(var_event, variable_name))) {
|
||||
return variable;
|
||||
}
|
||||
}
|
||||
if (session) {
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
if ((variable = switch_channel_get_variable(channel, variable_name))) {
|
||||
return variable;
|
||||
}
|
||||
}
|
||||
if ((variable = switch_core_get_variable(variable_name))) {
|
||||
return variable;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
|
||||
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
|
||||
*/
|
||||
@@ -1223,20 +1248,6 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
}
|
||||
}
|
||||
|
||||
if (session) {
|
||||
/* take out some other values from the session if they're present */
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
const char *freetdmvar;
|
||||
freetdmvar = switch_channel_get_variable(channel, "freetdm_bearer_capability");
|
||||
if (freetdmvar) {
|
||||
caller_data.bearer_capability = (uint8_t)atoi(freetdmvar);
|
||||
}
|
||||
freetdmvar = switch_channel_get_variable(channel, "freetdm_bearer_layer1");
|
||||
if (freetdmvar) {
|
||||
caller_data.bearer_layer1 = (uint8_t)atoi(freetdmvar);
|
||||
}
|
||||
}
|
||||
|
||||
if (switch_test_flag(outbound_profile, SWITCH_CPF_SCREEN)) {
|
||||
caller_data.screen = 1;
|
||||
}
|
||||
@@ -1245,29 +1256,37 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
caller_data.pres = 1;
|
||||
}
|
||||
|
||||
if (!zstr(dest)) {
|
||||
ftdm_set_string(caller_data.dnis.digits, dest);
|
||||
if ((var = channel_get_variable(session, var_event, "freetdm_bearer_capability"))) {
|
||||
caller_data.bearer_capability = (uint8_t)atoi(var);
|
||||
}
|
||||
|
||||
if ((var = switch_event_get_header(var_event, "freetdm_outbound_ton")) || (var = switch_core_get_variable("freetdm_outbound_ton"))) {
|
||||
if (!strcasecmp(var, "national")) {
|
||||
caller_data.dnis.type = FTDM_TON_NATIONAL;
|
||||
} else if (!strcasecmp(var, "international")) {
|
||||
caller_data.dnis.type = FTDM_TON_INTERNATIONAL;
|
||||
} else if (!strcasecmp(var, "local")) {
|
||||
caller_data.dnis.type = FTDM_TON_SUBSCRIBER_NUMBER;
|
||||
} else if (!strcasecmp(var, "unknown")) {
|
||||
caller_data.dnis.type = FTDM_TON_UNKNOWN;
|
||||
}
|
||||
if ((var = channel_get_variable(session, var_event, "freetdm_bearer_layer1"))) {
|
||||
caller_data.bearer_layer1 = (uint8_t)atoi(var);
|
||||
}
|
||||
|
||||
if ((var = channel_get_variable(session, var_event, "freetdm_screening_ind"))) {
|
||||
ftdm_set_screening_ind(var, &caller_data.screen);
|
||||
}
|
||||
|
||||
if ((var = channel_get_variable(session, var_event, "freetdm_presentation_ind"))) {
|
||||
ftdm_set_presentation_ind(var, &caller_data.pres);
|
||||
}
|
||||
|
||||
if ((var = channel_get_variable(session, var_event, "freetdm_outbound_ton"))) {
|
||||
ftdm_set_ton(var, &caller_data.dnis.type);
|
||||
} else {
|
||||
caller_data.dnis.type = outbound_profile->destination_number_ton;
|
||||
}
|
||||
|
||||
if ((var = switch_event_get_header(var_event, "freetdm_custom_call_data")) || (var = switch_core_get_variable("freetdm_custom_call_data"))) {
|
||||
if ((var = channel_get_variable(session, var_event, "freetdm_custom_call_data"))) {
|
||||
ftdm_set_string(caller_data.raw_data, var);
|
||||
caller_data.raw_data_len = (uint32_t)strlen(var);
|
||||
}
|
||||
|
||||
if (!zstr(dest)) {
|
||||
ftdm_set_string(caller_data.dnis.digits, dest);
|
||||
}
|
||||
|
||||
caller_data.dnis.plan = outbound_profile->destination_number_numplan;
|
||||
|
||||
/* blindly copy data from outbound_profile. They will be overwritten
|
||||
@@ -2071,6 +2090,9 @@ static FIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
|
||||
switch(sigmsg->event_id) {
|
||||
case FTDM_SIGEVENT_START:
|
||||
{
|
||||
ftdm_channel_add_var(sigmsg->channel, "screening_ind", ftdm_screening2str(caller_data->screen));
|
||||
ftdm_channel_add_var(sigmsg->channel, "presentation_ind", ftdm_presentation2str(caller_data->pres));
|
||||
|
||||
ftdm_enable_channel_dtmf(sigmsg->channel, NULL);
|
||||
return ftdm_channel_from_event(sigmsg, &session);
|
||||
}
|
||||
@@ -2133,7 +2155,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
|
||||
spanid, chanid, (uuid) ? uuid : "N/A");
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case FTDM_SIGEVENT_SIGSTATUS_CHANGED:
|
||||
{
|
||||
ftdm_signaling_status_t sigstatus = sigmsg->raw_data ? *((ftdm_signaling_status_t*)(sigmsg->raw_data)) : sigmsg->sigstatus;
|
||||
@@ -2141,6 +2163,10 @@ static FIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
|
||||
spanid, chanid, ftdm_signaling_status2str(sigstatus));
|
||||
}
|
||||
break;
|
||||
case FTDM_SIGEVENT_PROCEED:
|
||||
case FTDM_SIGEVENT_MSG:
|
||||
/* FS does not have handlers for these messages, so ignore them for now */
|
||||
break;
|
||||
default:
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unhandled msg type %d for channel %d:%d\n",
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>freetdm</ProjectName>
|
||||
<ProjectGuid>{93B8812C-3EC4-4F78-8970-FFBFC99E167D}</ProjectGuid>
|
||||
<RootNamespace>freetdm</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-freetdm.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../src/include;../src/include/private;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FREETDM_EXPORTS;TELETONE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-freetdm.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../src/include;../src/include/private;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FREETDM_EXPORTS;TELETONE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-freetdm.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../src/include;../src/include/private;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FREETDM_EXPORTS;TELETONE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-freetdm.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../src/include;../src/include/private;../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FREETDM_EXPORTS;TELETONE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\include\freetdm.h" />
|
||||
<ClInclude Include="..\src\include\private\fsk.h" />
|
||||
<ClInclude Include="..\src\include\private\ftdm_buffer.h" />
|
||||
<ClInclude Include="..\src\include\private\ftdm_call_utils.h" />
|
||||
<ClInclude Include="..\src\include\private\ftdm_config.h" />
|
||||
<ClInclude Include="..\src\include\private\ftdm_core.h" />
|
||||
<ClInclude Include="..\src\include\ftdm_declare.h" />
|
||||
<ClInclude Include="..\src\include\private\ftdm_dso.h" />
|
||||
<ClInclude Include="..\src\include\ftdm_os.h" />
|
||||
<ClInclude Include="..\src\include\private\ftdm_sched.h" />
|
||||
<ClInclude Include="..\src\include\ftdm_threadmutex.h" />
|
||||
<ClInclude Include="..\src\include\private\ftdm_types.h" />
|
||||
<ClInclude Include="..\src\include\private\g711.h" />
|
||||
<ClInclude Include="..\src\include\private\hashtable.h" />
|
||||
<ClInclude Include="..\src\include\private\hashtable_itr.h" />
|
||||
<ClInclude Include="..\src\include\private\hashtable_private.h" />
|
||||
<ClInclude Include="..\src\include\private\libteletone.h" />
|
||||
<ClInclude Include="..\src\include\private\libteletone_detect.h" />
|
||||
<ClInclude Include="..\src\include\private\libteletone_generate.h" />
|
||||
<ClInclude Include="..\src\include\private\uart.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\fsk.c" />
|
||||
<ClCompile Include="..\src\ftdm_buffer.c" />
|
||||
<ClCompile Include="..\src\ftdm_call_utils.c" />
|
||||
<ClCompile Include="..\src\ftdm_callerid.c" />
|
||||
<ClCompile Include="..\src\ftdm_config.c" />
|
||||
<ClCompile Include="..\src\ftdm_cpu_monitor.c" />
|
||||
<ClCompile Include="..\src\ftdm_dso.c" />
|
||||
<ClCompile Include="..\src\ftdm_io.c" />
|
||||
<ClCompile Include="..\src\ftdm_queue.c" />
|
||||
<ClCompile Include="..\src\ftdm_sched.c" />
|
||||
<ClCompile Include="..\src\ftdm_threadmutex.c" />
|
||||
<ClCompile Include="..\src\g711.c" />
|
||||
<ClCompile Include="..\src\hashtable.c" />
|
||||
<ClCompile Include="..\src\hashtable_itr.c" />
|
||||
<ClCompile Include="..\src\libteletone_detect.c" />
|
||||
<ClCompile Include="..\src\libteletone_generate.c" />
|
||||
<ClCompile Include="..\src\uart.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\include\freetdm.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\fsk.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\ftdm_buffer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\ftdm_call_utils.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\ftdm_config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\ftdm_core.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\ftdm_declare.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\ftdm_dso.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\ftdm_os.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\ftdm_sched.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\ftdm_threadmutex.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\ftdm_types.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\g711.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\hashtable.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\hashtable_itr.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\hashtable_private.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\libteletone.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\libteletone_detect.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\libteletone_generate.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\include\private\uart.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\fsk.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_buffer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_call_utils.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_callerid.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_config.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_cpu_monitor.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_dso.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_io.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_queue.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_sched.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ftdm_threadmutex.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\g711.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\hashtable.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\hashtable_itr.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\libteletone_detect.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\libteletone_generate.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\uart.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,213 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>testanalog</ProjectName>
|
||||
<ProjectGuid>{BB833648-BAFF-4BE2-94DB-F8BB043C588C}</ProjectGuid>
|
||||
<RootNamespace>testanalog</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testanalog.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/include;../../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testanalog.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../src/include;../../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testanalog.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/include;../../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testanalog.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../src/include;../../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\testanalog.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\testanalog.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,218 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>testboost</ProjectName>
|
||||
<ProjectGuid>{2B1BAF36-0241-43E7-B865-A8338AD48E2E}</ProjectGuid>
|
||||
<RootNamespace>testboost</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\testboost\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\testboost\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\testboost\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\testboost\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testboost.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\..\debug\freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testboost.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../src/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testboost.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testboost.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../src/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\testboost.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\testboost.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,218 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>testsangomaboost</ProjectName>
|
||||
<ProjectGuid>{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}</ProjectGuid>
|
||||
<RootNamespace>testsangomaboost</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testsangomaboost.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\..\debug\freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testsangomaboost.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../src/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testsangomaboost.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>false</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testsangomaboost.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../src/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\testsangomaboost.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\testsangomaboost.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,213 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>testisdn</ProjectName>
|
||||
<ProjectGuid>{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}</ProjectGuid>
|
||||
<RootNamespace>testisdn</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testisdn.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/include;../../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testisdn.htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../src/include;../../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testisdn.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/include;../../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog-testisdn.htm</Path>
|
||||
</BuildLog>
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../src/include;../../src/isdn/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\testisdn.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\testisdn.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,82 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openzap", "msvc\openzap.2005.vcproj", "{93B8812C-3EC4-4F78-8970-FFBFC99E167D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testanalog", "msvc\testanalog\testanalog.2005.vcproj", "{BB833648-BAFF-4BE2-94DB-F8BB043C588C}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testisdn", "msvc\testisdn\testisdn.2005.vcproj", "{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_openzap", "mod_openzap\mod_openzap.2005.vcproj", "{FE3540C5-3303-46E0-A69E-D92F775687F1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ozmod_analog", "src\ozmod\ozmod_analog\ozmod_analog.2005.vcproj", "{37C94798-6E33-4B4F-8EE0-C72A7DC91157}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ozmod_analog_em", "src\ozmod\ozmod_analog_em\ozmod_analog_em.2005.vcproj", "{C539D7C8-26A8-4A94-B938-77672165C130}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ozmod_isdn", "src\ozmod\ozmod_isdn\ozmod_isdn.2005.vcproj", "{729344A5-D5E9-434D-8EE8-AF8C6C795D15}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ozmod_wanpipe", "src\ozmod\ozmod_wanpipe\ozmod_wanpipe.2005.vcproj", "{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ozmod_pika", "src\ozmod\ozmod_pika\ozmod_pika.2005.vcproj", "{E886B4D5-AB4F-4092-B8F4-3B06E1E462EF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{93B8812C-3EC4-4F78-8970-FFBFC99E167D}.Release|Win32.Build.0 = Release|Win32
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BB833648-BAFF-4BE2-94DB-F8BB043C588C}.Release|Win32.Build.0 = Release|Win32
|
||||
{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6DA6FD42-641D-4147-92F5-3BC4AAA6589B}.Release|Win32.Build.0 = Release|Win32
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.Build.0 = Release|Win32
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{37C94798-6E33-4B4F-8EE0-C72A7DC91157}.Release|Win32.Build.0 = Release|Win32
|
||||
{C539D7C8-26A8-4A94-B938-77672165C130}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C539D7C8-26A8-4A94-B938-77672165C130}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C539D7C8-26A8-4A94-B938-77672165C130}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C539D7C8-26A8-4A94-B938-77672165C130}.Release|Win32.Build.0 = Release|Win32
|
||||
{729344A5-D5E9-434D-8EE8-AF8C6C795D15}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{729344A5-D5E9-434D-8EE8-AF8C6C795D15}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{729344A5-D5E9-434D-8EE8-AF8C6C795D15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{729344A5-D5E9-434D-8EE8-AF8C6C795D15}.Release|Win32.Build.0 = Release|Win32
|
||||
{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E886B4D5-AB4F-4092-B8F4-3B06E1E462EF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E886B4D5-AB4F-4092-B8F4-3B06E1E462EF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -36,80 +36,101 @@
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_span_set_npi(const char *npi_string, uint8_t *target)
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_npi(const char *string, uint8_t *target)
|
||||
{
|
||||
if (!strcasecmp(npi_string, "isdn") || !strcasecmp(npi_string, "e164")) {
|
||||
*target = FTDM_NPI_ISDN;
|
||||
} else if (!strcasecmp(npi_string, "data")) {
|
||||
*target = FTDM_NPI_DATA;
|
||||
} else if (!strcasecmp(npi_string, "telex")) {
|
||||
*target = FTDM_NPI_TELEX;
|
||||
} else if (!strcasecmp(npi_string, "national")) {
|
||||
*target = FTDM_NPI_NATIONAL;
|
||||
} else if (!strcasecmp(npi_string, "private")) {
|
||||
*target = FTDM_NPI_PRIVATE;
|
||||
} else if (!strcasecmp(npi_string, "reserved")) {
|
||||
*target = FTDM_NPI_RESERVED;
|
||||
} else if (!strcasecmp(npi_string, "unknown")) {
|
||||
*target = FTDM_NPI_UNKNOWN;
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid NPI value (%s)\n", npi_string);
|
||||
*target = FTDM_NPI_UNKNOWN;
|
||||
return FTDM_FAIL;
|
||||
uint8_t val;
|
||||
ftdm_status_t status = FTDM_SUCCESS;
|
||||
|
||||
val = ftdm_str2ftdm_npi(string);
|
||||
if (val == FTDM_NPI_INVALID) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid NPI string (%s)\n", string);
|
||||
status = FTDM_FAIL;
|
||||
val = FTDM_NPI_UNKNOWN;
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
*target = val;
|
||||
return status;
|
||||
}
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_span_set_ton(const char *ton_string, uint8_t *target)
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_ton(const char *string, uint8_t *target)
|
||||
{
|
||||
if (!strcasecmp(ton_string, "national")) {
|
||||
*target = FTDM_TON_NATIONAL;
|
||||
} else if (!strcasecmp(ton_string, "international")) {
|
||||
*target = FTDM_TON_INTERNATIONAL;
|
||||
} else if (!strcasecmp(ton_string, "local")) {
|
||||
*target = FTDM_TON_SUBSCRIBER_NUMBER;
|
||||
} else if (!strcasecmp(ton_string, "unknown")) {
|
||||
*target = FTDM_TON_UNKNOWN;
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid TON value (%s)\n", ton_string);
|
||||
*target = FTDM_TON_UNKNOWN;
|
||||
return FTDM_FAIL;
|
||||
uint8_t val;
|
||||
ftdm_status_t status = FTDM_SUCCESS;
|
||||
|
||||
val = ftdm_str2ftdm_ton(string);
|
||||
if (val == FTDM_TON_INVALID) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid TON string (%s)\n", string);
|
||||
status = FTDM_FAIL;
|
||||
val = FTDM_TON_UNKNOWN;
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
*target = val;
|
||||
return status;
|
||||
}
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_span_set_bearer_capability(const char *bc_string, ftdm_bearer_cap_t *target)
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_bearer_capability(const char *string, uint8_t *target)
|
||||
{
|
||||
if (!strcasecmp(bc_string, "speech")) {
|
||||
*target = FTDM_BEARER_CAP_SPEECH;
|
||||
} else if (!strcasecmp(bc_string, "unrestricted-digital")) {
|
||||
*target = FTDM_BEARER_CAP_64K_UNRESTRICTED;
|
||||
} else if (!strcasecmp(bc_string, "3.1Khz")) {
|
||||
*target = FTDM_BEARER_CAP_3_1KHZ_AUDIO;
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Unsupported Bearer Capability value (%s)\n", bc_string);
|
||||
return FTDM_FAIL;
|
||||
uint8_t val;
|
||||
ftdm_status_t status = FTDM_SUCCESS;
|
||||
|
||||
val = ftdm_str2ftdm_bearer_cap(string);
|
||||
if (val == FTDM_NPI_INVALID) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid Bearer-Capability string (%s)\n", string);
|
||||
status = FTDM_FAIL;
|
||||
val = FTDM_BEARER_CAP_SPEECH;
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
|
||||
*target = val;
|
||||
return status;
|
||||
}
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_span_set_bearer_layer1(const char *bc_string, ftdm_user_layer1_prot_t *target)
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_bearer_layer1(const char *string, uint8_t *target)
|
||||
{
|
||||
if (!strcasecmp(bc_string, "v110")) {
|
||||
*target = FTDM_USER_LAYER1_PROT_V110;
|
||||
} else if (!strcasecmp(bc_string, "ulaw")) {
|
||||
*target = FTDM_USER_LAYER1_PROT_ULAW;
|
||||
} else if (!strcasecmp(bc_string, "alaw")) {
|
||||
*target =FTDM_USER_LAYER1_PROT_ALAW ;
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Unsupported Bearer Layer1 Prot value (%s)\n", bc_string);
|
||||
return FTDM_FAIL;
|
||||
uint8_t val;
|
||||
ftdm_status_t status = FTDM_SUCCESS;
|
||||
|
||||
val = ftdm_str2ftdm_usr_layer1_prot(string);
|
||||
if (val == FTDM_USER_LAYER1_PROT_INVALID) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid Bearer Layer 1 Protocol string (%s)\n", string);
|
||||
status = FTDM_FAIL;
|
||||
val = FTDM_USER_LAYER1_PROT_ULAW;
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
|
||||
*target = val;
|
||||
return status;
|
||||
}
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_screening_ind(const char *string, uint8_t *target)
|
||||
{
|
||||
uint8_t val;
|
||||
ftdm_status_t status = FTDM_SUCCESS;
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_is_number(char *number)
|
||||
val = ftdm_str2ftdm_screening(string);
|
||||
if (val == FTDM_SCREENING_INVALID) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid screening indicator string (%s)\n", string);
|
||||
status = FTDM_FAIL;
|
||||
val = FTDM_SCREENING_NOT_SCREENED;
|
||||
}
|
||||
|
||||
*target = val;
|
||||
return status;
|
||||
}
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_presentation_ind(const char *string, uint8_t *target)
|
||||
{
|
||||
uint8_t val;
|
||||
ftdm_status_t status = FTDM_SUCCESS;
|
||||
|
||||
val = ftdm_str2ftdm_presentation(string);
|
||||
if (val == FTDM_PRES_INVALID) {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid presentation string (%s)\n", string);
|
||||
status = FTDM_FAIL;
|
||||
val = FTDM_PRES_ALLOWED;
|
||||
}
|
||||
|
||||
*target = val;
|
||||
return status;
|
||||
}
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_is_number(const char *number)
|
||||
{
|
||||
if (!number) {
|
||||
return FTDM_FAIL;
|
||||
|
||||
+44
-18
@@ -38,8 +38,6 @@
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#ifndef WIN32
|
||||
#endif
|
||||
#include "private/ftdm_core.h"
|
||||
#include <stdarg.h>
|
||||
#ifdef WIN32
|
||||
@@ -150,6 +148,24 @@ FTDM_STR2ENUM(ftdm_str2ftdm_chan_type, ftdm_chan_type2str, ftdm_chan_type_t, CHA
|
||||
FTDM_ENUM_NAMES(SIGNALING_STATUS_NAMES, SIGSTATUS_STRINGS)
|
||||
FTDM_STR2ENUM(ftdm_str2ftdm_signaling_status, ftdm_signaling_status2str, ftdm_signaling_status_t, SIGNALING_STATUS_NAMES, FTDM_SIG_STATE_INVALID)
|
||||
|
||||
FTDM_ENUM_NAMES(TON_NAMES, TON_STRINGS)
|
||||
FTDM_STR2ENUM(ftdm_str2ftdm_ton, ftdm_ton2str, ftdm_ton_t, TON_NAMES, FTDM_TON_INVALID)
|
||||
|
||||
FTDM_ENUM_NAMES(NPI_NAMES, NPI_STRINGS)
|
||||
FTDM_STR2ENUM(ftdm_str2ftdm_npi, ftdm_npi2str, ftdm_npi_t, NPI_NAMES, FTDM_NPI_INVALID)
|
||||
|
||||
FTDM_ENUM_NAMES(PRESENTATION_NAMES, PRESENTATION_STRINGS)
|
||||
FTDM_STR2ENUM(ftdm_str2ftdm_presentation, ftdm_presentation2str, ftdm_presentation_t, PRESENTATION_NAMES, FTDM_PRES_INVALID)
|
||||
|
||||
FTDM_ENUM_NAMES(SCREENING_NAMES, SCREENING_STRINGS)
|
||||
FTDM_STR2ENUM(ftdm_str2ftdm_screening, ftdm_screening2str, ftdm_screening_t, SCREENING_NAMES, FTDM_SCREENING_INVALID)
|
||||
|
||||
FTDM_ENUM_NAMES(BEARER_CAP_NAMES, BEARER_CAP_STRINGS)
|
||||
FTDM_STR2ENUM(ftdm_str2ftdm_bearer_cap, ftdm_bearer_cap2str, ftdm_bearer_cap_t, BEARER_CAP_NAMES, FTDM_BEARER_CAP_INVALID)
|
||||
|
||||
FTDM_ENUM_NAMES(USER_LAYER1_PROT_NAMES, USER_LAYER1_PROT_STRINGS)
|
||||
FTDM_STR2ENUM(ftdm_str2ftdm_usr_layer1_prot, ftdm_user_layer1_prot2str, ftdm_user_layer1_prot_t, USER_LAYER1_PROT_NAMES, FTDM_USER_LAYER1_PROT_INVALID)
|
||||
|
||||
static ftdm_status_t ftdm_group_add_channels(ftdm_span_t* span, int currindex, const char* name);
|
||||
|
||||
static const char *cut_path(const char *in)
|
||||
@@ -2078,6 +2094,10 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_answer(const char *file, const char
|
||||
goto done;
|
||||
}
|
||||
|
||||
#ifndef FREETDM_SKIP_SIG_STATES
|
||||
/* We will fail RFC's if we not skip states, but some modules apart from ftmod_sangoma_isdn
|
||||
* expect the call to always to go PROGRESS and PROGRESS MEDIA state before going to UP, so
|
||||
* remove this only in netborder branch for now while we update the sig modules */
|
||||
|
||||
if (ftdmchan->state < FTDM_CHANNEL_STATE_PROGRESS) {
|
||||
ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_PROGRESS, 1);
|
||||
@@ -2098,7 +2118,7 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_answer(const char *file, const char
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Ignoring answer because the call has moved to TERMINATING while we're moving to UP\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
#endif
|
||||
ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_UP, 1);
|
||||
|
||||
done:
|
||||
@@ -2247,14 +2267,19 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_indicate(const char *file, const ch
|
||||
switch (indication) {
|
||||
/* FIXME: ring and busy cannot be used with all signaling stacks
|
||||
* (particularly isdn stacks I think, we should emulate or just move to hangup with busy cause) */
|
||||
case FTDM_CHANNEL_INDICATE_RING:
|
||||
ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_RING, 1);
|
||||
case FTDM_CHANNEL_INDICATE_RINGING:
|
||||
ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_RINGING, 1);
|
||||
break;
|
||||
|
||||
case FTDM_CHANNEL_INDICATE_BUSY:
|
||||
ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_BUSY, 1);
|
||||
break;
|
||||
|
||||
case FTDM_CHANNEL_INDICATE_PROCEED:
|
||||
if (ftdm_test_flag(ftdmchan->span, FTDM_SPAN_USE_PROCEED_STATE)) {
|
||||
if (ftdmchan->state == FTDM_CHANNEL_STATE_RING) {
|
||||
ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_PROCEED, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_INDICATE_PROGRESS:
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
ftdm_set_flag(ftdmchan, FTDM_CHANNEL_PROGRESS);
|
||||
@@ -2262,7 +2287,6 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_indicate(const char *file, const ch
|
||||
ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_PROGRESS, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case FTDM_CHANNEL_INDICATE_PROGRESS_MEDIA:
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
ftdm_set_flag(ftdmchan, FTDM_CHANNEL_PROGRESS);
|
||||
@@ -2281,7 +2305,6 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_indicate(const char *file, const ch
|
||||
ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ftdm_log(file, func, line, FTDM_LOG_LEVEL_WARNING, "Do not know how to indicate %d\n", indication);
|
||||
status = FTDM_FAIL;
|
||||
@@ -2318,6 +2341,8 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_place(const char *file, const char
|
||||
UNREFERENCED_PARAMETER(line);
|
||||
#endif
|
||||
|
||||
ftdm_wait_for_flag_cleared(ftdmchan, FTDM_CHANNEL_STATE_CHANGE, 100);
|
||||
|
||||
ftdm_channel_unlock(ftdmchan);
|
||||
|
||||
return status;
|
||||
@@ -2866,16 +2891,17 @@ done:
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_channel_wait(ftdm_channel_t *ftdmchan, ftdm_wait_flag_t *flags, int32_t to)
|
||||
{
|
||||
assert(ftdmchan != NULL);
|
||||
assert(ftdmchan->fio != NULL);
|
||||
ftdm_status_t status = FTDM_FAIL;
|
||||
ftdm_assert_return(ftdmchan != NULL, FTDM_FAIL, "Null channel\n");
|
||||
ftdm_assert_return(ftdmchan->fio != NULL, FTDM_FAIL, "Null io interface\n");
|
||||
ftdm_assert_return(ftdmchan->fio->wait != NULL, FTDM_NOTIMPL, "wait method not implemented\n");
|
||||
|
||||
if (!ftdmchan->fio->wait) {
|
||||
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "method not implemented");
|
||||
return FTDM_FAIL;
|
||||
status = ftdmchan->fio->wait(ftdmchan, flags, to);
|
||||
if (status == FTDM_TIMEOUT) {
|
||||
/* make sure the flags are cleared on timeout */
|
||||
*flags = 0;
|
||||
}
|
||||
|
||||
return ftdmchan->fio->wait(ftdmchan, flags, to);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/*******************************/
|
||||
@@ -4860,7 +4886,7 @@ FT_DECLARE(ftdm_status_t) ftdm_span_send_signal(ftdm_span_t *span, ftdm_sigmsg_t
|
||||
if (sigmsg->channel) {
|
||||
ftdm_mutex_lock(sigmsg->channel->mutex);
|
||||
}
|
||||
|
||||
|
||||
/* some core things to do on special events */
|
||||
switch (sigmsg->event_id) {
|
||||
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>ftmod_analog</ProjectName>
|
||||
<ProjectGuid>{37C94798-6E33-4B4F-8EE0-C72A7DC91157}</ProjectGuid>
|
||||
<RootNamespace>ftmod_analog</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>false</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_analog.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftdm_analog.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\msvc\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_analog.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftdm_analog.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -438,7 +438,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
||||
{
|
||||
if (state_counter > 5000 || !ftdm_test_flag(ftdmchan, FTDM_CHANNEL_CALLERID_DETECT)) {
|
||||
ftdm_channel_command(ftdmchan, FTDM_COMMAND_DISABLE_CALLERID_DETECT, NULL);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_IDLE);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_RING);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -492,8 +492,8 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
||||
}
|
||||
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OFFHOOK) &&
|
||||
(ftdmchan->last_state == FTDM_CHANNEL_STATE_RING || ftdmchan->last_state == FTDM_CHANNEL_STATE_DIALTONE
|
||||
|| ftdmchan->last_state >= FTDM_CHANNEL_STATE_IDLE)) {
|
||||
(ftdmchan->last_state == FTDM_CHANNEL_STATE_RINGING || ftdmchan->last_state == FTDM_CHANNEL_STATE_DIALTONE
|
||||
|| ftdmchan->last_state >= FTDM_CHANNEL_STATE_RING)) {
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
|
||||
} else {
|
||||
ftdmchan->caller_data.hangup_cause = FTDM_CAUSE_NORMAL_CLEARING;
|
||||
@@ -535,7 +535,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
||||
}
|
||||
}
|
||||
case FTDM_CHANNEL_STATE_UP:
|
||||
case FTDM_CHANNEL_STATE_IDLE:
|
||||
case FTDM_CHANNEL_STATE_RING:
|
||||
{
|
||||
ftdm_sleep(interval);
|
||||
continue;
|
||||
@@ -599,7 +599,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
||||
ftdm_channel_use(ftdmchan);
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_IDLE:
|
||||
case FTDM_CHANNEL_STATE_RING:
|
||||
{
|
||||
ftdm_channel_use(ftdmchan);
|
||||
sig.event_id = FTDM_SIGEVENT_START;
|
||||
@@ -669,7 +669,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_RING:
|
||||
case FTDM_CHANNEL_STATE_RINGING:
|
||||
{
|
||||
ftdm_buffer_zero(dt_buffer);
|
||||
teletone_run(&ts, ftdmchan->span->tone_map[FTDM_TONEMAP_RING]);
|
||||
@@ -732,7 +732,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
||||
|
||||
if (last_digit && (!collecting || ((elapsed - last_digit > analog_data->digit_timeout) || strlen(dtmf) >= analog_data->max_dialstr))) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Number obtained [%s]\n", dtmf);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_IDLE);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_RING);
|
||||
last_digit = 0;
|
||||
collecting = 0;
|
||||
}
|
||||
@@ -890,7 +890,7 @@ static __inline__ ftdm_status_t process_event(ftdm_span_t *span, ftdm_event_t *e
|
||||
if (ftdm_test_flag(analog_data, FTDM_ANALOG_CALLERID)) {
|
||||
ftdm_set_state_locked(event->channel, FTDM_CHANNEL_STATE_GET_CALLERID);
|
||||
} else {
|
||||
ftdm_set_state_locked(event->channel, FTDM_CHANNEL_STATE_IDLE);
|
||||
ftdm_set_state_locked(event->channel, FTDM_CHANNEL_STATE_RING);
|
||||
}
|
||||
event->channel->ring_count = 1;
|
||||
ftdm_mutex_unlock(event->channel->mutex);
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="ftmod_analog"
|
||||
ProjectGUID="{37C94798-6E33-4B4F-8EE0-C72A7DC91157}"
|
||||
RootNamespace="ftmod_analog"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\isdn\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="4"
|
||||
DisableSpecificWarnings="4100"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\isdn\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EXPORTS"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4100"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="ftmod_analog.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="ftdm_analog.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,198 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>ftmod_analog_em</ProjectName>
|
||||
<ProjectGuid>{B3F49375-2834-4937-9D8C-4AC2EC911010}</ProjectGuid>
|
||||
<RootNamespace>ftmod_analog_em</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>false</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_analog_em.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftdm_analog_em.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\msvc\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_analog_em.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftdm_analog_em.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,202 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="ftmod_analog_em"
|
||||
ProjectGUID="{C539D7C8-26A8-4A94-B938-77672165C130}"
|
||||
RootNamespace="ftmod_analog_em"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\isdn\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EM_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="4"
|
||||
DisableSpecificWarnings="4100"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\isdn\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_ANALOG_EM_EXPORTS"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4100"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="ftmod_analog_em.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="ftdm_analog_em.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,223 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>ftmod_isdn</ProjectName>
|
||||
<ProjectGuid>{729344A5-D5E9-434D-8EE8-AF8C6C795D15}</ProjectGuid>
|
||||
<RootNamespace>ftmod_isdn</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\isdn\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_ISDN_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\isdn\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_ISDN_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\isdn\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_ISDN_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\isdn\include;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_ISDN_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\isdn\5ESSmes.c" />
|
||||
<ClCompile Include="..\..\isdn\5ESSStateNT.c" />
|
||||
<ClCompile Include="..\..\isdn\5ESSStateTE.c" />
|
||||
<ClCompile Include="..\..\isdn\DMSmes.c" />
|
||||
<ClCompile Include="..\..\isdn\DMSStateNT.c" />
|
||||
<ClCompile Include="..\..\isdn\DMSStateTE.c" />
|
||||
<ClCompile Include="..\..\isdn\EuroISDNStateNT.c" />
|
||||
<ClCompile Include="..\..\isdn\EuroISDNStateTE.c" />
|
||||
<ClCompile Include="..\..\isdn\mfifo.c" />
|
||||
<ClCompile Include="..\..\isdn\nationalmes.c" />
|
||||
<ClCompile Include="..\..\isdn\nationalStateNT.c" />
|
||||
<ClCompile Include="..\..\isdn\nationalStateTE.c" />
|
||||
<ClCompile Include="ftmod_isdn.c" />
|
||||
<ClCompile Include="..\..\isdn\Q921.c" />
|
||||
<ClCompile Include="..\..\isdn\Q931.c" />
|
||||
<ClCompile Include="..\..\isdn\Q931api.c" />
|
||||
<ClCompile Include="..\..\isdn\Q931ie.c" />
|
||||
<ClCompile Include="..\..\isdn\Q931mes.c" />
|
||||
<ClCompile Include="..\..\isdn\Q931StateNT.c" />
|
||||
<ClCompile Include="..\..\isdn\Q931StateTE.c" />
|
||||
<ClCompile Include="..\..\isdn\Q932mes.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\isdn\include\5ESS.h" />
|
||||
<ClInclude Include="..\..\isdn\include\DMS.h" />
|
||||
<ClInclude Include="..\..\isdn\include\mfifo.h" />
|
||||
<ClInclude Include="..\..\isdn\include\national.h" />
|
||||
<ClInclude Include="..\..\isdn\include\Q921.h" />
|
||||
<ClInclude Include="..\..\isdn\include\Q921priv.h" />
|
||||
<ClInclude Include="..\..\isdn\include\Q931.h" />
|
||||
<ClInclude Include="..\..\isdn\include\Q931ie.h" />
|
||||
<ClInclude Include="..\..\isdn\include\Q932.h" />
|
||||
<ClInclude Include="ftdm_isdn.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\msvc\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\isdn\5ESSmes.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\5ESSStateNT.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\5ESSStateTE.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\DMSmes.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\DMSStateNT.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\DMSStateTE.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\EuroISDNStateNT.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\EuroISDNStateTE.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\mfifo.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\nationalmes.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\nationalStateNT.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\nationalStateTE.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_isdn.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\Q921.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\Q931.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\Q931api.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\Q931ie.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\Q931mes.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\Q931StateNT.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\Q931StateTE.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\isdn\Q932mes.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\isdn\include\5ESS.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\isdn\include\DMS.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\isdn\include\mfifo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\isdn\include\national.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\isdn\include\Q921.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\isdn\include\Q921priv.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\isdn\include\Q931.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\isdn\include\Q931ie.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\isdn\include\Q932.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ftdm_isdn.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -462,7 +462,7 @@ static ftdm_state_map_t isdn_state_map = {
|
||||
ZSD_INBOUND,
|
||||
ZSM_UNACCEPTABLE,
|
||||
{FTDM_CHANNEL_STATE_RING, FTDM_END},
|
||||
{FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_PROGRESS, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_CHANNEL_STATE_UP, FTDM_END}
|
||||
{FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_RINGING, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_CHANNEL_STATE_UP, FTDM_END}
|
||||
},
|
||||
{
|
||||
ZSD_INBOUND,
|
||||
@@ -479,7 +479,7 @@ static ftdm_state_map_t isdn_state_map = {
|
||||
{
|
||||
ZSD_INBOUND,
|
||||
ZSM_UNACCEPTABLE,
|
||||
{FTDM_CHANNEL_STATE_PROGRESS, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_END},
|
||||
{FTDM_CHANNEL_STATE_RINGING, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_END},
|
||||
{FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_PROGRESS_MEDIA,
|
||||
FTDM_CHANNEL_STATE_CANCEL, FTDM_CHANNEL_STATE_UP, FTDM_END},
|
||||
},
|
||||
@@ -495,6 +495,7 @@ static ftdm_state_map_t isdn_state_map = {
|
||||
/**
|
||||
* \brief Handler for channel state change
|
||||
* \param ftdmchan Channel to handle
|
||||
* \note This function MUST be called with the channel locked
|
||||
*/
|
||||
static __inline__ void state_advance(ftdm_channel_t *chan)
|
||||
{
|
||||
@@ -536,6 +537,8 @@ static __inline__ void state_advance(ftdm_channel_t *chan)
|
||||
break;
|
||||
|
||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||
/* RINGING is an alias for PROGRESS state in inbound calls ATM */
|
||||
case FTDM_CHANNEL_STATE_RINGING:
|
||||
{
|
||||
if (ftdm_test_flag(chan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
sig.event_id = FTDM_SIGEVENT_PROGRESS;
|
||||
@@ -727,15 +730,13 @@ static __inline__ void check_state(ftdm_span_t *span)
|
||||
for (j = 1; j <= ftdm_span_get_chan_count(span); j++) {
|
||||
ftdm_channel_t *chan = ftdm_span_get_channel(span, j);
|
||||
|
||||
if (ftdm_test_flag(chan, FTDM_CHANNEL_STATE_CHANGE)) {
|
||||
ftdm_channel_lock(chan);
|
||||
|
||||
ftdm_channel_lock(chan);
|
||||
while (ftdm_test_flag(chan, FTDM_CHANNEL_STATE_CHANGE)) {
|
||||
ftdm_clear_flag(chan, FTDM_CHANNEL_STATE_CHANGE);
|
||||
state_advance(chan);
|
||||
ftdm_channel_complete_state(chan);
|
||||
|
||||
ftdm_channel_unlock(chan);
|
||||
}
|
||||
ftdm_channel_unlock(chan);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -991,7 +992,16 @@ static int on_ring(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event
|
||||
|
||||
if (!chan) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "-- Unable to get channel %d:%d\n", ftdm_span_get_id(span), pevent->ring.channel);
|
||||
goto done;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ftdm_channel_lock(chan);
|
||||
|
||||
if (chan->call_data) {
|
||||
/* we could drop the incoming call, but most likely the pointer is just a ghost of the past,
|
||||
* this check is just to detect potentially unreleased pointers */
|
||||
ftdm_log_chan(chan, FTDM_LOG_ERROR, "channel already has call %p!\n", chan->call_data);
|
||||
chan->call_data = NULL;
|
||||
}
|
||||
|
||||
if (ftdm_channel_get_state(chan) != FTDM_CHANNEL_STATE_DOWN || ftdm_test_flag(chan, FTDM_CHANNEL_INUSE)) {
|
||||
@@ -1051,9 +1061,10 @@ static int on_ring(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event
|
||||
/* hurr, this is valid as along as nobody releases the call */
|
||||
chan->call_data = pevent->ring.call;
|
||||
|
||||
ftdm_set_state_locked(chan, FTDM_CHANNEL_STATE_RING);
|
||||
ftdm_set_state(chan, FTDM_CHANNEL_STATE_RING);
|
||||
|
||||
done:
|
||||
ftdm_channel_unlock(chan);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>ftmod_pika</ProjectName>
|
||||
<ProjectGuid>{E886B4D5-AB4F-4092-B8F4-3B06E1E462EF}</ProjectGuid>
|
||||
<RootNamespace>ftmod_pika</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\isdn\include;..\..\include;..\..\..\pika\aoh\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_PIKA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pikahmpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\..\pika\aoh\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\isdn\include;..\..\include;..\..\..\pika\aoh\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_PIKA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pikahmpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\..\pika\aoh\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\isdn\include;..\..\include;..\..\..\pika\aoh\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_PIKA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pikahmpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\..\pika\aoh\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\isdn\include;..\..\include;..\..\..\pika\aoh\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_PIKA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pikahmpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\..\pika\aoh\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_pika.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftdm_pika.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\msvc\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_pika.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftdm_pika.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>ftmod_r2</ProjectName>
|
||||
<ProjectGuid>{08C3EA27-A51D-47F8-B47D-B189C649CF30}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;c:\Program Files\openr2\include\openr2;C:\Program Files\openr2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_R2_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;openr2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\openr2\lib;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\include;C:\Program Files\openr2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_R2_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_r2.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_r2.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -58,7 +58,7 @@ typedef struct ftdm_sangoma_boost_trunkgroup {
|
||||
ftdm_size_t size; /* Number of b-channels in group */
|
||||
unsigned int last_used_index; /* index of last b-channel used */
|
||||
ftdm_channel_t* ftdmchans[MAX_CHANS_PER_TRUNKGROUP];
|
||||
//DAVIDY need to merge congestion timeouts to this struct
|
||||
//TODO need to merge congestion timeouts to this struct
|
||||
} ftdm_sangoma_boost_trunkgroup_t;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>ftmod_sangoma_boost</ProjectName>
|
||||
<ProjectGuid>{D021EF2A-460D-4827-A0F7-41FDECF46F1B}</ProjectGuid>
|
||||
<RootNamespace>ftmod_sangoma_boost</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_SANGOMA_BOOST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_SANGOMA_BOOST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\isdn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_SANGOMA_BOOST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_SANGOMA_BOOST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_sangoma_boost.c" />
|
||||
<ClCompile Include="sangoma_boost_client.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftdm_sangoma_boost.h" />
|
||||
<ClInclude Include="sangoma_boost_client.h" />
|
||||
<ClInclude Include="sangoma_boost_interface.h" />
|
||||
<ClInclude Include="sigboost.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\msvc\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_sangoma_boost.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="sangoma_boost_client.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftdm_sangoma_boost.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="sangoma_boost_client.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="sangoma_boost_interface.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="sigboost.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -55,7 +55,7 @@ ftdm_mutex_t *g_boost_modules_mutex = NULL;
|
||||
ftdm_hash_t *g_boost_modules_hash = NULL;
|
||||
|
||||
#define MAX_TRUNK_GROUPS 64
|
||||
//DAVIDY need to merge congestion_timeouts with ftdm_sangoma_boost_trunkgroups
|
||||
//TODO need to merge congestion_timeouts with ftdm_sangoma_boost_trunkgroups
|
||||
static time_t congestion_timeouts[MAX_TRUNK_GROUPS];
|
||||
|
||||
static ftdm_sangoma_boost_trunkgroup_t *g_trunkgroups[MAX_TRUNK_GROUPS];
|
||||
@@ -2582,17 +2582,17 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_sangoma_boost_configure_span)
|
||||
} else if (!strcasecmp(var, "remote_port")) {
|
||||
remote_port = atoi(val);
|
||||
} else if (!strcasecmp(var, "outbound-called-ton")) {
|
||||
ftdm_span_set_ton(val, &span->default_caller_data.dnis.type);
|
||||
ftdm_set_ton(val, &span->default_caller_data.dnis.type);
|
||||
} else if (!strcasecmp(var, "outbound-called-npi")) {
|
||||
ftdm_span_set_npi(val, &span->default_caller_data.dnis.plan);
|
||||
ftdm_set_npi(val, &span->default_caller_data.dnis.plan);
|
||||
} else if (!strcasecmp(var, "outbound-calling-ton")) {
|
||||
ftdm_span_set_ton(val, &span->default_caller_data.cid_num.type);
|
||||
ftdm_set_ton(val, &span->default_caller_data.cid_num.type);
|
||||
} else if (!strcasecmp(var, "outbound-calling-npi")) {
|
||||
ftdm_span_set_npi(val, &span->default_caller_data.cid_num.plan);
|
||||
ftdm_set_npi(val, &span->default_caller_data.cid_num.plan);
|
||||
} else if (!strcasecmp(var, "outbound-rdnis-ton")) {
|
||||
ftdm_span_set_ton(val, &span->default_caller_data.rdnis.type);
|
||||
ftdm_set_ton(val, &span->default_caller_data.rdnis.type);
|
||||
} else if (!strcasecmp(var, "outbound-rdnis-npi")) {
|
||||
ftdm_span_set_npi(val, &span->default_caller_data.rdnis.plan);
|
||||
ftdm_set_npi(val, &span->default_caller_data.rdnis.plan);
|
||||
} else if (!sigmod) {
|
||||
snprintf(span->last_error, sizeof(span->last_error), "Unknown parameter [%s]", var);
|
||||
FAIL_CONFIG_RETURN(FTDM_FAIL);
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>ftmod_sangoma_isdn</ProjectName>
|
||||
<ProjectGuid>{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}</ProjectGuid>
|
||||
<RootNamespace>ftmod_sangoma_isdn</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\libsng_isdn\include;C:\Program Files\libsng_isdn\include\sng_isdn;../../include;C:\Program Files\Sangoma\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;libsng_isdn.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);C:\Program Files\libsng_isdn\lib;C:\Program Files\Sangoma\api\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftmod_sangoma_isdn.h" />
|
||||
<ClInclude Include="ftmod_sangoma_isdn_trace.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_sangoma_isdn.c" />
|
||||
<ClCompile Include="ftmod_sangoma_isdn_cfg.c" />
|
||||
<ClCompile Include="ftmod_sangoma_isdn_cntrl.c" />
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_cfg.c" />
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_cntrl.c" />
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_hndl.c" />
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_out.c" />
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_rcv.c" />
|
||||
<ClCompile Include="ftmod_sangoma_isdn_support.c" />
|
||||
<ClCompile Include="ftmod_sangoma_isdn_trace.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\msvc\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ftmod_sangoma_isdn.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ftmod_sangoma_isdn_trace.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_sangoma_isdn.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_sangoma_isdn_cfg.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_sangoma_isdn_cntrl.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_cfg.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_cntrl.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_hndl.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_out.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_sangoma_isdn_stack_rcv.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_sangoma_isdn_support.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ftmod_sangoma_isdn_trace.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -40,8 +40,8 @@
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
static void *ftdm_sangoma_isdn_run(ftdm_thread_t *me, void *obj);
|
||||
|
||||
static void *ftdm_sangoma_isdn_run(ftdm_thread_t *me, void *obj);
|
||||
static ftdm_status_t ftdm_sangoma_isdn_stop(ftdm_span_t *span);
|
||||
static ftdm_status_t ftdm_sangoma_isdn_start(ftdm_span_t *span);
|
||||
|
||||
@@ -115,7 +115,20 @@ ftdm_state_map_t sangoma_isdn_state_map = {
|
||||
ZSD_INBOUND,
|
||||
ZSM_UNACCEPTABLE,
|
||||
{FTDM_CHANNEL_STATE_RING, FTDM_END},
|
||||
{FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_PROGRESS, FTDM_END}
|
||||
{FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_PROCEED, FTDM_CHANNEL_STATE_RINGING, FTDM_CHANNEL_STATE_PROGRESS, FTDM_END}
|
||||
},
|
||||
{
|
||||
ZSD_INBOUND,
|
||||
ZSM_UNACCEPTABLE,
|
||||
{FTDM_CHANNEL_STATE_PROCEED, FTDM_END},
|
||||
{FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_RINGING, FTDM_CHANNEL_STATE_PROGRESS, FTDM_CHANNEL_STATE_PROGRESS_MEDIA,
|
||||
FTDM_CHANNEL_STATE_UP, FTDM_END}
|
||||
},
|
||||
{
|
||||
ZSD_INBOUND,
|
||||
ZSM_UNACCEPTABLE,
|
||||
{FTDM_CHANNEL_STATE_RINGING, FTDM_END},
|
||||
{FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_PROGRESS, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_CHANNEL_STATE_UP, FTDM_END},
|
||||
},
|
||||
{
|
||||
ZSD_INBOUND,
|
||||
@@ -189,9 +202,17 @@ ftdm_state_map_t sangoma_isdn_state_map = {
|
||||
ZSD_OUTBOUND,
|
||||
ZSM_UNACCEPTABLE,
|
||||
{FTDM_CHANNEL_STATE_DIALING, FTDM_END},
|
||||
{FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_PROGRESS,
|
||||
FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_CHANNEL_STATE_UP, FTDM_CHANNEL_STATE_DOWN, FTDM_END}
|
||||
{FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_HANGUP,
|
||||
FTDM_CHANNEL_STATE_PROCEED, FTDM_CHANNEL_STATE_PROGRESS, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_CHANNEL_STATE_UP,
|
||||
FTDM_CHANNEL_STATE_DOWN, FTDM_END}
|
||||
},
|
||||
{
|
||||
ZSD_OUTBOUND,
|
||||
ZSM_UNACCEPTABLE,
|
||||
{FTDM_CHANNEL_STATE_PROCEED, FTDM_END},
|
||||
{FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_HANGUP,
|
||||
FTDM_CHANNEL_STATE_PROGRESS, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_CHANNEL_STATE_UP, FTDM_END},
|
||||
},
|
||||
{
|
||||
ZSD_OUTBOUND,
|
||||
ZSM_UNACCEPTABLE,
|
||||
@@ -604,13 +625,15 @@ static void ftdm_sangoma_isdn_process_state_change(ftdm_channel_t *ftdmchan)
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_GET_CALLERID:
|
||||
{
|
||||
sngisdn_set_flag(sngisdn_info, FLAG_SENT_PROCEED);
|
||||
sngisdn_snd_proceed(ftdmchan);
|
||||
if (!sngisdn_test_flag(sngisdn_info, FLAG_SENT_PROCEED)) {
|
||||
sngisdn_set_flag(sngisdn_info, FLAG_SENT_PROCEED);
|
||||
sngisdn_snd_proceed(ftdmchan);
|
||||
}
|
||||
/* Wait in this state until we get FACILITY msg */
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_RING: /* incoming call request */
|
||||
{
|
||||
{
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Sending incoming call from %s to %s to FTDM core\n", ftdmchan->caller_data.ani.digits, ftdmchan->caller_data.dnis.digits);
|
||||
|
||||
/* we have enough information to inform FTDM of the call*/
|
||||
@@ -635,6 +658,26 @@ static void ftdm_sangoma_isdn_process_state_change(ftdm_channel_t *ftdmchan)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_PROCEED:
|
||||
{
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
/*OUTBOUND...so we were told by the line of this so noifiy the user*/
|
||||
sigev.event_id = FTDM_SIGEVENT_PROCEED;
|
||||
ftdm_span_send_signal(ftdmchan->span, &sigev);
|
||||
} else {
|
||||
if (!sngisdn_test_flag(sngisdn_info, FLAG_SENT_PROCEED)) {
|
||||
sngisdn_set_flag(sngisdn_info, FLAG_SENT_PROCEED);
|
||||
sngisdn_snd_proceed(ftdmchan);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_RINGING:
|
||||
{
|
||||
ftdm_sngisdn_progind_t prog_ind = {SNGISDN_PROGIND_LOC_USER, SNGISDN_PROGIND_DESCR_NETE_ISDN};
|
||||
sngisdn_snd_alert(ftdmchan, prog_ind);
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||
{
|
||||
/*check if the channel is inbound or outbound*/
|
||||
@@ -642,9 +685,13 @@ static void ftdm_sangoma_isdn_process_state_change(ftdm_channel_t *ftdmchan)
|
||||
/*OUTBOUND...so we were told by the line of this so noifiy the user*/
|
||||
sigev.event_id = FTDM_SIGEVENT_PROGRESS;
|
||||
ftdm_span_send_signal(ftdmchan->span, &sigev);
|
||||
} else if (!sngisdn_test_flag(sngisdn_info, FLAG_SENT_PROCEED)) {
|
||||
sngisdn_set_flag(sngisdn_info, FLAG_SENT_PROCEED);
|
||||
sngisdn_snd_proceed(ftdmchan);
|
||||
} else {
|
||||
/* If we already sent a PROCEED before, do not send a PROGRESS as there is nothing to indicate to the remote switch */
|
||||
if (ftdmchan->last_state != FTDM_CHANNEL_STATE_PROCEED) {
|
||||
/* Send a progress message, indicating: Call is not end-to-end ISDN, further call progress may be available */
|
||||
ftdm_sngisdn_progind_t prog_ind = {SNGISDN_PROGIND_LOC_USER, SNGISDN_PROGIND_DESCR_NETE_ISDN};
|
||||
sngisdn_snd_progress(ftdmchan, prog_ind);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -654,7 +701,9 @@ static void ftdm_sangoma_isdn_process_state_change(ftdm_channel_t *ftdmchan)
|
||||
sigev.event_id = FTDM_SIGEVENT_PROGRESS_MEDIA;
|
||||
ftdm_span_send_signal(ftdmchan->span, &sigev);
|
||||
} else {
|
||||
sngisdn_snd_progress(ftdmchan);
|
||||
/* Send a progress message, indicating: In-band information/pattern available */
|
||||
ftdm_sngisdn_progind_t prog_ind = {SNGISDN_PROGIND_LOC_USER, SNGISDN_PROGIND_DESCR_IB_AVAIL};
|
||||
sngisdn_snd_progress(ftdmchan, prog_ind);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -750,9 +799,7 @@ static void ftdm_sangoma_isdn_process_state_change(ftdm_channel_t *ftdmchan)
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_DOWN: /* the call is finished and removed */
|
||||
{
|
||||
uint8_t glare = 0;
|
||||
|
||||
glare = sngisdn_test_flag(sngisdn_info, FLAG_GLARE);
|
||||
uint8_t glare = sngisdn_test_flag(sngisdn_info, FLAG_GLARE);
|
||||
/* clear all of the call specific data store in the channel structure */
|
||||
clear_call_data(sngisdn_info);
|
||||
|
||||
@@ -992,6 +1039,7 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_sangoma_isdn_span_config)
|
||||
span->state_map = &sangoma_isdn_state_map;
|
||||
ftdm_set_flag(span, FTDM_SPAN_USE_CHAN_QUEUE);
|
||||
ftdm_set_flag(span, FTDM_SPAN_USE_SIGNALS_QUEUE);
|
||||
ftdm_set_flag(span, FTDM_SPAN_USE_PROCEED_STATE);
|
||||
|
||||
if (span->trunk_type == FTDM_TRUNK_BRI_PTMP ||
|
||||
span->trunk_type == FTDM_TRUNK_BRI) {
|
||||
|
||||
@@ -64,6 +64,33 @@
|
||||
|
||||
/* TODO: rename all *_cc_* to *_an_* */
|
||||
|
||||
#define SNGISDN_ENUM_NAMES(_NAME, _STRINGS) static const char * _NAME [] = { _STRINGS , NULL };
|
||||
#define SNGISDN_STR2ENUM_P(_FUNC1, _FUNC2, _TYPE) _TYPE _FUNC1 (const char *name); const char * _FUNC2 (_TYPE type);
|
||||
#define SNGISDN_STR2ENUM(_FUNC1, _FUNC2, _TYPE, _STRINGS, _MAX) \
|
||||
_TYPE _FUNC1 (const char *name) \
|
||||
{ \
|
||||
int i; \
|
||||
_TYPE t = _MAX ; \
|
||||
\
|
||||
for (i = 0; i < _MAX ; i++) { \
|
||||
if (!strcasecmp(name, _STRINGS[i])) { \
|
||||
t = (_TYPE) i; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
return t; \
|
||||
} \
|
||||
const char * _FUNC2 (_TYPE type) \
|
||||
{ \
|
||||
if (type > _MAX) { \
|
||||
type = _MAX; \
|
||||
} \
|
||||
return _STRINGS[(int)type]; \
|
||||
} \
|
||||
|
||||
|
||||
|
||||
typedef enum {
|
||||
FLAG_RESET_RX = (1 << 0),
|
||||
FLAG_RESET_TX = (1 << 1),
|
||||
@@ -75,7 +102,8 @@ typedef enum {
|
||||
FLAG_DELAYED_REL = (1 << 7),
|
||||
FLAG_SENT_PROCEED = (1 << 8),
|
||||
FLAG_SEND_DISC = (1 << 9),
|
||||
FLAG_ACTIVATING = (1 << 10), /* Used for BRI only, flag is set after we request line CONNECTED */
|
||||
/* Used for BRI only, flag is set after we request line CONNECTED */
|
||||
FLAG_ACTIVATING = (1 << 10),
|
||||
} sngisdn_flag_t;
|
||||
|
||||
|
||||
@@ -135,6 +163,51 @@ typedef enum {
|
||||
SNGISDN_EVENT_RST_IND,
|
||||
} ftdm_sngisdn_event_id_t;
|
||||
|
||||
typedef enum {
|
||||
/* Call is not end-to-end ISDN */
|
||||
SNGISDN_PROGIND_DESCR_NETE_ISDN,
|
||||
/* Destination address is non-ISDN */
|
||||
SNGISDN_PROGIND_DESCR_DEST_NISDN,
|
||||
/* Origination address is non-ISDN */
|
||||
SNGISDN_PROGIND_DESCR_ORIG_NISDN,
|
||||
/* Call has returned to the ISDN */
|
||||
SNGISDN_PROGIND_DESCR_RET_ISDN,
|
||||
/* Interworking as occured and has resulted in a telecommunication service change */
|
||||
SNGISDN_PROGIND_DESCR_SERV_CHANGE,
|
||||
/* In-band information or an appropriate pattern is now available */
|
||||
SNGISDN_PROGIND_DESCR_IB_AVAIL,
|
||||
/* Invalid */
|
||||
SNGISDN_PROGIND_DESCR_INVALID,
|
||||
} ftdm_sngisdn_progind_descr_t;
|
||||
#define SNGISDN_PROGIND_DESCR_STRINGS "not-end-to-end-isdn", "destination-is-non-isdn", "origination-is-non-isdn", "call-returned-to-isdn", "service-change", "inband-info-available", "invalid"
|
||||
SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_descr, ftdm_sngisdn_progind_descr2str, ftdm_sngisdn_progind_descr_t);
|
||||
|
||||
typedef enum {
|
||||
/* User */
|
||||
SNGISDN_PROGIND_LOC_USER,
|
||||
/* Private network serving the local user */
|
||||
SNGISDN_PROGIND_LOC_PRIV_NET_LOCAL_USR,
|
||||
/* Public network serving the local user */
|
||||
SNGISDN_PROGIND_LOC_PUB_NET_LOCAL_USR,
|
||||
/* Transit network */
|
||||
SNGISDN_PROGIND_LOC_TRANSIT_NET,
|
||||
/* Public network serving remote user */
|
||||
SNGISDN_PROGIND_LOC_PUB_NET_REMOTE_USR,
|
||||
/* Private network serving remote user */
|
||||
SNGISDN_PROGIND_LOC_PRIV_NET_REMOTE_USR,
|
||||
/* Network beyond the interworking point */
|
||||
SNGISDN_PROGIND_LOC_NET_BEYOND_INTRW,
|
||||
/* Invalid */
|
||||
SNGISDN_PROGIND_LOC_INVALID,
|
||||
} ftdm_sngisdn_progind_loc_t;
|
||||
#define SNGISDN_PROGIND_LOC_STRINGS "user", "private-net-local-user", "public-net-local-user", "transit-network", "public-net-remote-user", "private-net-remote-user", "beyond-interworking", "invalid"
|
||||
SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_loc, ftdm_sngisdn_progind_loc2str, ftdm_sngisdn_progind_loc_t);
|
||||
|
||||
typedef struct ftdm_sngisdn_prog_ind {
|
||||
ftdm_sngisdn_progind_loc_t loc; /* location */
|
||||
ftdm_sngisdn_progind_descr_t descr; /* description */
|
||||
} ftdm_sngisdn_progind_t;
|
||||
|
||||
/* Only timers that can be cancelled are listed here */
|
||||
#define SNGISDN_NUM_TIMERS 1
|
||||
/* Increase NUM_TIMERS as number of ftdm_sngisdn_timer_t increases */
|
||||
@@ -181,10 +254,13 @@ typedef struct sngisdn_span_data {
|
||||
uint8_t trace_flags; /* TODO: change to flags, so we can use ftdm_test_flag etc.. */
|
||||
uint8_t overlap_dial;
|
||||
uint8_t setup_arb;
|
||||
uint8_t facility_ie_decode;
|
||||
uint8_t facility;
|
||||
int8_t facility_timeout;
|
||||
uint8_t num_local_numbers;
|
||||
uint8_t ignore_cause_value;
|
||||
uint8_t timer_t3;
|
||||
uint8_t restart_opt;
|
||||
char* local_numbers[SNGISDN_NUM_LOCAL_NUMBERS];
|
||||
ftdm_sched_t *sched;
|
||||
ftdm_queue_t *event_queue;
|
||||
@@ -288,13 +364,14 @@ void stack_pst_init(Pst *pst);
|
||||
void sngisdn_snd_setup(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_setup_ack(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_proceed(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_progress(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_alert(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_progress(ftdm_channel_t *ftdmchan, ftdm_sngisdn_progind_t prog_ind);
|
||||
void sngisdn_snd_alert(ftdm_channel_t *ftdmchan, ftdm_sngisdn_progind_t prog_ind);
|
||||
void sngisdn_snd_connect(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_disconnect(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_release(ftdm_channel_t *ftdmchan, uint8_t glare);
|
||||
void sngisdn_snd_reset(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_con_complete(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_fac_req(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_info_req(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_status_enq(ftdm_channel_t *ftdmchan);
|
||||
void sngisdn_snd_data(ftdm_channel_t *dchan, uint8_t *data, ftdm_size_t len);
|
||||
@@ -358,14 +435,25 @@ void sngisdn_rcv_cc_ind(CcMngmt *status);
|
||||
void sngisdn_rcv_sng_log(uint8_t level, char *fmt,...);
|
||||
void sngisdn_rcv_sng_assert(char *message);
|
||||
|
||||
ftdm_status_t cpy_calling_num_from_stack(ftdm_caller_data_t *ftdm, CgPtyNmb *cgPtyNmb);
|
||||
ftdm_status_t cpy_called_num_from_stack(ftdm_caller_data_t *ftdm, CdPtyNmb *cdPtyNmb);
|
||||
ftdm_status_t cpy_redir_num_from_stack(ftdm_caller_data_t *ftdm, RedirNmb *redirNmb);
|
||||
ftdm_status_t cpy_calling_name_from_stack(ftdm_caller_data_t *ftdm, Display *display);
|
||||
ftdm_status_t cpy_calling_num_from_user(CgPtyNmb *cgPtyNmb, ftdm_caller_data_t *ftdm);
|
||||
ftdm_status_t cpy_called_num_from_user(CdPtyNmb *cdPtyNmb, ftdm_caller_data_t *ftdm);
|
||||
ftdm_status_t cpy_redir_num_from_user(RedirNmb *redirNmb, ftdm_caller_data_t *ftdm);
|
||||
ftdm_status_t cpy_calling_name_from_user(ConEvnt *conEvnt, ftdm_channel_t *ftdmchan);
|
||||
ftdm_status_t get_calling_num(ftdm_channel_t *ftdmchan, CgPtyNmb *cgPtyNmb);
|
||||
ftdm_status_t get_called_num(ftdm_channel_t *ftdmchan, CdPtyNmb *cdPtyNmb);
|
||||
ftdm_status_t get_redir_num(ftdm_channel_t *ftdmchan, RedirNmb *redirNmb);
|
||||
ftdm_status_t get_calling_name_from_display(ftdm_channel_t *ftdmchan, Display *display);
|
||||
ftdm_status_t get_calling_name_from_usr_usr(ftdm_channel_t *ftdmchan, UsrUsr *usrUsr);
|
||||
ftdm_status_t get_calling_subaddr(ftdm_channel_t *ftdmchan, CgPtySad *cgPtySad);
|
||||
ftdm_status_t get_prog_ind_ie(ftdm_channel_t *ftdmchan, ProgInd *progInd);
|
||||
ftdm_status_t get_facility_ie(ftdm_channel_t *ftdmchan, FacilityStr *facilityStr);
|
||||
ftdm_status_t get_facility_ie_str(ftdm_channel_t *ftdmchan, uint8_t *data, ftdm_size_t data_len);
|
||||
|
||||
ftdm_status_t set_calling_num(ftdm_channel_t *ftdmchan, CgPtyNmb *cgPtyNmb);
|
||||
ftdm_status_t set_called_num(ftdm_channel_t *ftdmchan, CdPtyNmb *cdPtyNmb);
|
||||
ftdm_status_t set_redir_num(ftdm_channel_t *ftdmchan, RedirNmb *redirNmb);
|
||||
ftdm_status_t set_calling_name(ftdm_channel_t *ftdmchan, ConEvnt *conEvnt);
|
||||
ftdm_status_t set_calling_subaddr(ftdm_channel_t *ftdmchan, CgPtySad *cgPtySad);
|
||||
ftdm_status_t set_prog_ind_ie(ftdm_channel_t *ftdmchan, ProgInd *progInd, ftdm_sngisdn_progind_t prog_ind);
|
||||
ftdm_status_t set_facility_ie(ftdm_channel_t *ftdmchan, FacilityStr *facilityStr);
|
||||
ftdm_status_t set_facility_ie_str(ftdm_channel_t *ftdmchan, uint8_t *data, ftdm_size_t *data_len);
|
||||
|
||||
|
||||
uint8_t sngisdn_get_infoTranCap_from_stack(ftdm_bearer_cap_t bearer_capability);
|
||||
uint8_t sngisdn_get_usrInfoLyr1Prot_from_stack(ftdm_user_layer1_prot_t layer1_prot);
|
||||
|
||||
@@ -34,13 +34,24 @@
|
||||
|
||||
#include "ftmod_sangoma_isdn.h"
|
||||
|
||||
ftdm_status_t parse_switchtype(const char* switch_name, ftdm_span_t *span);
|
||||
ftdm_status_t parse_signalling(const char* signalling, ftdm_span_t *span);
|
||||
ftdm_status_t add_local_number(const char* val, ftdm_span_t *span);
|
||||
static ftdm_status_t parse_switchtype(const char* switch_name, ftdm_span_t *span);
|
||||
static ftdm_status_t parse_signalling(const char* signalling, ftdm_span_t *span);
|
||||
static ftdm_status_t add_local_number(const char* val, ftdm_span_t *span);
|
||||
static ftdm_status_t parse_yesno(const char* var, const char* val, uint8_t *target);
|
||||
|
||||
extern ftdm_sngisdn_data_t g_sngisdn_data;
|
||||
|
||||
ftdm_status_t add_local_number(const char* val, ftdm_span_t *span)
|
||||
static ftdm_status_t parse_yesno(const char* var, const char* val, uint8_t *target)
|
||||
{
|
||||
if (ftdm_true(val)) {
|
||||
*target = SNGISDN_OPT_TRUE;
|
||||
} else {
|
||||
*target = SNGISDN_OPT_FALSE;
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
static ftdm_status_t add_local_number(const char* val, ftdm_span_t *span)
|
||||
{
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) span->signal_data;
|
||||
|
||||
@@ -53,7 +64,7 @@ ftdm_status_t add_local_number(const char* val, ftdm_span_t *span)
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t parse_switchtype(const char* switch_name, ftdm_span_t *span)
|
||||
static ftdm_status_t parse_switchtype(const char* switch_name, ftdm_span_t *span)
|
||||
{
|
||||
unsigned i;
|
||||
ftdm_iterator_t *chaniter = NULL;
|
||||
@@ -160,7 +171,7 @@ ftdm_status_t parse_switchtype(const char* switch_name, ftdm_span_t *span)
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t parse_signalling(const char* signalling, ftdm_span_t *span)
|
||||
static ftdm_status_t parse_signalling(const char* signalling, ftdm_span_t *span)
|
||||
{
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) span->signal_data;
|
||||
if (!strcasecmp(signalling, "net") ||
|
||||
@@ -190,7 +201,10 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_
|
||||
signal_data->min_digits = 8;
|
||||
signal_data->overlap_dial = SNGISDN_OPT_DEFAULT;
|
||||
signal_data->setup_arb = SNGISDN_OPT_DEFAULT;
|
||||
signal_data->facility_ie_decode = SNGISDN_OPT_DEFAULT;
|
||||
signal_data->ignore_cause_value = SNGISDN_OPT_DEFAULT;
|
||||
signal_data->timer_t3 = 8;
|
||||
signal_data->restart_opt = SNGISDN_OPT_DEFAULT;
|
||||
|
||||
signal_data->link_id = span->span_id;
|
||||
span->default_caller_data.bearer_capability = IN_ITC_SPEECH;
|
||||
@@ -201,20 +215,19 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_
|
||||
if (span->trunk_type == FTDM_TRUNK_BRI ||
|
||||
span->trunk_type == FTDM_TRUNK_BRI_PTMP) {
|
||||
|
||||
|
||||
ftdm_span_set_npi("unknown", &span->default_caller_data.dnis.plan);
|
||||
ftdm_span_set_ton("unknown", &span->default_caller_data.dnis.type);
|
||||
ftdm_span_set_npi("unknown", &span->default_caller_data.cid_num.plan);
|
||||
ftdm_span_set_ton("unknown", &span->default_caller_data.cid_num.type);
|
||||
ftdm_span_set_npi("unknown", &span->default_caller_data.rdnis.plan);
|
||||
ftdm_span_set_ton("unknown", &span->default_caller_data.rdnis.type);
|
||||
ftdm_set_npi("unknown", &span->default_caller_data.dnis.plan);
|
||||
ftdm_set_ton("unknown", &span->default_caller_data.dnis.type);
|
||||
ftdm_set_npi("unknown", &span->default_caller_data.cid_num.plan);
|
||||
ftdm_set_ton("unknown", &span->default_caller_data.cid_num.type);
|
||||
ftdm_set_npi("unknown", &span->default_caller_data.rdnis.plan);
|
||||
ftdm_set_ton("unknown", &span->default_caller_data.rdnis.type);
|
||||
} else {
|
||||
ftdm_span_set_npi("e164", &span->default_caller_data.dnis.plan);
|
||||
ftdm_span_set_ton("national", &span->default_caller_data.dnis.type);
|
||||
ftdm_span_set_npi("e164", &span->default_caller_data.cid_num.plan);
|
||||
ftdm_span_set_ton("national", &span->default_caller_data.cid_num.type);
|
||||
ftdm_span_set_npi("e164", &span->default_caller_data.rdnis.plan);
|
||||
ftdm_span_set_ton("national", &span->default_caller_data.rdnis.type);
|
||||
ftdm_set_npi("isdn", &span->default_caller_data.dnis.plan);
|
||||
ftdm_set_ton("national", &span->default_caller_data.dnis.type);
|
||||
ftdm_set_npi("isdn", &span->default_caller_data.cid_num.plan);
|
||||
ftdm_set_ton("national", &span->default_caller_data.cid_num.type);
|
||||
ftdm_set_npi("isdn", &span->default_caller_data.rdnis.plan);
|
||||
ftdm_set_ton("national", &span->default_caller_data.rdnis.type);
|
||||
}
|
||||
|
||||
for (paramindex = 0; ftdm_parameters[paramindex].var; paramindex++) {
|
||||
@@ -246,40 +259,30 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_ERROR, "Invalid value for parameter:%s:%s\n", var, val);
|
||||
}
|
||||
} else if (!strcasecmp(var, "setup arbitration")) {
|
||||
if (!strcasecmp(val, "yes")) {
|
||||
signal_data->setup_arb = SNGISDN_OPT_TRUE;
|
||||
} else if (!strcasecmp(val, "no")) {
|
||||
signal_data->setup_arb = SNGISDN_OPT_FALSE;
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_ERROR, "Invalid value for parameter:%s:%s\n", var, val);
|
||||
}
|
||||
} else if (!strcasecmp(var, "setup-arbitration")) {
|
||||
parse_yesno(var, val, &signal_data->setup_arb);
|
||||
} else if (!strcasecmp(var, "facility")) {
|
||||
if (!strcasecmp(val, "yes")) {
|
||||
signal_data->facility = SNGISDN_OPT_TRUE;
|
||||
} else if (!strcasecmp(val, "no")) {
|
||||
signal_data->facility = SNGISDN_OPT_FALSE;
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_ERROR, "Invalid value for parameter:%s:%s\n", var, val);
|
||||
}
|
||||
parse_yesno(var, val, &signal_data->facility);
|
||||
} else if (!strcasecmp(var, "min_digits")) {
|
||||
signal_data->min_digits = atoi(val);
|
||||
} else if (!strcasecmp(var, "outbound-called-ton")) {
|
||||
ftdm_span_set_ton(val, &span->default_caller_data.dnis.type);
|
||||
ftdm_set_ton(val, &span->default_caller_data.dnis.type);
|
||||
} else if (!strcasecmp(var, "outbound-called-npi")) {
|
||||
ftdm_span_set_npi(val, &span->default_caller_data.dnis.plan);
|
||||
ftdm_set_npi(val, &span->default_caller_data.dnis.plan);
|
||||
} else if (!strcasecmp(var, "outbound-calling-ton")) {
|
||||
ftdm_span_set_ton(val, &span->default_caller_data.cid_num.type);
|
||||
ftdm_set_ton(val, &span->default_caller_data.cid_num.type);
|
||||
} else if (!strcasecmp(var, "outbound-calling-npi")) {
|
||||
ftdm_span_set_npi(val, &span->default_caller_data.cid_num.plan);
|
||||
ftdm_set_npi(val, &span->default_caller_data.cid_num.plan);
|
||||
} else if (!strcasecmp(var, "outbound-rdnis-ton")) {
|
||||
ftdm_span_set_ton(val, &span->default_caller_data.rdnis.type);
|
||||
ftdm_set_ton(val, &span->default_caller_data.rdnis.type);
|
||||
} else if (!strcasecmp(var, "outbound-rdnis-npi")) {
|
||||
ftdm_span_set_npi(val, &span->default_caller_data.rdnis.plan);
|
||||
ftdm_set_npi(val, &span->default_caller_data.rdnis.plan);
|
||||
} else if (!strcasecmp(var, "outbound-bearer_cap")) {
|
||||
ftdm_span_set_bearer_capability(val, &span->default_caller_data.bearer_capability);
|
||||
ftdm_set_bearer_capability(val, (uint8_t*)&span->default_caller_data.bearer_capability);
|
||||
} else if (!strcasecmp(var, "outbound-bearer_layer1")) {
|
||||
ftdm_span_set_bearer_layer1(val, &span->default_caller_data.bearer_layer1);
|
||||
ftdm_set_bearer_layer1(val, &span->default_caller_data.bearer_layer1);
|
||||
} else if (!strcasecmp(var, "channel-restart-on-link-up")) {
|
||||
parse_yesno(var, val, &signal_data->restart_opt);
|
||||
} else if (!strcasecmp(var, "local-number")) {
|
||||
if (add_local_number(val, span) != FTDM_SUCCESS) {
|
||||
return FTDM_FAIL;
|
||||
@@ -289,6 +292,10 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_
|
||||
if (signal_data->facility_timeout < 0) {
|
||||
signal_data->facility_timeout = 0;
|
||||
}
|
||||
} else if (!strcasecmp(var, "facility-ie-decode")) {
|
||||
parse_yesno(var, val, &signal_data->facility_ie_decode);
|
||||
} else if (!strcasecmp(var, "ignore-cause-value")) {
|
||||
parse_yesno(var, val, &signal_data->ignore_cause_value);
|
||||
} else {
|
||||
ftdm_log(FTDM_LOG_WARNING, "Ignoring unknown parameter %s\n", ftdm_parameters[paramindex].var);
|
||||
}
|
||||
|
||||
@@ -686,7 +686,16 @@ ftdm_status_t sngisdn_stack_cfg_q931_dlsap(ftdm_span_t *span)
|
||||
cfg.t.cfg.s.inDLSAP.statEnqOpt = FALSE;
|
||||
cfg.t.cfg.s.inDLSAP.rstOpt = FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Override the restart options if user selected that option */
|
||||
if (signal_data->restart_opt != SNGISDN_OPT_DEFAULT) {
|
||||
if (signal_data->restart_opt == SNGISDN_OPT_TRUE) {
|
||||
cfg.t.cfg.s.inDLSAP.rstOpt = TRUE;
|
||||
} else {
|
||||
cfg.t.cfg.s.inDLSAP.rstOpt = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < IN_MAXBCHNL; i++)
|
||||
{
|
||||
cfg.t.cfg.s.inDLSAP.bProf[i].profNmb = 0;
|
||||
|
||||
@@ -127,10 +127,16 @@ void sngisdn_process_con_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
ftdm_channel_add_var(ftdmchan, "isdn_specific_var", "1");
|
||||
#endif
|
||||
/* Fill in call information */
|
||||
cpy_calling_num_from_stack(&ftdmchan->caller_data, &conEvnt->cgPtyNmb);
|
||||
cpy_called_num_from_stack(&ftdmchan->caller_data, &conEvnt->cdPtyNmb);
|
||||
cpy_calling_name_from_stack(&ftdmchan->caller_data, &conEvnt->display);
|
||||
cpy_redir_num_from_stack(&ftdmchan->caller_data, &conEvnt->redirNmb);
|
||||
get_calling_num(ftdmchan, &conEvnt->cgPtyNmb);
|
||||
get_called_num(ftdmchan, &conEvnt->cdPtyNmb);
|
||||
get_redir_num(ftdmchan, &conEvnt->redirNmb);
|
||||
get_calling_subaddr(ftdmchan, &conEvnt->cgPtySad);
|
||||
|
||||
if (get_calling_name_from_display(ftdmchan, &conEvnt->display) != FTDM_SUCCESS) {
|
||||
get_calling_name_from_usr_usr(ftdmchan, &conEvnt->usrUsr);
|
||||
}
|
||||
get_prog_ind_ie(ftdmchan, &conEvnt->progInd);
|
||||
|
||||
ftdm_log_chan(sngisdn_info->ftdmchan, FTDM_LOG_INFO, "Incoming call: Called No:[%s] Calling No:[%s]\n", ftdmchan->caller_data.dnis.digits, ftdmchan->caller_data.cid_num.digits);
|
||||
|
||||
if (conEvnt->bearCap[0].eh.pres) {
|
||||
@@ -138,37 +144,43 @@ void sngisdn_process_con_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
ftdmchan->caller_data.bearer_capability = sngisdn_get_infoTranCap_from_stack(conEvnt->bearCap[0].infoTranCap.val);
|
||||
}
|
||||
|
||||
if (signal_data->switchtype == SNGISDN_SWITCH_NI2) {
|
||||
if (conEvnt->shift11.eh.pres && conEvnt->ni2OctStr.eh.pres) {
|
||||
if (conEvnt->ni2OctStr.str.len == 4 && conEvnt->ni2OctStr.str.val[0] == 0x37) {
|
||||
snprintf(ftdmchan->caller_data.aniII, 5, "%.2d", conEvnt->ni2OctStr.str.val[3]);
|
||||
}
|
||||
|
||||
if (conEvnt->shift11.eh.pres && conEvnt->ni2OctStr.eh.pres) {
|
||||
if (conEvnt->ni2OctStr.str.len == 4 && conEvnt->ni2OctStr.str.val[0] == 0x37) {
|
||||
snprintf(ftdmchan->caller_data.aniII, 5, "%.2d", conEvnt->ni2OctStr.str.val[3]);
|
||||
}
|
||||
|
||||
if (signal_data->facility == SNGISDN_OPT_TRUE && conEvnt->facilityStr.eh.pres) {
|
||||
/* Verify whether the Caller Name will come in a subsequent FACILITY message */
|
||||
uint16_t ret_val;
|
||||
char retrieved_str[255];
|
||||
|
||||
ret_val = sng_isdn_retrieve_facility_caller_name(conEvnt->facilityStr.facilityStr.val, conEvnt->facilityStr.facilityStr.len, retrieved_str);
|
||||
/*
|
||||
return values for "sng_isdn_retrieve_facility_information_following":
|
||||
If there will be no information following, or fails to decode IE, returns -1
|
||||
If there will be no information following, but current FACILITY IE contains a caller name, returns 0
|
||||
If there will be information following, returns 1
|
||||
*/
|
||||
}
|
||||
|
||||
if (ret_val == 1) {
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Expecting Caller name in FACILITY\n");
|
||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_GET_CALLERID);
|
||||
/* Launch timer in case we never get a FACILITY msg */
|
||||
if (signal_data->facility_timeout) {
|
||||
ftdm_sched_timer(signal_data->sched, "facility_timeout", signal_data->facility_timeout,
|
||||
sngisdn_facility_timeout, (void*) sngisdn_info, &sngisdn_info->timers[SNGISDN_TIMER_FACILITY]);
|
||||
if (conEvnt->facilityStr.eh.pres) {
|
||||
if (signal_data->facility_ie_decode == SNGISDN_OPT_FALSE) {
|
||||
get_facility_ie(ftdmchan, &conEvnt->facilityStr);
|
||||
} else if (signal_data->facility == SNGISDN_OPT_TRUE) {
|
||||
if (signal_data->switchtype == SNGISDN_SWITCH_NI2) {
|
||||
/* Verify whether the Caller Name will come in a subsequent FACILITY message */
|
||||
uint16_t ret_val;
|
||||
char retrieved_str[255];
|
||||
|
||||
ret_val = sng_isdn_retrieve_facility_caller_name(conEvnt->facilityStr.facilityStr.val, conEvnt->facilityStr.facilityStr.len, retrieved_str);
|
||||
/*
|
||||
return values for "sng_isdn_retrieve_facility_information_following":
|
||||
If there will be no information following, or fails to decode IE, returns -1
|
||||
If there will be no information following, but current FACILITY IE contains a caller name, returns 0
|
||||
If there will be information following, returns 1
|
||||
*/
|
||||
|
||||
if (ret_val == 1) {
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Expecting Caller name in FACILITY\n");
|
||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_GET_CALLERID);
|
||||
/* Launch timer in case we never get a FACILITY msg */
|
||||
if (signal_data->facility_timeout) {
|
||||
ftdm_sched_timer(signal_data->sched, "facility_timeout", signal_data->facility_timeout,
|
||||
sngisdn_facility_timeout, (void*) sngisdn_info, &sngisdn_info->timers[SNGISDN_TIMER_FACILITY]);
|
||||
}
|
||||
break;
|
||||
} else if (ret_val == 0) {
|
||||
strcpy(ftdmchan->caller_data.cid_name, retrieved_str);
|
||||
}
|
||||
break;
|
||||
} else if (ret_val == 0) {
|
||||
strcpy(ftdmchan->caller_data.cid_name, retrieved_str);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,11 +255,9 @@ void sngisdn_process_con_cfm (sngisdn_event_data_t *sngisdn_event)
|
||||
uint8_t ces = sngisdn_event->ces;
|
||||
sngisdn_chan_data_t *sngisdn_info = sngisdn_event->sngisdn_info;
|
||||
ftdm_channel_t *ftdmchan = sngisdn_info->ftdmchan;
|
||||
|
||||
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
|
||||
CnStEvnt *cnStEvnt = &sngisdn_event->event.cnStEvnt;
|
||||
|
||||
/* Function does not require any info from conStEvnt struct for now */
|
||||
/* CnStEvnt *cnStEvnt = &sngisdn_event->event.cnStEvnt; */
|
||||
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
|
||||
|
||||
ftdm_assert(!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_STATE_CHANGE), "State change flag pending\n");
|
||||
|
||||
@@ -269,9 +279,11 @@ void sngisdn_process_con_cfm (sngisdn_event_data_t *sngisdn_event)
|
||||
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) {
|
||||
switch(ftdmchan->state) {
|
||||
case FTDM_CHANNEL_STATE_PROCEED:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS_MEDIA:
|
||||
case FTDM_CHANNEL_STATE_DIALING:
|
||||
get_prog_ind_ie(ftdmchan, &cnStEvnt->progInd);
|
||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_UP);
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_HANGUP_COMPLETE:
|
||||
@@ -335,9 +347,13 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
suId, suInstId, spInstId, ces);
|
||||
|
||||
switch(evntType) {
|
||||
case MI_CALLPROC:
|
||||
case MI_PROGRESS:
|
||||
if (signal_data->switchtype == SNGISDN_SWITCH_NI2 &&
|
||||
cnStEvnt->causeDgn[0].eh.pres && cnStEvnt->causeDgn[0].causeVal.pres) {
|
||||
case MI_ALERTING:
|
||||
get_prog_ind_ie(ftdmchan, &cnStEvnt->progInd);
|
||||
|
||||
if (signal_data->ignore_cause_value != SNGISDN_OPT_TRUE &&
|
||||
cnStEvnt->causeDgn[0].eh.pres && cnStEvnt->causeDgn[0].causeVal.pres) {
|
||||
|
||||
switch(cnStEvnt->causeDgn[0].causeVal.val) {
|
||||
case 17: /* User Busy */
|
||||
@@ -362,22 +378,20 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
goto sngisdn_process_cnst_ind_end;
|
||||
}
|
||||
}
|
||||
/* fall-through */
|
||||
case MI_ALERTING:
|
||||
case MI_CALLPROC:
|
||||
|
||||
|
||||
switch(ftdmchan->state) {
|
||||
case FTDM_CHANNEL_STATE_DIALING:
|
||||
if (evntType == MI_PROGRESS ||
|
||||
(cnStEvnt->progInd.eh.pres && cnStEvnt->progInd.progDesc.val == IN_PD_IBAVAIL)) {
|
||||
case FTDM_CHANNEL_STATE_DIALING:
|
||||
case FTDM_CHANNEL_STATE_PROCEED:
|
||||
if (cnStEvnt->progInd.eh.pres && cnStEvnt->progInd.progDesc.val == IN_PD_IBAVAIL) {
|
||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA);
|
||||
} else if (evntType == MI_CALLPROC) {
|
||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_PROCEED);
|
||||
} else {
|
||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_PROGRESS);
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||
if (evntType == MI_PROGRESS ||
|
||||
(cnStEvnt->progInd.eh.pres && cnStEvnt->progInd.progDesc.val == IN_PD_IBAVAIL)) {
|
||||
if (cnStEvnt->progInd.eh.pres && cnStEvnt->progInd.progDesc.val == IN_PD_IBAVAIL) {
|
||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA);
|
||||
}
|
||||
break;
|
||||
@@ -406,7 +420,7 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
ftdm_size_t min_digits = ((sngisdn_span_data_t*)ftdmchan->span->signal_data)->min_digits;
|
||||
ftdm_size_t num_digits;
|
||||
|
||||
cpy_called_num_from_stack(&ftdmchan->caller_data, &cnStEvnt->cdPtyNmb);
|
||||
get_called_num(ftdmchan, &cnStEvnt->cdPtyNmb);
|
||||
num_digits = strlen(ftdmchan->caller_data.dnis.digits);
|
||||
|
||||
if (cnStEvnt->sndCmplt.eh.pres || num_digits >= min_digits) {
|
||||
@@ -417,6 +431,7 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_RING:
|
||||
case FTDM_CHANNEL_STATE_PROCEED:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS_MEDIA:
|
||||
case FTDM_CHANNEL_STATE_UP:
|
||||
@@ -446,6 +461,7 @@ void sngisdn_process_disc_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
uint32_t spInstId = sngisdn_event->spInstId;
|
||||
sngisdn_chan_data_t *sngisdn_info = sngisdn_event->sngisdn_info;
|
||||
ftdm_channel_t *ftdmchan = sngisdn_info->ftdmchan;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
|
||||
DiscEvnt *discEvnt = &sngisdn_event->event.discEvnt;
|
||||
|
||||
@@ -454,12 +470,20 @@ void sngisdn_process_disc_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Processing DISCONNECT (suId:%u suInstId:%u spInstId:%u)\n", suId, suInstId, spInstId);
|
||||
|
||||
ftdm_assert(!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_STATE_CHANGE), "State change flag pending\n");
|
||||
switch (ftdmchan->state) {
|
||||
switch (ftdmchan->state) {
|
||||
case FTDM_CHANNEL_STATE_RING:
|
||||
case FTDM_CHANNEL_STATE_DIALING:
|
||||
case FTDM_CHANNEL_STATE_PROCEED:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS_MEDIA:
|
||||
case FTDM_CHANNEL_STATE_UP:
|
||||
case FTDM_CHANNEL_STATE_UP:
|
||||
if (discEvnt->facilityStr.eh.pres) {
|
||||
if (signal_data->facility_ie_decode == SNGISDN_OPT_FALSE) {
|
||||
get_facility_ie(ftdmchan, &discEvnt->facilityStr);
|
||||
} else {
|
||||
/* Call libsng_isdn facility decode function and copy variables here */
|
||||
}
|
||||
}
|
||||
if (discEvnt->causeDgn[0].eh.pres && discEvnt->causeDgn[0].causeVal.pres) {
|
||||
ftdmchan->caller_data.hangup_cause = discEvnt->causeDgn[0].causeVal.val;
|
||||
} else {
|
||||
@@ -503,6 +527,7 @@ void sngisdn_process_rel_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
uint32_t spInstId = sngisdn_event->spInstId;
|
||||
sngisdn_chan_data_t *sngisdn_info = sngisdn_event->sngisdn_info;
|
||||
ftdm_channel_t *ftdmchan = sngisdn_info->ftdmchan;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
|
||||
RelEvnt *relEvnt = &sngisdn_event->event.relEvnt;
|
||||
|
||||
@@ -538,6 +563,7 @@ void sngisdn_process_rel_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
sngisdn_set_avail_rate(ftdmchan->span, SNGISDN_AVAIL_DOWN);
|
||||
}
|
||||
/* fall-through */
|
||||
case FTDM_CHANNEL_STATE_PROCEED:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS_MEDIA:
|
||||
case FTDM_CHANNEL_STATE_UP:
|
||||
@@ -547,6 +573,15 @@ void sngisdn_process_rel_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
not changed while we were waiting for ftdmchan->mutex by comparing suInstId's */
|
||||
if (((sngisdn_chan_data_t*)ftdmchan->call_data)->suInstId == suInstId ||
|
||||
((sngisdn_chan_data_t*)ftdmchan->call_data)->spInstId == spInstId) {
|
||||
|
||||
if (relEvnt->facilityStr.eh.pres) {
|
||||
if (signal_data->facility_ie_decode == SNGISDN_OPT_FALSE) {
|
||||
get_facility_ie(ftdmchan, &relEvnt->facilityStr);
|
||||
} else {
|
||||
/* Call libsng_isdn facility decode function and copy variables here */
|
||||
}
|
||||
}
|
||||
|
||||
if (relEvnt->causeDgn[0].eh.pres && relEvnt->causeDgn[0].causeVal.pres) {
|
||||
ftdmchan->caller_data.hangup_cause = relEvnt->causeDgn[0].causeVal.val;
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "cause:%d\n", ftdmchan->caller_data.hangup_cause);
|
||||
@@ -725,15 +760,16 @@ void sngisdn_process_fac_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
switch (ftdmchan->state) {
|
||||
case FTDM_CHANNEL_STATE_GET_CALLERID:
|
||||
/* Update the caller ID Name */
|
||||
|
||||
if (facEvnt->facElmt.facStr.pres) {
|
||||
char retrieved_str[255];
|
||||
|
||||
|
||||
/* return values for "sng_isdn_retrieve_facility_information_following":
|
||||
If there will be no information following, or fails to decode IE, returns -1
|
||||
If there will be no information following, but current FACILITY IE contains a caller name, returns 0
|
||||
If there will be information following, returns 1
|
||||
*/
|
||||
|
||||
|
||||
if (sng_isdn_retrieve_facility_caller_name(&facEvnt->facElmt.facStr.val[2], facEvnt->facElmt.facStr.len, retrieved_str) == 0) {
|
||||
strcpy(ftdmchan->caller_data.cid_name, retrieved_str);
|
||||
} else {
|
||||
@@ -751,6 +787,25 @@ void sngisdn_process_fac_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
/* We received the caller ID Name in FACILITY, but its too late, facility-timeout already occurred */
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_WARNING, "FACILITY received, but we already proceeded with call\n");
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_UP:
|
||||
{
|
||||
ftdm_sigmsg_t sigev;
|
||||
if (facEvnt->facElmt.facStr.pres) {
|
||||
if (signal_data->facility_ie_decode == SNGISDN_OPT_FALSE) {
|
||||
get_facility_ie_str(ftdmchan, &facEvnt->facElmt.facStr.val[2], facEvnt->facElmt.facStr.len);
|
||||
} else {
|
||||
/* Call libsng_isdn facility decode function and copy variables here */
|
||||
}
|
||||
}
|
||||
memset(&sigev, 0, sizeof(sigev));
|
||||
sigev.chan_id = ftdmchan->chan_id;
|
||||
sigev.span_id = ftdmchan->span_id;
|
||||
sigev.channel = ftdmchan;
|
||||
|
||||
sigev.event_id = FTDM_SIGEVENT_MSG;
|
||||
ftdm_span_send_signal(ftdmchan->span, &sigev);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* We do not support other FACILITY types for now, so do nothing */
|
||||
break;
|
||||
@@ -865,6 +920,7 @@ void sngisdn_process_sta_cfm (sngisdn_event_data_t *sngisdn_event)
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "T302 Timer expired, proceeding with call\n");
|
||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_RING);
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_PROCEED:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS_MEDIA:
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_WARNING, "Remote switch expecting OVERLAP receive, but we are already PROCEEDING\n");
|
||||
@@ -882,6 +938,7 @@ void sngisdn_process_sta_cfm (sngisdn_event_data_t *sngisdn_event)
|
||||
break;
|
||||
case 3:
|
||||
switch (ftdmchan->state) {
|
||||
case FTDM_CHANNEL_STATE_PROCEED:
|
||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||
/* T310 timer has expired */
|
||||
ftdmchan->caller_data.hangup_cause = staEvnt->causeDgn[0].causeVal.val;
|
||||
|
||||
@@ -36,9 +36,10 @@
|
||||
|
||||
void sngisdn_snd_setup(ftdm_channel_t *ftdmchan)
|
||||
{
|
||||
ConEvnt conEvnt;
|
||||
ConEvnt conEvnt;
|
||||
sngisdn_chan_data_t *sngisdn_info = ftdmchan->call_data;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
ftdm_sngisdn_progind_t prog_ind = {SNGISDN_PROGIND_LOC_USER, SNGISDN_PROGIND_DESCR_NETE_ISDN};
|
||||
|
||||
ftdm_assert((!sngisdn_info->suInstId && !sngisdn_info->spInstId), "Trying to call out, but call data was not cleared\n");
|
||||
|
||||
@@ -116,14 +117,6 @@ void sngisdn_snd_setup(ftdm_channel_t *ftdmchan)
|
||||
conEvnt.chanId.chanNmbSlotMap.val[0] = ftdmchan->physical_chan_id;
|
||||
}
|
||||
|
||||
conEvnt.progInd.eh.pres = PRSNT_NODEF;
|
||||
conEvnt.progInd.location.pres = PRSNT_NODEF;
|
||||
conEvnt.progInd.location.val = IN_LOC_USER;
|
||||
conEvnt.progInd.codeStand0.pres = PRSNT_NODEF;
|
||||
conEvnt.progInd.codeStand0.val = IN_CSTD_CCITT;
|
||||
conEvnt.progInd.progDesc.pres = PRSNT_NODEF;
|
||||
conEvnt.progInd.progDesc.val = IN_PD_NOTETEISDN; /* Not end-to-end ISDN */
|
||||
|
||||
if (signal_data->switchtype == SNGISDN_SWITCH_EUROISDN) {
|
||||
conEvnt.sndCmplt.eh.pres = PRSNT_NODEF;
|
||||
}
|
||||
@@ -133,10 +126,13 @@ void sngisdn_snd_setup(ftdm_channel_t *ftdmchan)
|
||||
}
|
||||
ftdm_log_chan(sngisdn_info->ftdmchan, FTDM_LOG_INFO, "Outgoing call: Called No:[%s] Calling No:[%s]\n", ftdmchan->caller_data.dnis.digits, ftdmchan->caller_data.cid_num.digits);
|
||||
|
||||
cpy_called_num_from_user(&conEvnt.cdPtyNmb, &ftdmchan->caller_data);
|
||||
cpy_calling_num_from_user(&conEvnt.cgPtyNmb, &ftdmchan->caller_data);
|
||||
cpy_redir_num_from_user(&conEvnt.redirNmb, &ftdmchan->caller_data);
|
||||
cpy_calling_name_from_user(&conEvnt, ftdmchan);
|
||||
set_called_num(ftdmchan, &conEvnt.cdPtyNmb);
|
||||
set_calling_num(ftdmchan, &conEvnt.cgPtyNmb);
|
||||
set_calling_subaddr(ftdmchan, &conEvnt.cgPtySad);
|
||||
set_redir_num(ftdmchan, &conEvnt.redirNmb);
|
||||
set_calling_name(ftdmchan, &conEvnt);
|
||||
set_facility_ie(ftdmchan, &conEvnt.facilityStr);
|
||||
set_prog_ind_ie(ftdmchan, &conEvnt.progInd, prog_ind);
|
||||
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending SETUP (suId:%d suInstId:%u spInstId:%u dchan:%d ces:%d)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, signal_data->dchan_id, sngisdn_info->ces);
|
||||
|
||||
@@ -323,14 +319,14 @@ void sngisdn_snd_proceed(ftdm_channel_t *ftdmchan)
|
||||
return;
|
||||
}
|
||||
|
||||
void sngisdn_snd_progress(ftdm_channel_t *ftdmchan)
|
||||
void sngisdn_snd_progress(ftdm_channel_t *ftdmchan, ftdm_sngisdn_progind_t prog_ind)
|
||||
{
|
||||
CnStEvnt cnStEvnt;
|
||||
|
||||
sngisdn_chan_data_t *sngisdn_info = (sngisdn_chan_data_t*) ftdmchan->call_data;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
|
||||
if (!sngisdn_info->suInstId || !sngisdn_info->spInstId) {
|
||||
if (!sngisdn_info->suInstId || !sngisdn_info->spInstId) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Sending PROGRESS, but no call data, aborting (suId:%d suInstId:%u spInstId:%u)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId);
|
||||
sngisdn_set_flag(sngisdn_info, FLAG_LOCAL_ABORT);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_TERMINATING);
|
||||
@@ -344,14 +340,7 @@ void sngisdn_snd_progress(ftdm_channel_t *ftdmchan)
|
||||
}
|
||||
|
||||
memset(&cnStEvnt, 0, sizeof(cnStEvnt));
|
||||
|
||||
cnStEvnt.progInd.eh.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.location.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.location.val = IN_LOC_USER;
|
||||
cnStEvnt.progInd.codeStand0.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.codeStand0.val = IN_CSTD_CCITT;
|
||||
cnStEvnt.progInd.progDesc.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.progDesc.val = IN_PD_IBAVAIL;
|
||||
set_prog_ind_ie(ftdmchan, &cnStEvnt.progInd, prog_ind);
|
||||
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending PROGRESS (suId:%d suInstId:%u spInstId:%u dchan:%d ces:%d)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, signal_data->dchan_id, sngisdn_info->ces);
|
||||
if(sng_isdn_con_status(signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId,&cnStEvnt, MI_PROGRESS, signal_data->dchan_id, sngisdn_info->ces)) {
|
||||
@@ -360,14 +349,14 @@ void sngisdn_snd_progress(ftdm_channel_t *ftdmchan)
|
||||
return;
|
||||
}
|
||||
|
||||
void sngisdn_snd_alert(ftdm_channel_t *ftdmchan)
|
||||
void sngisdn_snd_alert(ftdm_channel_t *ftdmchan, ftdm_sngisdn_progind_t prog_ind)
|
||||
{
|
||||
CnStEvnt cnStEvnt;
|
||||
|
||||
sngisdn_chan_data_t *sngisdn_info = (sngisdn_chan_data_t*) ftdmchan->call_data;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
|
||||
if (!sngisdn_info->suInstId || !sngisdn_info->spInstId) {
|
||||
if (!sngisdn_info->suInstId || !sngisdn_info->spInstId) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Sending ALERT, but no call data, aborting (suId:%d suInstId:%u spInstId:%u)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId);
|
||||
sngisdn_set_flag(sngisdn_info, FLAG_LOCAL_ABORT);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_TERMINATING);
|
||||
@@ -376,13 +365,7 @@ void sngisdn_snd_alert(ftdm_channel_t *ftdmchan)
|
||||
|
||||
memset(&cnStEvnt, 0, sizeof(cnStEvnt));
|
||||
|
||||
cnStEvnt.progInd.eh.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.location.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.location.val = IN_LOC_USER;
|
||||
cnStEvnt.progInd.codeStand0.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.codeStand0.val = IN_CSTD_CCITT;
|
||||
cnStEvnt.progInd.progDesc.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.progDesc.val = IN_PD_NOTETEISDN;
|
||||
set_prog_ind_ie(ftdmchan, &cnStEvnt.progInd, prog_ind);
|
||||
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending ALERT (suId:%d suInstId:%u spInstId:%u dchan:%d ces:%d)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, signal_data->dchan_id, sngisdn_info->ces);
|
||||
|
||||
@@ -394,10 +377,10 @@ void sngisdn_snd_alert(ftdm_channel_t *ftdmchan)
|
||||
|
||||
void sngisdn_snd_connect(ftdm_channel_t *ftdmchan)
|
||||
{
|
||||
CnStEvnt cnStEvnt;
|
||||
|
||||
CnStEvnt cnStEvnt;
|
||||
sngisdn_chan_data_t *sngisdn_info = (sngisdn_chan_data_t*) ftdmchan->call_data;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
ftdm_sngisdn_progind_t prog_ind = {SNGISDN_PROGIND_LOC_USER, SNGISDN_PROGIND_DESCR_NETE_ISDN};
|
||||
|
||||
if (!sngisdn_info->suInstId || !sngisdn_info->spInstId) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Sending CONNECT, but no call data, aborting (suId:%d suInstId:%u spInstId:%u)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId);
|
||||
@@ -408,7 +391,6 @@ void sngisdn_snd_connect(ftdm_channel_t *ftdmchan)
|
||||
|
||||
memset(&cnStEvnt, 0, sizeof(cnStEvnt));
|
||||
|
||||
|
||||
cnStEvnt.chanId.eh.pres = PRSNT_NODEF;
|
||||
cnStEvnt.chanId.prefExc.pres = PRSNT_NODEF;
|
||||
cnStEvnt.chanId.prefExc.val = IN_PE_EXCLSVE;
|
||||
@@ -440,14 +422,8 @@ void sngisdn_snd_connect(ftdm_channel_t *ftdmchan)
|
||||
cnStEvnt.chanId.chanNmbSlotMap.len = 1;
|
||||
cnStEvnt.chanId.chanNmbSlotMap.val[0] = ftdmchan->physical_chan_id;
|
||||
}
|
||||
|
||||
cnStEvnt.progInd.eh.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.location.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.location.val = IN_LOC_USER;
|
||||
cnStEvnt.progInd.codeStand0.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.codeStand0.val = IN_CSTD_CCITT;
|
||||
cnStEvnt.progInd.progDesc.pres = PRSNT_NODEF;
|
||||
cnStEvnt.progInd.progDesc.val = IN_PD_NOTETEISDN; /* Not end-to-end ISDN */
|
||||
|
||||
set_prog_ind_ie(ftdmchan, &cnStEvnt.progInd, prog_ind);
|
||||
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending CONNECT (suId:%d suInstId:%u spInstId:%u dchan:%d ces:%d)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, signal_data->dchan_id, sngisdn_info->ces);
|
||||
if (sng_isdn_con_response(signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, &cnStEvnt, signal_data->dchan_id, sngisdn_info->ces)) {
|
||||
@@ -456,6 +432,32 @@ void sngisdn_snd_connect(ftdm_channel_t *ftdmchan)
|
||||
return;
|
||||
}
|
||||
|
||||
void sngisdn_snd_fac_req(ftdm_channel_t *ftdmchan)
|
||||
{
|
||||
FacEvnt facEvnt;
|
||||
|
||||
sngisdn_chan_data_t *sngisdn_info = (sngisdn_chan_data_t*) ftdmchan->call_data;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
|
||||
if (!sngisdn_info->suInstId || !sngisdn_info->spInstId) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Sending FACILITY, but no call data, ignoring (suId:%d suInstId:%u spInstId:%u)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId);
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&facEvnt, 0, sizeof(facEvnt));
|
||||
|
||||
set_facility_ie_str(ftdmchan, &facEvnt.facElmt.facStr.val[2], (ftdm_size_t*)&facEvnt.facElmt.facStr.len);
|
||||
|
||||
facEvnt.facElmt.facStr.val[0] = 0x1C;
|
||||
facEvnt.facElmt.facStr.val[1] = facEvnt.facElmt.facStr.len;
|
||||
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending FACILITY (suId:%d suInstId:%u spInstId:%u dchan:%d ces:%d)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, signal_data->dchan_id, sngisdn_info->ces);
|
||||
|
||||
if (sng_isdn_facility_request(signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, &facEvnt, MI_FACIL, signal_data->dchan_id, sngisdn_info->ces)) {
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_CRIT, "stack refused FACILITY request\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void sngisdn_snd_info_req(ftdm_channel_t *ftdmchan)
|
||||
{
|
||||
@@ -510,7 +512,7 @@ void sngisdn_snd_disconnect(ftdm_channel_t *ftdmchan)
|
||||
sngisdn_chan_data_t *sngisdn_info = (sngisdn_chan_data_t*) ftdmchan->call_data;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
|
||||
if (!sngisdn_info->suInstId || !sngisdn_info->spInstId) {
|
||||
if (!sngisdn_info->suInstId || !sngisdn_info->spInstId) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Sending DISCONNECT, but no call data, aborting (suId:%d suInstId:%u spInstId:%u)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId);
|
||||
|
||||
sngisdn_set_flag(sngisdn_info, FLAG_LOCAL_ABORT);
|
||||
@@ -531,6 +533,8 @@ void sngisdn_snd_disconnect(ftdm_channel_t *ftdmchan)
|
||||
discEvnt.causeDgn[0].recommend.pres = NOTPRSNT;
|
||||
discEvnt.causeDgn[0].dgnVal.pres = NOTPRSNT;
|
||||
|
||||
set_facility_ie(ftdmchan, &discEvnt.facilityStr);
|
||||
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending DISCONNECT (suId:%d suInstId:%u spInstId:%u)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId);
|
||||
if (sng_isdn_disc_request(signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, &discEvnt)) {
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_CRIT, "stack refused DISCONNECT request\n");
|
||||
@@ -575,6 +579,8 @@ void sngisdn_snd_release(ftdm_channel_t *ftdmchan, uint8_t glare)
|
||||
spInstId = sngisdn_info->spInstId;
|
||||
}
|
||||
|
||||
set_facility_ie(ftdmchan, &relEvnt.facilityStr);
|
||||
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending RELEASE/RELEASE COMPLETE (suId:%d suInstId:%u spInstId:%u)\n", signal_data->cc_id, suInstId, spInstId);
|
||||
|
||||
if (glare) {
|
||||
@@ -589,6 +595,7 @@ void sngisdn_snd_release(ftdm_channel_t *ftdmchan, uint8_t glare)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* We received an incoming frame on the d-channel, send data to the stack */
|
||||
void sngisdn_snd_data(ftdm_channel_t *dchan, uint8_t *data, ftdm_size_t len)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,15 @@
|
||||
*/
|
||||
|
||||
#include "ftmod_sangoma_isdn.h"
|
||||
#define SNGISDN_Q931_FACILITY_IE_ID 0x1C
|
||||
|
||||
/* ftmod_sangoma_isdn specific enum look-up functions */
|
||||
|
||||
SNGISDN_ENUM_NAMES(SNGISDN_PROGIND_DESCR_NAMES, SNGISDN_PROGIND_DESCR_STRINGS)
|
||||
SNGISDN_STR2ENUM(ftdm_str2ftdm_sngisdn_progind_descr, ftdm_sngisdn_progind_descr2str, ftdm_sngisdn_progind_descr_t, SNGISDN_PROGIND_DESCR_NAMES, SNGISDN_PROGIND_DESCR_INVALID)
|
||||
|
||||
SNGISDN_ENUM_NAMES(SNGISDN_PROGIND_LOC_NAMES, SNGISDN_PROGIND_LOC_STRINGS)
|
||||
SNGISDN_STR2ENUM(ftdm_str2ftdm_sngisdn_progind_loc, ftdm_sngisdn_progind_loc2str, ftdm_sngisdn_progind_loc_t, SNGISDN_PROGIND_LOC_NAMES, SNGISDN_PROGIND_LOC_INVALID)
|
||||
|
||||
ftdm_status_t sngisdn_check_free_ids(void);
|
||||
|
||||
@@ -129,7 +138,6 @@ ftdm_status_t get_ftdmchan_by_spInstId(int16_t cc_id, uint32_t spInstId, sngisdn
|
||||
|
||||
ftdm_status_t sngisdn_set_avail_rate(ftdm_span_t *span, sngisdn_avail_t avail)
|
||||
{
|
||||
|
||||
if (span->trunk_type == FTDM_TRUNK_BRI ||
|
||||
span->trunk_type == FTDM_TRUNK_BRI_PTMP) {
|
||||
|
||||
@@ -147,77 +155,84 @@ ftdm_status_t sngisdn_set_avail_rate(ftdm_span_t *span, sngisdn_avail_t avail)
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t cpy_calling_num_from_stack(ftdm_caller_data_t *ftdm, CgPtyNmb *cgPtyNmb)
|
||||
ftdm_status_t get_calling_num(ftdm_channel_t *ftdmchan, CgPtyNmb *cgPtyNmb)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
if (cgPtyNmb->eh.pres != PRSNT_NODEF) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
if (cgPtyNmb->screenInd.pres == PRSNT_NODEF) {
|
||||
ftdm->screen = cgPtyNmb->screenInd.val;
|
||||
caller_data->screen = cgPtyNmb->screenInd.val;
|
||||
}
|
||||
|
||||
if (cgPtyNmb->presInd0.pres == PRSNT_NODEF) {
|
||||
ftdm->pres = cgPtyNmb->presInd0.val;
|
||||
caller_data->pres = cgPtyNmb->presInd0.val;
|
||||
}
|
||||
|
||||
if (cgPtyNmb->nmbPlanId.pres == PRSNT_NODEF) {
|
||||
ftdm->cid_num.plan = cgPtyNmb->nmbPlanId.val;
|
||||
caller_data->cid_num.plan = cgPtyNmb->nmbPlanId.val;
|
||||
}
|
||||
|
||||
if (cgPtyNmb->typeNmb1.pres == PRSNT_NODEF) {
|
||||
ftdm->cid_num.type = cgPtyNmb->typeNmb1.val;
|
||||
caller_data->cid_num.type = cgPtyNmb->typeNmb1.val;
|
||||
}
|
||||
|
||||
if (cgPtyNmb->nmbDigits.pres == PRSNT_NODEF) {
|
||||
ftdm_copy_string(ftdm->cid_num.digits, (const char*)cgPtyNmb->nmbDigits.val, cgPtyNmb->nmbDigits.len+1);
|
||||
ftdm_copy_string(caller_data->cid_num.digits, (const char*)cgPtyNmb->nmbDigits.val, cgPtyNmb->nmbDigits.len+1);
|
||||
}
|
||||
memcpy(&caller_data->ani, &caller_data->cid_num, sizeof(caller_data->ani));
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t cpy_called_num_from_stack(ftdm_caller_data_t *ftdm, CdPtyNmb *cdPtyNmb)
|
||||
ftdm_status_t get_called_num(ftdm_channel_t *ftdmchan, CdPtyNmb *cdPtyNmb)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
if (cdPtyNmb->eh.pres != PRSNT_NODEF) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
if (cdPtyNmb->nmbPlanId.pres == PRSNT_NODEF) {
|
||||
ftdm->dnis.plan = cdPtyNmb->nmbPlanId.val;
|
||||
caller_data->dnis.plan = cdPtyNmb->nmbPlanId.val;
|
||||
}
|
||||
|
||||
if (cdPtyNmb->typeNmb0.pres == PRSNT_NODEF) {
|
||||
ftdm->dnis.type = cdPtyNmb->typeNmb0.val;
|
||||
caller_data->dnis.type = cdPtyNmb->typeNmb0.val;
|
||||
}
|
||||
|
||||
if (cdPtyNmb->nmbDigits.pres == PRSNT_NODEF) {
|
||||
unsigned i = strlen(ftdm->dnis.digits);
|
||||
/* In overlap receive mode, append the new digits to the existing dnis */
|
||||
unsigned i = strlen(caller_data->dnis.digits);
|
||||
|
||||
ftdm_copy_string(&ftdm->dnis.digits[i], (const char*)cdPtyNmb->nmbDigits.val, cdPtyNmb->nmbDigits.len+1);
|
||||
ftdm_copy_string(&caller_data->dnis.digits[i], (const char*)cdPtyNmb->nmbDigits.val, cdPtyNmb->nmbDigits.len+1);
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t cpy_redir_num_from_stack(ftdm_caller_data_t *ftdm, RedirNmb *redirNmb)
|
||||
ftdm_status_t get_redir_num(ftdm_channel_t *ftdmchan, RedirNmb *redirNmb)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
if (redirNmb->eh.pres != PRSNT_NODEF) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
if (redirNmb->nmbPlanId.pres == PRSNT_NODEF) {
|
||||
ftdm->rdnis.plan = redirNmb->nmbPlanId.val;
|
||||
caller_data->rdnis.plan = redirNmb->nmbPlanId.val;
|
||||
}
|
||||
|
||||
if (redirNmb->typeNmb.pres == PRSNT_NODEF) {
|
||||
ftdm->rdnis.type = redirNmb->typeNmb.val;
|
||||
caller_data->rdnis.type = redirNmb->typeNmb.val;
|
||||
}
|
||||
|
||||
if (redirNmb->nmbDigits.pres == PRSNT_NODEF) {
|
||||
ftdm_copy_string(ftdm->rdnis.digits, (const char*)redirNmb->nmbDigits.val, redirNmb->nmbDigits.len+1);
|
||||
ftdm_copy_string(caller_data->rdnis.digits, (const char*)redirNmb->nmbDigits.val, redirNmb->nmbDigits.len+1);
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t cpy_calling_name_from_stack(ftdm_caller_data_t *ftdm, Display *display)
|
||||
ftdm_status_t get_calling_name_from_display(ftdm_channel_t *ftdmchan, Display *display)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
if (display->eh.pres != PRSNT_NODEF) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
@@ -225,71 +240,209 @@ ftdm_status_t cpy_calling_name_from_stack(ftdm_caller_data_t *ftdm, Display *dis
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
ftdm_copy_string(ftdm->cid_name, (const char*)display->dispInfo.val, display->dispInfo.len+1);
|
||||
ftdm_copy_string(caller_data->cid_name, (const char*)display->dispInfo.val, display->dispInfo.len+1);
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t cpy_calling_num_from_user(CgPtyNmb *cgPtyNmb, ftdm_caller_data_t *ftdm)
|
||||
ftdm_status_t get_calling_name_from_usr_usr(ftdm_channel_t *ftdmchan, UsrUsr *usrUsr)
|
||||
{
|
||||
uint8_t len = strlen(ftdm->cid_num.digits);
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
if (usrUsr->eh.pres != PRSNT_NODEF) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
if (usrUsr->protocolDisc.val != PD_IA5) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
if (usrUsr->usrInfo.pres != PRSNT_NODEF) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
ftdm_copy_string(caller_data->cid_name, (const char*)usrUsr->usrInfo.val, usrUsr->usrInfo.len+1);
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t get_calling_subaddr(ftdm_channel_t *ftdmchan, CgPtySad *cgPtySad)
|
||||
{
|
||||
char subaddress[100];
|
||||
|
||||
if (cgPtySad->eh.pres != PRSNT_NODEF) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
memset(subaddress, 0, sizeof(subaddress));
|
||||
if(cgPtySad->sadInfo.len >= sizeof(subaddress)) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Calling Party Subaddress exceeds local size limit (len:%d max:%d)\n", cgPtySad->sadInfo.len, sizeof(subaddress));
|
||||
cgPtySad->sadInfo.len = sizeof(subaddress)-1;
|
||||
}
|
||||
|
||||
memcpy(subaddress, (char*)cgPtySad->sadInfo.val, cgPtySad->sadInfo.len);
|
||||
subaddress[cgPtySad->sadInfo.len] = '\0';
|
||||
ftdm_channel_add_var(ftdmchan, "isdn.calling_subaddr", subaddress);
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t get_facility_ie(ftdm_channel_t *ftdmchan, FacilityStr *facilityStr)
|
||||
{
|
||||
if (!facilityStr->eh.pres) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
return get_facility_ie_str(ftdmchan, facilityStr->facilityStr.val, facilityStr->facilityStr.len);
|
||||
}
|
||||
|
||||
ftdm_status_t get_facility_ie_str(ftdm_channel_t *ftdmchan, uint8_t *data, ftdm_size_t data_len)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
if (data_len > sizeof(caller_data->raw_data)-2) {
|
||||
ftdm_log(FTDM_LOG_CRIT, "Length of Facility IE exceeds maximum length\n");
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
memset(caller_data->raw_data, 0, sizeof(caller_data->raw_data));
|
||||
/* Always include Facility IE identifier + len so this can be used as a sanity check by the user */
|
||||
caller_data->raw_data[0] = SNGISDN_Q931_FACILITY_IE_ID;
|
||||
caller_data->raw_data[1] = data_len;
|
||||
|
||||
memcpy(&caller_data->raw_data[2], data, data_len);
|
||||
caller_data->raw_data_len = data_len+2;
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t get_prog_ind_ie(ftdm_channel_t *ftdmchan, ProgInd *progInd)
|
||||
{
|
||||
uint8_t val;
|
||||
if (!progInd->eh.pres) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
if (progInd->progDesc.pres) {
|
||||
switch (progInd->progDesc.val) {
|
||||
case IN_PD_NOTETEISDN:
|
||||
val = SNGISDN_PROGIND_DESCR_NETE_ISDN;
|
||||
break;
|
||||
case IN_PD_DSTNOTISDN:
|
||||
val = SNGISDN_PROGIND_DESCR_DEST_NISDN;
|
||||
break;
|
||||
case IN_PD_ORGNOTISDN:
|
||||
val = SNGISDN_PROGIND_DESCR_ORIG_NISDN;
|
||||
break;
|
||||
case IN_PD_CALLRET:
|
||||
val = SNGISDN_PROGIND_DESCR_RET_ISDN;
|
||||
break;
|
||||
case IN_PD_DELRESP:
|
||||
val = SNGISDN_PROGIND_DESCR_SERV_CHANGE;
|
||||
break;
|
||||
case IN_PD_IBAVAIL:
|
||||
val = SNGISDN_PROGIND_DESCR_IB_AVAIL;
|
||||
break;
|
||||
default:
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Unknown Progress Indicator Description (%d)\n", progInd->progDesc.val);
|
||||
val = SNGISDN_PROGIND_DESCR_INVALID;
|
||||
break;
|
||||
}
|
||||
ftdm_channel_add_var(ftdmchan, "isdn.prog_ind.descr", ftdm_sngisdn_progind_descr2str(val));
|
||||
}
|
||||
|
||||
if (progInd->location.pres) {
|
||||
switch (progInd->location.val) {
|
||||
case IN_LOC_USER:
|
||||
val = SNGISDN_PROGIND_LOC_USER;
|
||||
break;
|
||||
case IN_LOC_PRIVNETLU:
|
||||
val = SNGISDN_PROGIND_LOC_PRIV_NET_LOCAL_USR;
|
||||
break;
|
||||
case IN_LOC_PUBNETLU:
|
||||
val = SNGISDN_PROGIND_LOC_PUB_NET_LOCAL_USR;
|
||||
break;
|
||||
case IN_LOC_TRANNET:
|
||||
val = SNGISDN_PROGIND_LOC_TRANSIT_NET;
|
||||
break;
|
||||
case IN_LOC_PUBNETRU:
|
||||
val = SNGISDN_PROGIND_LOC_PUB_NET_REMOTE_USR;
|
||||
break;
|
||||
case IN_LOC_PRIVNETRU:
|
||||
val = SNGISDN_PROGIND_LOC_PRIV_NET_REMOTE_USR;
|
||||
break;
|
||||
case IN_LOC_NETINTER:
|
||||
val = SNGISDN_PROGIND_LOC_NET_BEYOND_INTRW;
|
||||
break;
|
||||
default:
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Unknown Progress Indicator Location (%d)", progInd->location.val);
|
||||
val = SNGISDN_PROGIND_LOC_INVALID;
|
||||
break;
|
||||
}
|
||||
ftdm_channel_add_var(ftdmchan, "isdn.prog_ind.loc", ftdm_sngisdn_progind_loc2str(val));
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ftdm_status_t set_calling_num(ftdm_channel_t *ftdmchan, CgPtyNmb *cgPtyNmb)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
uint8_t len = strlen(caller_data->cid_num.digits);
|
||||
if (!len) {
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
cgPtyNmb->eh.pres = PRSNT_NODEF;
|
||||
|
||||
cgPtyNmb->screenInd.pres = PRSNT_NODEF;
|
||||
cgPtyNmb->screenInd.val = ftdm->screen;
|
||||
cgPtyNmb->screenInd.val = caller_data->screen;
|
||||
|
||||
cgPtyNmb->presInd0.pres = PRSNT_NODEF;
|
||||
cgPtyNmb->presInd0.val = ftdm->pres;
|
||||
|
||||
cgPtyNmb->presInd0.val = caller_data->pres;
|
||||
|
||||
cgPtyNmb->nmbPlanId.pres = PRSNT_NODEF;
|
||||
cgPtyNmb->nmbPlanId.val = ftdm->cid_num.plan;
|
||||
cgPtyNmb->nmbPlanId.val = caller_data->cid_num.plan;
|
||||
|
||||
cgPtyNmb->typeNmb1.pres = PRSNT_NODEF;
|
||||
cgPtyNmb->typeNmb1.val = ftdm->cid_num.type;
|
||||
cgPtyNmb->typeNmb1.val = caller_data->cid_num.type;
|
||||
|
||||
cgPtyNmb->nmbDigits.pres = PRSNT_NODEF;
|
||||
cgPtyNmb->nmbDigits.len = len;
|
||||
|
||||
memcpy(cgPtyNmb->nmbDigits.val, ftdm->cid_num.digits, len);
|
||||
memcpy(cgPtyNmb->nmbDigits.val, caller_data->cid_num.digits, len);
|
||||
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t cpy_called_num_from_user(CdPtyNmb *cdPtyNmb, ftdm_caller_data_t *ftdm)
|
||||
ftdm_status_t set_called_num(ftdm_channel_t *ftdmchan, CdPtyNmb *cdPtyNmb)
|
||||
{
|
||||
uint8_t len = strlen(ftdm->dnis.digits);
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
uint8_t len = strlen(caller_data->dnis.digits);
|
||||
|
||||
if (!len) {
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
cdPtyNmb->eh.pres = PRSNT_NODEF;
|
||||
|
||||
cdPtyNmb->nmbPlanId.pres = PRSNT_NODEF;
|
||||
if (ftdm->dnis.plan == FTDM_NPI_INVALID) {
|
||||
if (caller_data->dnis.plan == FTDM_NPI_INVALID) {
|
||||
cdPtyNmb->nmbPlanId.val = FTDM_NPI_UNKNOWN;
|
||||
} else {
|
||||
cdPtyNmb->nmbPlanId.val = ftdm->dnis.plan;
|
||||
cdPtyNmb->nmbPlanId.val = caller_data->dnis.plan;
|
||||
}
|
||||
|
||||
cdPtyNmb->typeNmb0.pres = PRSNT_NODEF;
|
||||
if (ftdm->dnis.type == FTDM_TON_INVALID) {
|
||||
if (caller_data->dnis.type == FTDM_TON_INVALID) {
|
||||
cdPtyNmb->typeNmb0.val = FTDM_TON_UNKNOWN;
|
||||
} else {
|
||||
cdPtyNmb->typeNmb0.val = ftdm->dnis.type;
|
||||
cdPtyNmb->typeNmb0.val = caller_data->dnis.type;
|
||||
}
|
||||
|
||||
cdPtyNmb->nmbDigits.pres = PRSNT_NODEF;
|
||||
cdPtyNmb->nmbDigits.len = len;
|
||||
|
||||
|
||||
memcpy(cdPtyNmb->nmbDigits.val, ftdm->dnis.digits, len);
|
||||
memcpy(cdPtyNmb->nmbDigits.val, caller_data->dnis.digits, len);
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t cpy_redir_num_from_user(RedirNmb *redirNmb, ftdm_caller_data_t *ftdm)
|
||||
ftdm_status_t set_redir_num(ftdm_channel_t *ftdmchan, RedirNmb *redirNmb)
|
||||
{
|
||||
uint8_t len = strlen(ftdm->rdnis.digits);
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
uint8_t len = strlen(caller_data->rdnis.digits);
|
||||
if (!len) {
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
@@ -297,36 +450,36 @@ ftdm_status_t cpy_redir_num_from_user(RedirNmb *redirNmb, ftdm_caller_data_t *ft
|
||||
redirNmb->eh.pres = PRSNT_NODEF;
|
||||
|
||||
redirNmb->nmbPlanId.pres = PRSNT_NODEF;
|
||||
if (ftdm->rdnis.plan == FTDM_NPI_INVALID) {
|
||||
if (caller_data->rdnis.plan == FTDM_NPI_INVALID) {
|
||||
redirNmb->nmbPlanId.val = FTDM_NPI_UNKNOWN;
|
||||
} else {
|
||||
redirNmb->nmbPlanId.val = ftdm->rdnis.plan;
|
||||
redirNmb->nmbPlanId.val = caller_data->rdnis.plan;
|
||||
}
|
||||
|
||||
redirNmb->typeNmb.pres = PRSNT_NODEF;
|
||||
if (ftdm->rdnis.type == FTDM_TON_INVALID) {
|
||||
if (caller_data->rdnis.type == FTDM_TON_INVALID) {
|
||||
redirNmb->typeNmb.val = FTDM_TON_UNKNOWN;
|
||||
} else {
|
||||
redirNmb->typeNmb.val = ftdm->rdnis.type;
|
||||
redirNmb->typeNmb.val = caller_data->rdnis.type;
|
||||
}
|
||||
|
||||
redirNmb->nmbDigits.pres = PRSNT_NODEF;
|
||||
redirNmb->nmbDigits.len = len;
|
||||
|
||||
memcpy(redirNmb->nmbDigits.val, ftdm->rdnis.digits, len);
|
||||
memcpy(redirNmb->nmbDigits.val, caller_data->rdnis.digits, len);
|
||||
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ftdm_status_t cpy_calling_name_from_user(ConEvnt *conEvnt, ftdm_channel_t *ftdmchan)
|
||||
ftdm_status_t set_calling_name(ftdm_channel_t *ftdmchan, ConEvnt *conEvnt)
|
||||
{
|
||||
uint8_t len;
|
||||
ftdm_caller_data_t *ftdm = &ftdmchan->caller_data;
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
/* sngisdn_chan_data_t *sngisdn_info = ftdmchan->call_data; */
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
|
||||
len = strlen(ftdm->cid_name);
|
||||
len = strlen(caller_data->cid_name);
|
||||
if (!len) {
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
@@ -341,7 +494,7 @@ ftdm_status_t cpy_calling_name_from_user(ConEvnt *conEvnt, ftdm_channel_t *ftdmc
|
||||
conEvnt->usrUsr.usrInfo.len = len;
|
||||
/* in sangoma_brid we used to send usr-usr info as <cid_name>!<calling_number>,
|
||||
change to previous style if current one does not work */
|
||||
memcpy(conEvnt->usrUsr.usrInfo.val, ftdm->cid_name, len);
|
||||
memcpy(conEvnt->usrUsr.usrInfo.val, caller_data->cid_name, len);
|
||||
} else {
|
||||
switch (signal_data->switchtype) {
|
||||
case SNGISDN_SWITCH_NI2:
|
||||
@@ -359,7 +512,7 @@ ftdm_status_t cpy_calling_name_from_user(ConEvnt *conEvnt, ftdm_channel_t *ftdmc
|
||||
conEvnt->display.eh.pres = PRSNT_NODEF;
|
||||
conEvnt->display.dispInfo.pres = PRSNT_NODEF;
|
||||
conEvnt->display.dispInfo.len = len;
|
||||
memcpy(conEvnt->display.dispInfo.val, ftdm->cid_name, len);
|
||||
memcpy(conEvnt->display.dispInfo.val, caller_data->cid_name, len);
|
||||
break;
|
||||
case SNGISDN_SWITCH_QSIG:
|
||||
/* It seems like QSIG does not support Caller ID Name */
|
||||
@@ -372,6 +525,139 @@ ftdm_status_t cpy_calling_name_from_user(ConEvnt *conEvnt, ftdm_channel_t *ftdmc
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t set_calling_subaddr(ftdm_channel_t *ftdmchan, CgPtySad *cgPtySad)
|
||||
{
|
||||
const char* clg_subaddr = NULL;
|
||||
clg_subaddr = ftdm_channel_get_var(ftdmchan, "isdn.calling_subaddr");
|
||||
if ((clg_subaddr != NULL) && (*clg_subaddr)) {
|
||||
unsigned len = strlen (clg_subaddr);
|
||||
cgPtySad->eh.pres = PRSNT_NODEF;
|
||||
cgPtySad->typeSad.pres = 1;
|
||||
cgPtySad->typeSad.val = 0; /* NSAP */
|
||||
cgPtySad->oddEvenInd.pres = 1;
|
||||
cgPtySad->oddEvenInd.val = 0;
|
||||
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Sending Calling Party Subaddress:%s\n", clg_subaddr);
|
||||
cgPtySad->sadInfo.pres = 1;
|
||||
cgPtySad->sadInfo.len = len;
|
||||
memcpy(cgPtySad->sadInfo.val, clg_subaddr, len);
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ftdm_status_t set_facility_ie(ftdm_channel_t *ftdmchan, FacilityStr *facilityStr)
|
||||
{
|
||||
ftdm_status_t status;
|
||||
status = set_facility_ie_str(ftdmchan, facilityStr->facilityStr.val, (ftdm_size_t*)&facilityStr->facilityStr.len);
|
||||
if (status == FTDM_SUCCESS) {
|
||||
facilityStr->eh.pres = PRSNT_NODEF;
|
||||
facilityStr->facilityStr.pres = PRSNT_NODEF;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
ftdm_status_t set_facility_ie_str(ftdm_channel_t *ftdmchan, uint8_t *data, ftdm_size_t *data_len)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
|
||||
if (caller_data->raw_data_len > 0 && caller_data->raw_data[0] == SNGISDN_Q931_FACILITY_IE_ID) {
|
||||
|
||||
*data_len = caller_data->raw_data[1];
|
||||
memcpy(data, &caller_data->raw_data[2], *data_len);
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
ftdm_status_t set_prog_ind_ie(ftdm_channel_t *ftdmchan, ProgInd *progInd, ftdm_sngisdn_progind_t prog_ind)
|
||||
{
|
||||
const char *str = NULL;
|
||||
int descr = prog_ind.descr;
|
||||
int loc = prog_ind.loc;
|
||||
|
||||
str = ftdm_channel_get_var(ftdmchan, "isdn.prog_ind.descr");
|
||||
if (str && *str) {
|
||||
/* User wants to override progress indicator */
|
||||
descr = ftdm_str2ftdm_sngisdn_progind_descr(str);
|
||||
}
|
||||
|
||||
if (descr == SNGISDN_PROGIND_DESCR_INVALID) {
|
||||
/* User does not want to send progress indicator */
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
str = ftdm_channel_get_var(ftdmchan, "isdn.prog_ind.loc");
|
||||
if (str && *str) {
|
||||
loc = ftdm_str2ftdm_sngisdn_progind_loc(str);
|
||||
}
|
||||
if (loc == SNGISDN_PROGIND_LOC_INVALID) {
|
||||
loc = SNGISDN_PROGIND_LOC_USER;
|
||||
}
|
||||
|
||||
progInd->eh.pres = PRSNT_NODEF;
|
||||
progInd->codeStand0.pres = PRSNT_NODEF;
|
||||
progInd->codeStand0.val = IN_CSTD_CCITT;
|
||||
|
||||
progInd->progDesc.pres = PRSNT_NODEF;
|
||||
switch(descr) {
|
||||
case SNGISDN_PROGIND_DESCR_NETE_ISDN:
|
||||
progInd->progDesc.val = IN_PD_NOTETEISDN;
|
||||
break;
|
||||
case SNGISDN_PROGIND_DESCR_DEST_NISDN:
|
||||
progInd->progDesc.val = IN_PD_DSTNOTISDN;
|
||||
break;
|
||||
case SNGISDN_PROGIND_DESCR_ORIG_NISDN:
|
||||
progInd->progDesc.val = IN_PD_ORGNOTISDN;
|
||||
break;
|
||||
case SNGISDN_PROGIND_DESCR_RET_ISDN:
|
||||
progInd->progDesc.val = IN_PD_CALLRET;
|
||||
break;
|
||||
case SNGISDN_PROGIND_DESCR_SERV_CHANGE:
|
||||
/* Trillium defines do not match ITU-T Q931 Progress descriptions,
|
||||
indicate a delayed response for now */
|
||||
progInd->progDesc.val = IN_PD_DELRESP;
|
||||
break;
|
||||
case SNGISDN_PROGIND_DESCR_IB_AVAIL:
|
||||
progInd->progDesc.val = IN_PD_IBAVAIL;
|
||||
break;
|
||||
default:
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid prog_ind description:%d\n", descr);
|
||||
progInd->progDesc.val = IN_PD_NOTETEISDN;
|
||||
break;
|
||||
}
|
||||
|
||||
progInd->location.pres = PRSNT_NODEF;
|
||||
switch (loc) {
|
||||
case SNGISDN_PROGIND_LOC_USER:
|
||||
progInd->location.val = IN_LOC_USER;
|
||||
break;
|
||||
case SNGISDN_PROGIND_LOC_PRIV_NET_LOCAL_USR:
|
||||
progInd->location.val = IN_LOC_PRIVNETLU;
|
||||
break;
|
||||
case SNGISDN_PROGIND_LOC_PUB_NET_LOCAL_USR:
|
||||
progInd->location.val = IN_LOC_PUBNETLU;
|
||||
break;
|
||||
case SNGISDN_PROGIND_LOC_TRANSIT_NET:
|
||||
progInd->location.val = IN_LOC_TRANNET;
|
||||
break;
|
||||
case SNGISDN_PROGIND_LOC_PUB_NET_REMOTE_USR:
|
||||
progInd->location.val = IN_LOC_PUBNETRU;
|
||||
break;
|
||||
case SNGISDN_PROGIND_LOC_PRIV_NET_REMOTE_USR:
|
||||
progInd->location.val = IN_LOC_PRIVNETRU;
|
||||
break;
|
||||
case SNGISDN_PROGIND_LOC_NET_BEYOND_INTRW:
|
||||
progInd->location.val = IN_LOC_NETINTER;
|
||||
break;
|
||||
default:
|
||||
ftdm_log(FTDM_LOG_WARNING, "Invalid prog_ind location:%d\n", loc);
|
||||
progInd->location.val = IN_PD_NOTETEISDN;
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void sngisdn_t3_timeout(void* p_sngisdn_info)
|
||||
{
|
||||
sngisdn_chan_data_t *sngisdn_info = (sngisdn_chan_data_t*)p_sngisdn_info;
|
||||
@@ -528,13 +814,12 @@ uint8_t sngisdn_get_infoTranCap_from_stack(ftdm_bearer_cap_t bearer_capability)
|
||||
switch(bearer_capability) {
|
||||
case FTDM_BEARER_CAP_SPEECH:
|
||||
return IN_ITC_SPEECH;
|
||||
|
||||
case FTDM_BEARER_CAP_64K_UNRESTRICTED:
|
||||
return IN_ITC_UNRDIG;
|
||||
|
||||
case FTDM_BEARER_CAP_3_1KHZ_AUDIO:
|
||||
return IN_ITC_A31KHZ;
|
||||
|
||||
case FTDM_BEARER_CAP_INVALID:
|
||||
return IN_ITC_SPEECH;
|
||||
/* Do not put a default case here, so we can see compile warnings if we have unhandled cases */
|
||||
}
|
||||
return FTDM_BEARER_CAP_SPEECH;
|
||||
@@ -545,13 +830,12 @@ uint8_t sngisdn_get_usrInfoLyr1Prot_from_stack(ftdm_user_layer1_prot_t layer1_pr
|
||||
switch(layer1_prot) {
|
||||
case FTDM_USER_LAYER1_PROT_V110:
|
||||
return IN_UIL1_CCITTV110;
|
||||
|
||||
case FTDM_USER_LAYER1_PROT_ULAW:
|
||||
return IN_UIL1_G711ULAW;
|
||||
|
||||
case FTDM_USER_LAYER1_PROT_ALAW:
|
||||
return IN_UIL1_G711ALAW;
|
||||
|
||||
case FTDM_USER_LAYER1_PROT_INVALID:
|
||||
return IN_UIL1_G711ULAW;
|
||||
/* Do not put a default case here, so we can see compile warnings if we have unhandled cases */
|
||||
}
|
||||
return IN_UIL1_G711ULAW;
|
||||
|
||||
@@ -613,6 +613,21 @@ uint32_t sngisdn_decode_ie(char *str, uint32_t *str_len, uint8_t current_codeset
|
||||
return 0;
|
||||
break;
|
||||
case PROT_Q931_IE_CALLED_PARTY_SUBADDRESS:
|
||||
{
|
||||
uint8_t type;
|
||||
uint8_t currentOct, j=0;
|
||||
char calling_subaddr_string[82];
|
||||
memset(calling_subaddr_string, 0, sizeof(calling_subaddr_string));
|
||||
type = get_bits(OCTET(3),5,7);
|
||||
currentOct = 3;
|
||||
while(currentOct++ <= len+1) {
|
||||
calling_subaddr_string[j++]=ia5[get_bits(OCTET(currentOct),1,4)][get_bits(OCTET(currentOct),5,8)];
|
||||
}
|
||||
calling_subaddr_string[j++]='\0';
|
||||
*str_len += sprintf(&str[*str_len], "%s (l:%d) type:%s(%d) \n",
|
||||
calling_subaddr_string, (j-1), get_code_2_str(type, dcodQ931TypeOfSubaddressTable), type);
|
||||
}
|
||||
break;
|
||||
case PROT_Q931_IE_REDIRECTION_NUMBER:
|
||||
case PROT_Q931_IE_NOTIFICATION_IND:
|
||||
case PROT_Q931_IE_DATE_TIME:
|
||||
|
||||
@@ -544,5 +544,11 @@ struct code2str dcodQ931GenDigitsTypeTable[] = {
|
||||
{-1, "Invalid"},
|
||||
};
|
||||
|
||||
struct code2str dcodQ931TypeOfSubaddressTable[] = {
|
||||
{ 0x00, "NSAP"},
|
||||
{ 0x02, "User-specified"},
|
||||
{ -1, "Invalid"},
|
||||
};
|
||||
|
||||
#endif /* __FTMOD_SANGOMA_ISDN_TRACE_H__ */
|
||||
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>ftmod_wanpipe</ProjectName>
|
||||
<ProjectGuid>{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}</ProjectGuid>
|
||||
<RootNamespace>ftmod_wanpipe</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../include;C:\Program Files\Sangoma\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;libsangoma.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);C:\Program Files\Sangoma\api\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../include;C:\Program Files\Sangoma\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;libsangoma.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);C:\Program Files\Sangoma\api\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../include;C:\Program Files\Sangoma\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;libsangoma.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);C:\Program Files\Sangoma\api\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../include;C:\Program Files\Sangoma\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>freetdm.lib;libsangoma.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);C:\Program Files\Sangoma\api\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_wanpipe.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\msvc\freetdm.2010.vcxproj">
|
||||
<Project>{93b8812c-3ec4-4f78-8970-ffbfc99e167d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ftmod_wanpipe.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -123,6 +123,10 @@ static __inline__ int tdmv_api_wait_socket(ftdm_channel_t *ftdmchan, int timeout
|
||||
uint32_t outflags = 0;
|
||||
sangoma_wait_obj_t *sangoma_wait_obj = ftdmchan->io_data;
|
||||
|
||||
if (timeout == -1) {
|
||||
timeout = SANGOMA_WAIT_INFINITE;
|
||||
}
|
||||
|
||||
err = sangoma_waitfor(sangoma_wait_obj, inflags, &outflags, timeout);
|
||||
*flags = 0;
|
||||
if (err == SANG_STATUS_SUCCESS) {
|
||||
@@ -789,10 +793,11 @@ static void wanpipe_write_stats(ftdm_channel_t *ftdmchan, wp_tdm_api_tx_hdr_t *t
|
||||
ftdmchan->iostats.tx.queue_size = tx_stats->wp_api_tx_hdr_max_queue_length;
|
||||
ftdmchan->iostats.tx.queue_len = tx_stats->wp_api_tx_hdr_number_of_frames_in_queue;
|
||||
|
||||
if (ftdmchan->iostats.tx.queue_len >= ftdmchan->iostats.rx.queue_size) {
|
||||
/* we don't test for 80% full in tx since is typically full for voice channels, should we test tx 80% full for D-channels? */
|
||||
if (ftdmchan->iostats.tx.queue_len >= ftdmchan->iostats.tx.queue_size) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_CRIT, "Tx Queue Full (%d/%d)\n",
|
||||
ftdmchan->iostats.rx.queue_len, ftdmchan->iostats.rx.queue_size);
|
||||
ftdm_set_flag(&(ftdmchan->iostats.rx), FTDM_IOSTATS_ERROR_QUEUE_FULL);
|
||||
ftdmchan->iostats.rx.queue_len, ftdmchan->iostats.tx.queue_size);
|
||||
ftdm_set_flag(&(ftdmchan->iostats.tx), FTDM_IOSTATS_ERROR_QUEUE_FULL);
|
||||
} else if (ftdm_test_flag(&(ftdmchan->iostats.tx), FTDM_IOSTATS_ERROR_QUEUE_FULL)){
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_NOTICE, "Tx Queue no longer full (%d/%d)\n",
|
||||
ftdmchan->iostats.tx.queue_len, ftdmchan->iostats.tx.queue_size);
|
||||
@@ -801,7 +806,10 @@ static void wanpipe_write_stats(ftdm_channel_t *ftdmchan, wp_tdm_api_tx_hdr_t *t
|
||||
|
||||
if (ftdmchan->iostats.tx.idle_packets < tx_stats->wp_api_tx_hdr_number_of_frames_in_queue) {
|
||||
ftdmchan->iostats.tx.idle_packets = tx_stats->wp_api_tx_hdr_tx_idle_packets;
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Tx idle: %d\n", ftdmchan->iostats.tx.idle_packets);
|
||||
/* HDLC channels do not always transmit, so its ok for drivers to fill with idle */
|
||||
if (FTDM_IS_VOICE_CHANNEL(ftdmchan)) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Tx idle: %d\n", ftdmchan->iostats.tx.idle_packets);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ftdmchan->iostats.tx.packets) {
|
||||
@@ -850,6 +858,16 @@ static void wanpipe_read_stats(ftdm_channel_t *ftdmchan, wp_tdm_api_rx_hdr_t *rx
|
||||
ftdm_clear_flag(&(ftdmchan->iostats.rx), FTDM_IOSTATS_ERROR_FRAME);
|
||||
}
|
||||
|
||||
if (ftdmchan->iostats.rx.queue_len >= (0.8 * ftdmchan->iostats.rx.queue_size)) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Rx Queue length exceeded 80% threshold (%d/%d)\n",
|
||||
ftdmchan->iostats.rx.queue_len, ftdmchan->iostats.rx.queue_size);
|
||||
ftdm_set_flag(&(ftdmchan->iostats.rx), FTDM_IOSTATS_ERROR_QUEUE_THRES);
|
||||
} else if (ftdm_test_flag(&(ftdmchan->iostats.rx), FTDM_IOSTATS_ERROR_QUEUE_THRES)){
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_NOTICE, "Rx Queue length reduced 80% threshold (%d/%d)\n",
|
||||
ftdmchan->iostats.rx.queue_len, ftdmchan->iostats.rx.queue_size);
|
||||
ftdm_clear_flag(&(ftdmchan->iostats.rx), FTDM_IOSTATS_ERROR_QUEUE_THRES);
|
||||
}
|
||||
|
||||
if (ftdmchan->iostats.rx.queue_len >= ftdmchan->iostats.rx.queue_size) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_CRIT, "Rx Queue Full (%d/%d)\n",
|
||||
ftdmchan->iostats.rx.queue_len, ftdmchan->iostats.rx.queue_size);
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="ftmod_wanpipe"
|
||||
ProjectGUID="{1A145EE9-BBD8-45E5-98CD-EB4BE99E1DCD}"
|
||||
RootNamespace="ftmod_wanpipe"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;../../../wanpipe/include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="freetdm.lib libsangoma.lib"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""$(OutDir)";../../../wanpipe/api/lib/x86"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;../../../wanpipe/include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="freetdm.lib libsangoma.lib"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""$(OutDir)";../../../wanpipe/api/lib/x86"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\ftmod_wanpipe.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,351 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* wanpipe_tdm_api_iface.h
|
||||
*
|
||||
* WANPIPE(tm) AFT TE1 Hardware Support
|
||||
*
|
||||
* Authors: Nenad Corbic <ncorbic@sangoma.com>
|
||||
*
|
||||
* Copyright (c) 2007 - 08, Sangoma Technologies
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
* ============================================================================
|
||||
* Oct 04, 2005 Nenad Corbic Initial version.
|
||||
*
|
||||
* Jul 25, 2006 David Rokhvarg <davidr@sangoma.com> Ported to Windows.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __WANPIPE_TDM_API_IFACE_H_
|
||||
#define __WANPIPE_TDM_API_IFACE_H_
|
||||
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
typedef HANDLE sng_fd_t;
|
||||
#else
|
||||
typedef int sng_fd_t;
|
||||
#endif
|
||||
|
||||
/* Indicate to library that new features exist */
|
||||
#define WP_TDM_FEATURE_DTMF_EVENTS 1
|
||||
#define WP_TDM_FEATURE_FE_ALARM 1
|
||||
#define WP_TDM_FEATURE_EVENTS 1
|
||||
#define WP_TDM_FEATURE_LINK_STATUS 1
|
||||
|
||||
enum wanpipe_tdm_api_cmds {
|
||||
|
||||
SIOC_WP_TDM_GET_USR_MTU_MRU, /* 0x00 */
|
||||
|
||||
SIOC_WP_TDM_SET_USR_PERIOD, /* 0x01 */
|
||||
SIOC_WP_TDM_GET_USR_PERIOD, /* 0x02 */
|
||||
|
||||
SIOC_WP_TDM_SET_HW_MTU_MRU, /* 0x03 */
|
||||
SIOC_WP_TDM_GET_HW_MTU_MRU, /* 0x04 */
|
||||
|
||||
SIOC_WP_TDM_SET_CODEC, /* 0x05 */
|
||||
SIOC_WP_TDM_GET_CODEC, /* 0x06 */
|
||||
|
||||
SIOC_WP_TDM_SET_POWER_LEVEL, /* 0x07 */
|
||||
SIOC_WP_TDM_GET_POWER_LEVEL, /* 0x08 */
|
||||
|
||||
SIOC_WP_TDM_TOGGLE_RX, /* 0x09 */
|
||||
SIOC_WP_TDM_TOGGLE_TX, /* 0x0A */
|
||||
|
||||
SIOC_WP_TDM_GET_HW_CODING, /* 0x0B */
|
||||
SIOC_WP_TDM_SET_HW_CODING, /* 0x0C */
|
||||
|
||||
SIOC_WP_TDM_GET_FULL_CFG, /* 0x0D */
|
||||
|
||||
SIOC_WP_TDM_SET_EC_TAP, /* 0x0E */
|
||||
SIOC_WP_TDM_GET_EC_TAP, /* 0x0F */
|
||||
|
||||
SIOC_WP_TDM_ENABLE_RBS_EVENTS, /* 0x10 */
|
||||
SIOC_WP_TDM_DISABLE_RBS_EVENTS, /* 0x11 */
|
||||
SIOC_WP_TDM_WRITE_RBS_BITS, /* 0x12 */
|
||||
|
||||
SIOC_WP_TDM_GET_STATS, /* 0x13 */
|
||||
SIOC_WP_TDM_FLUSH_BUFFERS, /* 0x14 */
|
||||
|
||||
SIOC_WP_TDM_READ_EVENT, /* 0x15 */
|
||||
|
||||
SIOC_WP_TDM_SET_EVENT, /* 0x16 */
|
||||
|
||||
SIOC_WP_TDM_SET_RX_GAINS, /* 0x17 */
|
||||
SIOC_WP_TDM_SET_TX_GAINS, /* 0x18 */
|
||||
SIOC_WP_TDM_CLEAR_RX_GAINS, /* 0x19 */
|
||||
SIOC_WP_TDM_CLEAR_TX_GAINS, /* 0x1A */
|
||||
|
||||
SIOC_WP_TDM_GET_FE_ALARMS, /* 0x1B */
|
||||
|
||||
SIOC_WP_TDM_ENABLE_HWEC, /* 0x1C */
|
||||
SIOC_WP_TDM_DISABLE_HWEC, /* 0x1D */
|
||||
|
||||
SIOC_WP_TDM_SET_FE_STATUS, /* 0x1E */
|
||||
SIOC_WP_TDM_GET_FE_STATUS, /* 0x1F */
|
||||
|
||||
SIOC_WP_TDM_GET_HW_DTMF, /* 0x20 */
|
||||
|
||||
SIOC_WP_TDM_NOTSUPP /* */
|
||||
|
||||
};
|
||||
|
||||
#define SIOC_WP_TDM_GET_LINK_STATUS SIOC_WP_TDM_GET_FE_STATUS
|
||||
|
||||
enum wanpipe_tdm_api_events {
|
||||
WP_TDMAPI_EVENT_NONE,
|
||||
WP_TDMAPI_EVENT_RBS,
|
||||
WP_TDMAPI_EVENT_ALARM,
|
||||
WP_TDMAPI_EVENT_DTMF,
|
||||
WP_TDMAPI_EVENT_RM_DTMF,
|
||||
WP_TDMAPI_EVENT_RXHOOK,
|
||||
WP_TDMAPI_EVENT_RING,
|
||||
WP_TDMAPI_EVENT_RING_DETECT,
|
||||
WP_TDMAPI_EVENT_RING_TRIP_DETECT,
|
||||
WP_TDMAPI_EVENT_TONE,
|
||||
WP_TDMAPI_EVENT_TXSIG_KEWL,
|
||||
WP_TDMAPI_EVENT_TXSIG_START,
|
||||
WP_TDMAPI_EVENT_TXSIG_OFFHOOK,
|
||||
WP_TDMAPI_EVENT_TXSIG_ONHOOK,
|
||||
WP_TDMAPI_EVENT_ONHOOKTRANSFER,
|
||||
WP_TDMAPI_EVENT_SETPOLARITY,
|
||||
WP_TDMAPI_EVENT_BRI_CHAN_LOOPBACK,
|
||||
WP_TDMAPI_EVENT_LINK_STATUS
|
||||
};
|
||||
|
||||
#define WP_TDMAPI_EVENT_FE_ALARM WP_TDMAPI_EVENT_ALARM
|
||||
|
||||
|
||||
#define WP_TDMAPI_EVENT_ENABLE 0x01
|
||||
#define WP_TDMAPI_EVENT_DISABLE 0x02
|
||||
#define WP_TDMAPI_EVENT_MODE_DECODE(mode) \
|
||||
((mode) == WP_TDMAPI_EVENT_ENABLE) ? "Enable" : \
|
||||
((mode) == WP_TDMAPI_EVENT_DISABLE) ? "Disable" : \
|
||||
"(Unknown mode)"
|
||||
|
||||
#define WPTDM_A_BIT WAN_RBS_SIG_A
|
||||
#define WPTDM_B_BIT WAN_RBS_SIG_B
|
||||
#define WPTDM_C_BIT WAN_RBS_SIG_C
|
||||
#define WPTDM_D_BIT WAN_RBS_SIG_D
|
||||
|
||||
#define WP_TDMAPI_EVENT_RXHOOK_OFF 0x01
|
||||
#define WP_TDMAPI_EVENT_RXHOOK_ON 0x02
|
||||
#define WP_TDMAPI_EVENT_RXHOOK_DECODE(state) \
|
||||
((state) == WP_TDMAPI_EVENT_RXHOOK_OFF) ? "Off-hook" : \
|
||||
((state) == WP_TDMAPI_EVENT_RXHOOK_ON) ? "On-hook" : \
|
||||
"(Unknown state)"
|
||||
|
||||
#define WP_TDMAPI_EVENT_RING_PRESENT 0x01
|
||||
#define WP_TDMAPI_EVENT_RING_STOP 0x02
|
||||
#define WP_TDMAPI_EVENT_RING_DECODE(state) \
|
||||
((state) == WP_TDMAPI_EVENT_RING_PRESENT) ? "Ring Present" : \
|
||||
((state) == WP_TDMAPI_EVENT_RING_STOP) ? "Ring Stop" : \
|
||||
"(Unknown state)"
|
||||
|
||||
#define WP_TDMAPI_EVENT_RING_TRIP_PRESENT 0x01
|
||||
#define WP_TDMAPI_EVENT_RING_TRIP_STOP 0x02
|
||||
#define WP_TDMAPI_EVENT_RING_TRIP_DECODE(state) \
|
||||
((state) == WP_TDMAPI_EVENT_RING_TRIP_PRESENT) ? "Ring Present" : \
|
||||
((state) == WP_TDMAPI_EVENT_RING_TRIP_STOP) ? "Ring Stop" : \
|
||||
"(Unknown state)"
|
||||
/*Link Status */
|
||||
#define WP_TDMAPI_EVENT_LINK_STATUS_CONNECTED 0x01
|
||||
#define WP_TDMAPI_EVENT_LINK_STATUS_DISCONNECTED 0x02
|
||||
#define WP_TDMAPI_EVENT_LINK_STATUS_DECODE(status) \
|
||||
((status) == WP_TDMAPI_EVENT_LINK_STATUS_CONNECTED) ? "Connected" : \
|
||||
((status) == WP_TDMAPI_EVENT_LINK_STATUS_DISCONNECTED) ? "Disconnected" : \
|
||||
"Unknown"
|
||||
#define WP_TDMAPI_EVENT_TONE_DIAL 0x01
|
||||
#define WP_TDMAPI_EVENT_TONE_BUSY 0x02
|
||||
#define WP_TDMAPI_EVENT_TONE_RING 0x03
|
||||
#define WP_TDMAPI_EVENT_TONE_CONGESTION 0x04
|
||||
|
||||
/* BRI channels list */
|
||||
#define WAN_BRI_BCHAN1 0x01
|
||||
#define WAN_BRI_BCHAN2 0x02
|
||||
#define WAN_BRI_DCHAN 0x03
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
u_int8_t type;
|
||||
u_int8_t mode;
|
||||
u_int32_t time_stamp;
|
||||
u_int8_t channel;
|
||||
u_int32_t chan_map;
|
||||
u_int8_t span;
|
||||
union {
|
||||
struct {
|
||||
u_int8_t alarm;
|
||||
} te1_alarm;
|
||||
struct {
|
||||
u_int8_t rbs_bits;
|
||||
} te1_rbs;
|
||||
struct {
|
||||
u_int8_t state;
|
||||
u_int8_t sig;
|
||||
} rm_hook;
|
||||
struct {
|
||||
u_int8_t state;
|
||||
} rm_ring;
|
||||
struct {
|
||||
u_int8_t type;
|
||||
} rm_tone;
|
||||
struct {
|
||||
u_int8_t digit; /* DTMF: digit */
|
||||
u_int8_t port; /* DTMF: SOUT/ROUT */
|
||||
u_int8_t type; /* DTMF: PRESET/STOP */
|
||||
} dtmf;
|
||||
struct {
|
||||
u_int16_t polarity;
|
||||
u_int16_t ohttimer;
|
||||
} rm_common;
|
||||
struct{
|
||||
u_int16_t status;
|
||||
} linkstatus;
|
||||
} wp_tdm_api_event_u;
|
||||
#define wp_tdm_api_event_type type
|
||||
#define wp_tdm_api_event_mode mode
|
||||
#define wp_tdm_api_event_alarm wp_tdm_api_event_u.te1_alarm.alarm
|
||||
#define wp_tdm_api_event_alarm wp_tdm_api_event_u.te1_alarm.alarm
|
||||
#define wp_tdm_api_event_rbs_bits wp_tdm_api_event_u.te1_rbs.rbs_bits
|
||||
#define wp_tdm_api_event_hook_state wp_tdm_api_event_u.rm_hook.state
|
||||
#define wp_tdm_api_event_hook_sig wp_tdm_api_event_u.rm_hook.sig
|
||||
#define wp_tdm_api_event_ring_state wp_tdm_api_event_u.rm_ring.state
|
||||
#define wp_tdm_api_event_tone_type wp_tdm_api_event_u.rm_tone.type
|
||||
#define wp_tdm_api_event_dtmf_digit wp_tdm_api_event_u.dtmf.digit
|
||||
#define wp_tdm_api_event_dtmf_type wp_tdm_api_event_u.dtmf.type
|
||||
#define wp_tdm_api_event_dtmf_port wp_tdm_api_event_u.dtmf.port
|
||||
#define wp_tdm_api_event_ohttimer wp_tdm_api_event_u.rm_common.ohttimer
|
||||
#define wp_tdm_api_event_polarity wp_tdm_api_event_u.rm_common.polarity
|
||||
#define wp_tdm_api_event_link_status wp_tdm_api_event_u.linkstatus.status
|
||||
} wp_tdm_api_event_t;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
unsigned char reserved[16];
|
||||
}wp_rx_hdr_u;
|
||||
} wp_tdm_api_rx_hdr_t;
|
||||
|
||||
typedef struct {
|
||||
wp_tdm_api_rx_hdr_t hdr;
|
||||
unsigned char data[1];
|
||||
} wp_tdm_api_rx_element_t;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
struct {
|
||||
unsigned char _rbs_rx_bits;
|
||||
unsigned int _time_stamp;
|
||||
}wp_tx;
|
||||
unsigned char reserved[16];
|
||||
}wp_tx_hdr_u;
|
||||
#define wp_api_time_stamp wp_tx_hdr_u.wp_tx._time_stamp
|
||||
} wp_tdm_api_tx_hdr_t;
|
||||
|
||||
typedef struct {
|
||||
wp_tdm_api_tx_hdr_t hdr;
|
||||
unsigned char data[1];
|
||||
} wp_tdm_api_tx_element_t;
|
||||
|
||||
|
||||
|
||||
typedef struct wp_tdm_chan_stats
|
||||
{
|
||||
unsigned int rx_packets; /* total packets received */
|
||||
unsigned int tx_packets; /* total packets transmitted */
|
||||
unsigned int rx_bytes; /* total bytes received */
|
||||
unsigned int tx_bytes; /* total bytes transmitted */
|
||||
unsigned int rx_errors; /* bad packets received */
|
||||
unsigned int tx_errors; /* packet transmit problems */
|
||||
unsigned int rx_dropped; /* no space in linux buffers */
|
||||
unsigned int tx_dropped; /* no space available in linux */
|
||||
unsigned int multicast; /* multicast packets received */
|
||||
#if !defined(__WINDOWS__)
|
||||
unsigned int collisions;
|
||||
#endif
|
||||
/* detailed rx_errors: */
|
||||
unsigned int rx_length_errors;
|
||||
unsigned int rx_over_errors; /* receiver ring buff overflow */
|
||||
unsigned int rx_crc_errors; /* recved pkt with crc error */
|
||||
unsigned int rx_frame_errors; /* recv'd frame alignment error */
|
||||
#if !defined(__WINDOWS__)
|
||||
unsigned int rx_fifo_errors; /* recv'r fifo overrun */
|
||||
#endif
|
||||
unsigned int rx_missed_errors; /* receiver missed packet */
|
||||
|
||||
/* detailed tx_errors */
|
||||
#if !defined(__WINDOWS__)
|
||||
unsigned int tx_aborted_errors;
|
||||
unsigned int tx_carrier_errors;
|
||||
#endif
|
||||
unsigned int tx_fifo_errors;
|
||||
unsigned int tx_heartbeat_errors;
|
||||
unsigned int tx_window_errors;
|
||||
|
||||
}wp_tdm_chan_stats_t;
|
||||
|
||||
|
||||
|
||||
typedef struct wanpipe_tdm_api_cmd{
|
||||
unsigned int cmd;
|
||||
unsigned int hw_tdm_coding; /* Set/Get HW TDM coding: uLaw muLaw */
|
||||
unsigned int hw_mtu_mru; /* Set/Get HW TDM MTU/MRU */
|
||||
unsigned int usr_period; /* Set/Get User Period in ms */
|
||||
unsigned int tdm_codec; /* Set/Get TDM Codec: SLinear */
|
||||
unsigned int power_level; /* Set/Get Power level treshold */
|
||||
unsigned int rx_disable; /* Enable/Disable Rx */
|
||||
unsigned int tx_disable; /* Enable/Disable Tx */
|
||||
unsigned int usr_mtu_mru; /* Set/Get User TDM MTU/MRU */
|
||||
unsigned int ec_tap; /* Echo Cancellation Tap */
|
||||
unsigned int rbs_poll; /* Enable/Disable RBS Polling */
|
||||
unsigned int rbs_rx_bits; /* Rx RBS Bits */
|
||||
unsigned int rbs_tx_bits; /* Tx RBS Bits */
|
||||
unsigned int hdlc; /* HDLC based device */
|
||||
unsigned int idle_flag; /* IDLE flag to Tx */
|
||||
unsigned int fe_alarms; /* FE Alarms detected */
|
||||
wp_tdm_chan_stats_t stats; /* TDM Statistics */
|
||||
/* Do NOT add anything above this! Important for binary backward compatibility. */
|
||||
wp_tdm_api_event_t event; /* TDM Event */
|
||||
unsigned int data_len;
|
||||
void *data;
|
||||
unsigned char fe_status; /* FE status - Connected or Disconnected */
|
||||
unsigned int hw_dtmf; /* HW DTMF enabled */
|
||||
}wanpipe_tdm_api_cmd_t;
|
||||
|
||||
typedef struct wanpipe_tdm_api_event{
|
||||
int (*wp_rbs_event)(sng_fd_t fd, unsigned char rbs_bits);
|
||||
int (*wp_dtmf_event)(sng_fd_t fd, unsigned char dtmf, unsigned char type, unsigned char port);
|
||||
int (*wp_rxhook_event)(sng_fd_t fd, unsigned char hook_state);
|
||||
int (*wp_ring_detect_event)(sng_fd_t fd, unsigned char ring_state);
|
||||
int (*wp_ring_trip_detect_event)(sng_fd_t fd, unsigned char ring_state);
|
||||
int (*wp_fe_alarm_event)(sng_fd_t fd, unsigned char fe_alarm_event);
|
||||
int (*wp_link_status_event)(sng_fd_t fd, unsigned char link_status_event);
|
||||
}wanpipe_tdm_api_event_t;
|
||||
|
||||
typedef struct wanpipe_tdm_api{
|
||||
wanpipe_tdm_api_cmd_t wp_tdm_cmd;
|
||||
wanpipe_tdm_api_event_t wp_tdm_event;
|
||||
}wanpipe_tdm_api_t;
|
||||
|
||||
|
||||
#endif
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
|
||||
#include "ftdm_declare.h"
|
||||
#include "ftdm_call_utils.h"
|
||||
|
||||
/*! \brief Max number of channels per physical span */
|
||||
#define FTDM_MAX_CHANNELS_PHYSICAL_SPAN 32
|
||||
@@ -62,23 +63,6 @@
|
||||
|
||||
#define FTDM_INVALID_INT_PARM 0xFF
|
||||
|
||||
/*! \brief FreeTDM APIs possible return codes */
|
||||
typedef enum {
|
||||
FTDM_SUCCESS, /*!< Success */
|
||||
FTDM_FAIL, /*!< Failure, generic error return code, use ftdm_channel_get_last_error or ftdm_span_get_last_error for details */
|
||||
FTDM_MEMERR, /*!< Memory error, most likely allocation failure */
|
||||
FTDM_TIMEOUT, /*!< Operation timed out (ie: polling on a device)*/
|
||||
FTDM_NOTIMPL, /*!< Operation not implemented */
|
||||
FTDM_BREAK, /*!< Request the caller to perform a break (context-dependant, ie: stop getting DNIS/ANI) */
|
||||
FTDM_EINVAL /*!< Invalid argument */
|
||||
} ftdm_status_t;
|
||||
|
||||
/*! \brief FreeTDM bool type. */
|
||||
typedef enum {
|
||||
FTDM_FALSE,
|
||||
FTDM_TRUE
|
||||
} ftdm_bool_t;
|
||||
|
||||
/*! \brief Thread/Mutex OS abstraction API. */
|
||||
#include "ftdm_os.h"
|
||||
|
||||
@@ -220,8 +204,10 @@ typedef enum {
|
||||
FTDM_TON_SUBSCRIBER_NUMBER,
|
||||
FTDM_TON_ABBREVIATED_NUMBER,
|
||||
FTDM_TON_RESERVED,
|
||||
FTDM_TON_INVALID = 255
|
||||
FTDM_TON_INVALID
|
||||
} ftdm_ton_t;
|
||||
#define TON_STRINGS "unknown", "international", "national", "network-specific", "subscriber-number", "abbreviated-number", "reserved", "invalid"
|
||||
FTDM_STR2ENUM_P(ftdm_str2ftdm_ton, ftdm_ton2str, ftdm_ton_t)
|
||||
|
||||
/*! Numbering Plan Identification (NPI) */
|
||||
typedef enum {
|
||||
@@ -232,8 +218,52 @@ typedef enum {
|
||||
FTDM_NPI_NATIONAL = 8,
|
||||
FTDM_NPI_PRIVATE = 9,
|
||||
FTDM_NPI_RESERVED = 10,
|
||||
FTDM_NPI_INVALID = 255
|
||||
FTDM_NPI_INVALID
|
||||
} ftdm_npi_t;
|
||||
#define NPI_STRINGS "unknown", "ISDN", "data", "telex", "national", "private", "reserved", "invalid"
|
||||
FTDM_STR2ENUM_P(ftdm_str2ftdm_npi, ftdm_npi2str, ftdm_npi_t)
|
||||
|
||||
/*! Presentation Ind */
|
||||
typedef enum {
|
||||
FTDM_PRES_ALLOWED,
|
||||
FTDM_PRES_RESTRICTED,
|
||||
FTDM_PRES_NOT_AVAILABLE,
|
||||
FTDM_PRES_RESERVED,
|
||||
FTDM_PRES_INVALID
|
||||
} ftdm_presentation_t;
|
||||
#define PRESENTATION_STRINGS "presentation-allowed", "presentation-restricted", "number-not-available", "reserved", "Invalid"
|
||||
FTDM_STR2ENUM_P(ftdm_str2ftdm_presentation, ftdm_presentation2str, ftdm_presentation_t)
|
||||
|
||||
/*! Screening Ind */
|
||||
typedef enum {
|
||||
FTDM_SCREENING_NOT_SCREENED,
|
||||
FTDM_SCREENING_VERIFIED_PASSED,
|
||||
FTDM_SCREENING_VERIFIED_FAILED,
|
||||
FTDM_SCREENING_NETWORK_PROVIDED,
|
||||
FTDM_SCREENING_INVALID
|
||||
} ftdm_screening_t;
|
||||
#define SCREENING_STRINGS "user-provided-not-screened", "user-provided-verified-and-passed", "user-provided-verified-and-failed", "network-provided", "invalid"
|
||||
FTDM_STR2ENUM_P(ftdm_str2ftdm_screening, ftdm_screening2str, ftdm_screening_t)
|
||||
|
||||
/*! \brief bearer capability */
|
||||
typedef enum {
|
||||
FTDM_BEARER_CAP_SPEECH = 0x00,
|
||||
FTDM_BEARER_CAP_64K_UNRESTRICTED = 0x02,
|
||||
FTDM_BEARER_CAP_3_1KHZ_AUDIO = 0x03,
|
||||
FTDM_BEARER_CAP_INVALID
|
||||
} ftdm_bearer_cap_t;
|
||||
#define BEARER_CAP_STRINGS "speech", "unrestricted-digital-information", "3.1-Khz-audio", "invalid"
|
||||
FTDM_STR2ENUM_P(ftdm_str2ftdm_bearer_cap, ftdm_bearer_cap2str, ftdm_bearer_cap_t)
|
||||
|
||||
/*! \brief user information layer 1 protocol */
|
||||
typedef enum {
|
||||
FTDM_USER_LAYER1_PROT_V110 = 0x01,
|
||||
FTDM_USER_LAYER1_PROT_ULAW = 0x02,
|
||||
FTDM_USER_LAYER1_PROT_ALAW = 0x03,
|
||||
FTDM_USER_LAYER1_PROT_INVALID
|
||||
} ftdm_user_layer1_prot_t;
|
||||
#define USER_LAYER1_PROT_STRINGS "V.110", "u-law", "a-law", "Invalid"
|
||||
FTDM_STR2ENUM_P(ftdm_str2ftdm_usr_layer1_prot, ftdm_user_layer1_prot2str, ftdm_user_layer1_prot_t)
|
||||
|
||||
/*! \brief Number abstraction */
|
||||
typedef struct {
|
||||
@@ -242,20 +272,6 @@ typedef struct {
|
||||
uint8_t plan;
|
||||
} ftdm_number_t;
|
||||
|
||||
/*! \brief bearer capability */
|
||||
typedef enum {
|
||||
FTDM_BEARER_CAP_SPEECH = 0x00,
|
||||
FTDM_BEARER_CAP_64K_UNRESTRICTED = 0x02,
|
||||
FTDM_BEARER_CAP_3_1KHZ_AUDIO = 0x03
|
||||
} ftdm_bearer_cap_t;
|
||||
|
||||
/*! \brief user information layer 1 protocol */
|
||||
typedef enum {
|
||||
FTDM_USER_LAYER1_PROT_V110 = 0x01,
|
||||
FTDM_USER_LAYER1_PROT_ULAW = 0x02,
|
||||
FTDM_USER_LAYER1_PROT_ALAW = 0x03,
|
||||
} ftdm_user_layer1_prot_t;
|
||||
|
||||
/*! \brief Caller information */
|
||||
typedef struct ftdm_caller_data {
|
||||
char cid_date[8]; /*!< Caller ID date */
|
||||
@@ -285,11 +301,12 @@ typedef enum {
|
||||
|
||||
/*! \brief Signaling messages sent by the stacks */
|
||||
typedef enum {
|
||||
FTDM_SIGEVENT_START, /*!< Incoming call (ie: incoming SETUP msg or Ring) */
|
||||
FTDM_SIGEVENT_START,/*!< Incoming call (ie: incoming SETUP msg or Ring) */
|
||||
FTDM_SIGEVENT_STOP, /*!< Hangup */
|
||||
FTDM_SIGEVENT_RELEASED, /*!< Channel is completely released and available */
|
||||
FTDM_SIGEVENT_UP, /*!< Outgoing call has been answered */
|
||||
FTDM_SIGEVENT_FLASH, /*< Flash event (typically on-hook/off-hook for analog devices) */
|
||||
FTDM_SIGEVENT_FLASH, /*!< Flash event (typically on-hook/off-hook for analog devices) */
|
||||
FTDM_SIGEVENT_PROCEED, /*!< Outgoing call got a response */
|
||||
FTDM_SIGEVENT_PROGRESS, /*!< Outgoing call is making progress */
|
||||
FTDM_SIGEVENT_PROGRESS_MEDIA, /*!< Outgoing call is making progress and there is media available */
|
||||
FTDM_SIGEVENT_ALARM_TRAP, /*!< Hardware alarm ON */
|
||||
@@ -299,11 +316,12 @@ typedef enum {
|
||||
FTDM_SIGEVENT_RESTART, /*!< Restart has been requested. Typically you hangup your call resources here */
|
||||
FTDM_SIGEVENT_SIGSTATUS_CHANGED, /*!< Signaling protocol status changed (ie: D-chan up), see new status in raw_data ftdm_sigmsg_t member */
|
||||
FTDM_SIGEVENT_COLLISION, /*!< Outgoing call was dropped because an incoming call arrived at the same time */
|
||||
FTDM_SIGEVENT_MSG, /*!< We received an in-call msg */
|
||||
FTDM_SIGEVENT_INVALID
|
||||
} ftdm_signal_event_t;
|
||||
#define SIGNAL_STRINGS "START", "STOP", "RELEASED", "UP", "FLASH", "PROGRESS", \
|
||||
#define SIGNAL_STRINGS "START", "STOP", "RELEASED", "UP", "FLASH", "PROCEED", "PROGRESS", \
|
||||
"PROGRESS_MEDIA", "ALARM_TRAP", "ALARM_CLEAR", \
|
||||
"COLLECTED_DIGIT", "ADD_CALL", "RESTART", "SIGSTATUS_CHANGED", "COLLISION", "INVALID"
|
||||
"COLLECTED_DIGIT", "ADD_CALL", "RESTART", "SIGSTATUS_CHANGED", "COLLISION", "MSG", "INVALID"
|
||||
|
||||
/*! \brief Move from string to ftdm_signal_event_t and viceversa */
|
||||
FTDM_STR2ENUM_P(ftdm_str2ftdm_signal_event, ftdm_signal_event2str, ftdm_signal_event_t)
|
||||
@@ -585,7 +603,7 @@ typedef enum {
|
||||
* This is used during incoming calls when you want to request the signaling stack
|
||||
* to notify about indications occurring locally */
|
||||
typedef enum {
|
||||
FTDM_CHANNEL_INDICATE_RING,
|
||||
FTDM_CHANNEL_INDICATE_RINGING,
|
||||
FTDM_CHANNEL_INDICATE_PROCEED,
|
||||
FTDM_CHANNEL_INDICATE_PROGRESS,
|
||||
FTDM_CHANNEL_INDICATE_PROGRESS_MEDIA,
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Sangoma Technologies
|
||||
* David Yat Sin <dyatsin@sangoma.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the original author; nor the names of any contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __FTDM_CALL_UTILS_H__
|
||||
#define __FTDM_CALL_UTILS_H__
|
||||
|
||||
/*!
|
||||
* \brief Set the Numbering Plan Identification from a string
|
||||
*
|
||||
* \param npi_string string value
|
||||
* \param target the target to set value to
|
||||
*
|
||||
* \retval FTDM_SUCCESS success
|
||||
* \retval FTDM_FAIL failure
|
||||
*/
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_npi(const char *npi_string, uint8_t *target);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Set the Type of number from a string
|
||||
*
|
||||
* \param ton_string string value
|
||||
* \param target the target to set value to
|
||||
*
|
||||
* \retval FTDM_SUCCESS success
|
||||
* \retval FTDM_FAIL failure
|
||||
*/
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_ton(const char *ton_string, uint8_t *target);
|
||||
|
||||
/*!
|
||||
* \brief Set the Bearer Capability from a string
|
||||
*
|
||||
* \param bc_string string value
|
||||
* \param target the target to set value to
|
||||
*
|
||||
* \retval FTDM_SUCCESS success
|
||||
* \retval FTDM_FAIL failure
|
||||
*/
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_bearer_capability(const char *bc_string, uint8_t *target);
|
||||
|
||||
/*!
|
||||
* \brief Set the Bearer Capability - Layer 1 from a string
|
||||
*
|
||||
* \param bc_string string value
|
||||
* \param target the target to set value to
|
||||
*
|
||||
* \retval FTDM_SUCCESS success
|
||||
* \retval FTDM_FAIL failure
|
||||
*/
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_bearer_layer1(const char *bc_string, uint8_t *target);
|
||||
|
||||
/*!
|
||||
* \brief Set the Screening Ind from a string
|
||||
*
|
||||
* \param screen_string string value
|
||||
* \param target the target to set value to
|
||||
*
|
||||
* \retval FTDM_SUCCESS success
|
||||
* \retval FTDM_FAIL failure
|
||||
*/
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_screening_ind(const char *string, uint8_t *target);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Set the Presentation Ind from an enum
|
||||
*
|
||||
* \param screen_string string value
|
||||
* \param target the target to set value to
|
||||
*
|
||||
* \retval FTDM_SUCCESS success
|
||||
* \retval FTDM_FAIL failure
|
||||
*/
|
||||
FT_DECLARE(ftdm_status_t) ftdm_set_presentation_ind(const char *string, uint8_t *target);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Checks whether a string contains only numbers
|
||||
*
|
||||
* \param number string value
|
||||
*
|
||||
* \retval FTDM_SUCCESS success
|
||||
* \retval FTDM_FAIL failure
|
||||
*/
|
||||
FT_DECLARE(ftdm_status_t) ftdm_is_number(const char *number);
|
||||
|
||||
#endif /* __FTDM_CALL_UTILS_H__ */
|
||||
|
||||
@@ -171,6 +171,23 @@ typedef int ftdm_socket_t;
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
/*! \brief FreeTDM APIs possible return codes */
|
||||
typedef enum {
|
||||
FTDM_SUCCESS, /*!< Success */
|
||||
FTDM_FAIL, /*!< Failure, generic error return code, use ftdm_channel_get_last_error or ftdm_span_get_last_error for details */
|
||||
FTDM_MEMERR, /*!< Memory error, most likely allocation failure */
|
||||
FTDM_TIMEOUT, /*!< Operation timed out (ie: polling on a device)*/
|
||||
FTDM_NOTIMPL, /*!< Operation not implemented */
|
||||
FTDM_BREAK, /*!< Request the caller to perform a break (context-dependant, ie: stop getting DNIS/ANI) */
|
||||
FTDM_EINVAL /*!< Invalid argument */
|
||||
} ftdm_status_t;
|
||||
|
||||
/*! \brief FreeTDM bool type. */
|
||||
typedef enum {
|
||||
FTDM_FALSE,
|
||||
FTDM_TRUE
|
||||
} ftdm_bool_t;
|
||||
|
||||
/*!
|
||||
* \brief FreeTDM channel.
|
||||
* This is the basic data structure used to place calls and I/O operations
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Sangoma Technologies
|
||||
* David Yat Sin <dyatsin@sangoma.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the original author; nor the names of any contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __FTDM_CALL_UTILS_H__
|
||||
#define __FTDM_CALL_UTILS_H__
|
||||
|
||||
#include "freetdm.h"
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_span_set_npi(const char *npi_string, uint8_t *target);
|
||||
FT_DECLARE(ftdm_status_t) ftdm_span_set_ton(const char *ton_string, uint8_t *target);
|
||||
FT_DECLARE(ftdm_status_t) ftdm_span_set_bearer_capability(const char *bc_string, ftdm_bearer_cap_t *target);
|
||||
FT_DECLARE(ftdm_status_t) ftdm_span_set_bearer_layer1(const char *bc_string, ftdm_user_layer1_prot_t *target);
|
||||
FT_DECLARE(ftdm_status_t) ftdm_is_number(char *number);
|
||||
|
||||
#endif /* __FTDM_CALL_UTILS_H__ */
|
||||
|
||||
@@ -181,6 +181,8 @@ typedef enum {
|
||||
* after having called ftdm_send_span_signal(), which with this flag it will just enqueue the signal
|
||||
* for later delivery */
|
||||
FTDM_SPAN_USE_SIGNALS_QUEUE = (1 << 10),
|
||||
/* If this flag is set, channel will be moved to proceed state when calls goes to routing */
|
||||
FTDM_SPAN_USE_PROCEED_STATE = (1 << 11),
|
||||
} ftdm_span_flag_t;
|
||||
|
||||
/*! \brief Channel supported features */
|
||||
@@ -204,6 +206,7 @@ typedef enum {
|
||||
FTDM_CHANNEL_STATE_DIALTONE,
|
||||
FTDM_CHANNEL_STATE_COLLECT,
|
||||
FTDM_CHANNEL_STATE_RING,
|
||||
FTDM_CHANNEL_STATE_RINGING,
|
||||
FTDM_CHANNEL_STATE_BUSY,
|
||||
FTDM_CHANNEL_STATE_ATTN,
|
||||
FTDM_CHANNEL_STATE_GENRING,
|
||||
@@ -211,6 +214,7 @@ typedef enum {
|
||||
FTDM_CHANNEL_STATE_GET_CALLERID,
|
||||
FTDM_CHANNEL_STATE_CALLWAITING,
|
||||
FTDM_CHANNEL_STATE_RESTART,
|
||||
FTDM_CHANNEL_STATE_PROCEED,
|
||||
FTDM_CHANNEL_STATE_PROGRESS,
|
||||
FTDM_CHANNEL_STATE_PROGRESS_MEDIA,
|
||||
FTDM_CHANNEL_STATE_UP,
|
||||
@@ -223,8 +227,8 @@ typedef enum {
|
||||
FTDM_CHANNEL_STATE_INVALID
|
||||
} ftdm_channel_state_t;
|
||||
#define CHANNEL_STATE_STRINGS "DOWN", "HOLD", "SUSPENDED", "DIALTONE", "COLLECT", \
|
||||
"RING", "BUSY", "ATTN", "GENRING", "DIALING", "GET_CALLERID", "CALLWAITING", \
|
||||
"RESTART", "PROGRESS", "PROGRESS_MEDIA", "UP", "IDLE", "TERMINATING", "CANCEL", \
|
||||
"RING", "RINGING", "BUSY", "ATTN", "GENRING", "DIALING", "GET_CALLERID", "CALLWAITING", \
|
||||
"RESTART", "PROCEED", "PROGRESS", "PROGRESS_MEDIA", "UP", "IDLE", "TERMINATING", "CANCEL", \
|
||||
"HANGUP", "HANGUP_COMPLETE", "IN_LOOP", "INVALID"
|
||||
FTDM_STR2ENUM_P(ftdm_str2ftdm_channel_state, ftdm_channel_state2str, ftdm_channel_state_t)
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_signal)
|
||||
|
||||
switch(sigmsg->event_id) {
|
||||
case FTDM_SIGEVENT_START:
|
||||
ftdm_channel_call_indicate(sigmsg->channel, FTDM_CHANNEL_INDICATE_RING);
|
||||
ftdm_channel_call_indicate(sigmsg->channel, FTDM_CHANNEL_INDICATE_RINGING);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "launching thread and indicating ring\n");
|
||||
ftdm_thread_create_detached(test_call, sigmsg->channel);
|
||||
break;
|
||||
|
||||
@@ -45,10 +45,14 @@
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include "freetdm.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#ifdef __linux__
|
||||
#define __USE_BSD
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "freetdm.h"
|
||||
|
||||
|
||||
/* arbitrary limit for max calls in this sample program */
|
||||
@@ -338,9 +342,9 @@ int main(int argc, char *argv[])
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (!strcasecmp(argv[2], "cpe")) {
|
||||
if (!strcmp(argv[2], "cpe")) {
|
||||
sigtype = "pri_cpe";
|
||||
} else if (!strcasecmp(argv[2], "net")) {
|
||||
} else if (!strcmp(argv[2], "net")) {
|
||||
sigtype = "pri_net";
|
||||
} else {
|
||||
fprintf(stderr, "Valid signaling types are cpe and net only\n");
|
||||
|
||||
Vendored
-98
@@ -1,98 +0,0 @@
|
||||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5 lt~obsolete.m4
|
||||
|
||||
# These exist entirely to fool aclocal when bootstrapping libtool.
|
||||
#
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
|
||||
# which have later been changed to m4_define as they aren't part of the
|
||||
# exported API, or moved to Autoconf or Automake where they belong.
|
||||
#
|
||||
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
|
||||
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
|
||||
# using a macro with the same name in our local m4/libtool.m4 it'll
|
||||
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
|
||||
# and doesn't know about Autoconf macros at all.)
|
||||
#
|
||||
# So we provide this file, which has a silly filename so it's always
|
||||
# included after everything else. This provides aclocal with the
|
||||
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
|
||||
# because those macros already exist, or will be overwritten later.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
#
|
||||
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
|
||||
# Yes, that means every name once taken will need to remain here until
|
||||
# we give up compatibility with versions before 1.7, at which point
|
||||
# we need to keep only those names which we still refer to.
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
|
||||
|
||||
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
|
||||
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
|
||||
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
|
||||
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
|
||||
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
|
||||
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
|
||||
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
|
||||
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
|
||||
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
|
||||
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
|
||||
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
|
||||
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
|
||||
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
|
||||
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
|
||||
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
|
||||
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
|
||||
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
|
||||
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
|
||||
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
|
||||
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
|
||||
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
|
||||
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
|
||||
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
|
||||
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
|
||||
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
|
||||
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
|
||||
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
|
||||
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
|
||||
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
|
||||
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
|
||||
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
|
||||
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
|
||||
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
|
||||
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
|
||||
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
||||
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
||||
@@ -127,6 +127,11 @@
|
||||
<ClCompile Include="src\mrcp_sofiasip_client_agent.c" />
|
||||
<ClCompile Include="src\mrcp_sofiasip_server_agent.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\win32\sofia\libsofia_sip_ua_static.2010.vcxproj">
|
||||
<Project>{70a49bc2-7500-41d0-b75d-edcc5be987a0}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
||||
Executable
+306
@@ -0,0 +1,306 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# add_user
|
||||
#
|
||||
# Add one or more users to the XML directory
|
||||
#
|
||||
#
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Getopt::Long;
|
||||
use Data::Dumper;
|
||||
|
||||
## Useful items
|
||||
my $path_sep;
|
||||
my $config_path;
|
||||
my @dir_elem;
|
||||
my $user_template = &get_user_template;
|
||||
my $new_user_count = 0;
|
||||
|
||||
## Command line args
|
||||
my $users;
|
||||
my $domain;
|
||||
my $dirpath;
|
||||
my $help;
|
||||
|
||||
## Misc items somewhat related to cmd line args
|
||||
my $start;
|
||||
my $end;
|
||||
my $user;
|
||||
|
||||
## Check for Windows vs. *nix
|
||||
if ( $^O =~ m/^win/i ) {
|
||||
## Detected Windows (probably)
|
||||
$path_sep = "\\"; # single backslash (\)
|
||||
use File::Spec::Win32;
|
||||
} else {
|
||||
$path_sep = '/'; # single slash (/)
|
||||
use File::Spec;
|
||||
}
|
||||
|
||||
GetOptions(
|
||||
'h' => \$help,
|
||||
'help' => \$help,
|
||||
'domain=s' => \$domain,
|
||||
'users=s' => \$users,
|
||||
'confpath=s' => \$config_path,
|
||||
);
|
||||
|
||||
if ( $help ) {
|
||||
usage();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ( ! $domain ) {
|
||||
$domain='default';
|
||||
}
|
||||
|
||||
## Validate users if specified on command line
|
||||
if ( $users ) {
|
||||
($start,$end) = split /-/,$users;
|
||||
if ( ! $start && ! $end ) {
|
||||
die "Please specify both a start and end range, separated by a hyphen:\n add_user --users=xxxx-yyyy\n";
|
||||
}
|
||||
|
||||
unless ( $start =~ m/[1-9]\d+/ ) {
|
||||
die "Start of range '$start' is not numeric or is too short\n";
|
||||
}
|
||||
|
||||
unless ( $end =~ m/[1-9]\d+/ ) {
|
||||
die "End of range '$end' is not numberic or is too short\n";
|
||||
}
|
||||
|
||||
if ( $end <= $start ) {
|
||||
die "End of range needs to be greater than start of range\n";
|
||||
}
|
||||
} else {
|
||||
## Look for user id in $ARGV[0]
|
||||
if ( ! $ARGV[0] ) {
|
||||
die "You must specify user id as a command line argument to add user, or use the --users option.\n";
|
||||
}
|
||||
unless ( $ARGV[0] =~ m/^[1-9]\d+$/ ) {
|
||||
die "User id must be numeric, be at least 2 digits long, and cannot begin with the digit zero.\n"
|
||||
}
|
||||
$user = $ARGV[0];
|
||||
}
|
||||
|
||||
if ( ! $config_path ) {
|
||||
$config_path = '/usr/local/freeswitch/conf';
|
||||
}
|
||||
|
||||
## Check to make sure the directories in question exists
|
||||
unless ( -d $config_path ) {
|
||||
die "Configuration path '$config_path' does not exist.\n";
|
||||
}
|
||||
|
||||
my $directory_path = $config_path . $path_sep . 'directory';
|
||||
unless ( -d $directory_path ) {
|
||||
die "Directory path '$directory_path' does not exist.\n";
|
||||
}
|
||||
|
||||
## Now check domain pathname and test existence
|
||||
if ( ! $domain ) {
|
||||
$domain = 'default';
|
||||
}
|
||||
|
||||
## Full directory path includes the domain name
|
||||
my $full_dir_path = $directory_path . $path_sep . $domain;
|
||||
unless ( -d $full_dir_path ) {
|
||||
die "Full path to directory and domain '$full_dir_path' does not exist. \n";
|
||||
}
|
||||
|
||||
unless ( -w $full_dir_path ) {
|
||||
die "This user does not have write access to '$full_dir_path'.\n";
|
||||
}
|
||||
print "\n";
|
||||
|
||||
## Regexp assemble items to show user what a PCRE might look like for his new users
|
||||
my $ra_present;
|
||||
my $ra_new;
|
||||
my $ra_all;
|
||||
eval { require Regexp::Assemble; };
|
||||
if ( ! $@ ) {
|
||||
## If Regexp::Assemble is available flag it for later building regexes
|
||||
$ra_present = 'true';
|
||||
$ra_new = Regexp::Assemble->new( # new user regex
|
||||
reduce => 1,
|
||||
flags => 0,
|
||||
);
|
||||
$ra_all = Regexp::Assemble->new( # all users regex w/ new users thrown in
|
||||
reduce => 1,
|
||||
flags => 0,
|
||||
);
|
||||
}
|
||||
|
||||
## If we're this far then we can read in the existing users and put them in a hash
|
||||
## Later we can check hash to avoid adding duplicate users
|
||||
my %current_users;
|
||||
my @CURRENT_USER_FILES = glob($full_dir_path . $path_sep . '*.xml');
|
||||
foreach ( @CURRENT_USER_FILES ) {
|
||||
#print "User: $_\n";
|
||||
open(FILEIN,'<',$_);
|
||||
while(<FILEIN>) {
|
||||
next unless m/user id|number-alias/;
|
||||
m/user id="(\d+)"/;
|
||||
my $user_id = $1;
|
||||
if ( ! $user_id ) {
|
||||
m/alias="(\d+)"/;
|
||||
$user_id = $1;
|
||||
}
|
||||
|
||||
next unless $user_id;
|
||||
$current_users{$user_id}++;
|
||||
|
||||
if ( $ra_present && $user_id =~ m/^\d+$/ ) {
|
||||
#print "Adding $user_id to \$re_all...\n";
|
||||
$ra_all->add($user_id)->anchor_line_begin->anchor_line_end;
|
||||
}
|
||||
last;
|
||||
}
|
||||
close(FILEIN);
|
||||
}
|
||||
|
||||
#print Dumper(%current_users) . "\n";
|
||||
if ( $start && $end ) {
|
||||
## Add range of users
|
||||
foreach $user ($start .. $end) {
|
||||
&add_user($user);
|
||||
}
|
||||
} else {
|
||||
## Add single user
|
||||
&add_user($user);
|
||||
}
|
||||
|
||||
print "\nOperation complete. ";
|
||||
if ( $new_user_count == 0 ) {
|
||||
print "No users added.\n";
|
||||
exit(0);
|
||||
} else {
|
||||
printf "%d user%s added.\n", $new_user_count, $new_user_count==1 ? "" : "s";
|
||||
print "Be sure to reloadxml.\n\n";
|
||||
}
|
||||
|
||||
if ( $ra_present ) {
|
||||
print "Regular expression information:\n\n";
|
||||
## Regexp::Assemble adds some stuff we really don't need
|
||||
## These lines just make the regexp pattern a bit more readable
|
||||
my $tmp = $ra_new->as_string;
|
||||
$tmp =~ s/\?://g;
|
||||
$tmp =~ s/^\(\?\-xism:\^/^(/;
|
||||
$tmp =~ s/\$\)$/)\$/;
|
||||
$tmp =~ s/\\d/[0-9]/g; # [0-9] is sometimes easier to read than \d
|
||||
print " Sample regex for all new users: " . $tmp . "\n";
|
||||
$tmp = $ra_all->as_string;
|
||||
$tmp =~ s/\?://g;
|
||||
$tmp =~ s/^\(\?\-xism:\^/^(/;
|
||||
$tmp =~ s/\$\)$/)\$/;
|
||||
$tmp =~ s/\\d/[0-9]/g; # [0-9] is sometimes easier to read than \d
|
||||
print "Sample regex for all new AND current users: " . $tmp . "\n\n";
|
||||
print "In the default configuration you can modify the expression in the condition for 'Local_Extension'.\n";
|
||||
print ""
|
||||
} else {
|
||||
print "If CPAN module Regexp::Assemble were installed this program would be able to suggest a regex for your new users.\n"
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
sub add_user {
|
||||
my $user_id = shift;
|
||||
if ( exists( $current_users{$user_id} ) ) {
|
||||
warn "User id $user_id already exists, skipping...\n";
|
||||
} else {
|
||||
my $new_user = $user_template;
|
||||
$new_user =~ s/__USERID__/$user_id/g;
|
||||
#print "Adding user id '$user_id' with this XML:\n";
|
||||
#print $new_user . "\n";
|
||||
|
||||
## Attempt to create the user file
|
||||
my $user_file_name = $full_dir_path . $path_sep . $user_id . '.xml';
|
||||
|
||||
## Does it already exist?
|
||||
if ( -f $user_file_name ) {
|
||||
warn "$user_file_name exists, skipping...\n";
|
||||
}
|
||||
my $fh;
|
||||
open($fh,'>',$user_file_name);
|
||||
if ( ! $fh ) {
|
||||
warn "Unable to open '$user_file_name' - $!\n";
|
||||
warn "Skipping...\n";
|
||||
next;
|
||||
}
|
||||
|
||||
print $fh $new_user;
|
||||
close($fh);
|
||||
print "Added $user_id in file $user_file_name \n";
|
||||
$new_user_count++;
|
||||
if ( $ra_present ) {
|
||||
$ra_new->add($user_id)->anchor_line_begin->anchor_line_end;
|
||||
$ra_all->add($user_id)->anchor_line_begin->anchor_line_end;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub get_user_template {
|
||||
my $templ = <<ENDUSERTEMPLATE;
|
||||
<include>
|
||||
<user id="__USERID__">
|
||||
<params>
|
||||
<param name="password" value="\$\${default_password}"/>
|
||||
<param name="vm-password" value="__USERID__"/>
|
||||
</params>
|
||||
<variables>
|
||||
<variable name="toll_allow" value="domestic,international,local"/>
|
||||
<variable name="accountcode" value="__USERID__"/>
|
||||
<variable name="user_context" value="default"/>
|
||||
<variable name="effective_caller_id_name" value="Extension __USERID__"/>
|
||||
<variable name="effective_caller_id_number" value="__USERID__"/>
|
||||
<variable name="outbound_caller_id_name" value="\$\${outbound_caller_name}"/>
|
||||
<variable name="outbound_caller_id_number" value="\$\${outbound_caller_id}"/>
|
||||
<variable name="callgroup" value="techsupport"/>
|
||||
</variables>
|
||||
</user>
|
||||
</include>
|
||||
|
||||
ENDUSERTEMPLATE
|
||||
|
||||
return $templ;
|
||||
}
|
||||
|
||||
sub usage {
|
||||
print <<ENDUSAGE;
|
||||
|
||||
FreeSWITCH add user utility
|
||||
|
||||
Adds one or more users to the FreeSWITCH directory using XML files.
|
||||
|
||||
|
||||
Syntax:
|
||||
|
||||
add_user <user_id> [--domain=<domain_name>] [--confpath=<configuration_path>]
|
||||
add_user --users=<start_user_id>-<end_user_id> [--domain=<domain_name>] [--confpath=<configuration_path>]
|
||||
|
||||
In its simplest form, add_user will simply add the user_id specified at the command line.
|
||||
By default, users are added to the "default" domain. Use the --domain option to specify
|
||||
a different domain for the user(s) that are added.
|
||||
|
||||
To specify a range of user IDs use the --users option. Separate the beginning and
|
||||
end of the range with a hyphen (-) character.
|
||||
|
||||
By default add_user will look for the XML directory in its default location of
|
||||
/usr/local/freeswitch/conf/directory. Use the --confpath (configuration path)
|
||||
option to specify an alternate directory location.
|
||||
|
||||
|
||||
NOTES:
|
||||
|
||||
add_user assumes
|
||||
User IDs must be numeric and cannot begin with zero.
|
||||
User IDs must be at least two digits long and have no specific length limit.
|
||||
If a user ID exists it will be skipped.
|
||||
If a domain specified does not exist no users will be created.
|
||||
|
||||
ENDUSAGE
|
||||
|
||||
}
|
||||
@@ -135,6 +135,7 @@ struct switch_core_session {
|
||||
switch_mutex_t *frame_read_mutex;
|
||||
|
||||
switch_thread_rwlock_t *rwlock;
|
||||
switch_thread_rwlock_t *io_rwlock;
|
||||
|
||||
void *streams[SWITCH_MAX_STREAMS];
|
||||
int stream_count;
|
||||
|
||||
@@ -179,8 +179,8 @@ SWITCH_DECLARE(void) switch_channel_uninit(switch_channel_t *channel);
|
||||
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
|
||||
|
||||
/*!
|
||||
\brief Retrive the given channel's caller profile
|
||||
\param channel channel to retrive the profile from
|
||||
\brief Retrieve the given channel's caller profile
|
||||
\param channel channel to retrieve the profile from
|
||||
\return the requested profile
|
||||
*/
|
||||
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_caller_profile(switch_channel_t *channel);
|
||||
@@ -195,8 +195,8 @@ SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel
|
||||
SWITCH_DECLARE(void) switch_channel_set_hunt_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
|
||||
|
||||
/*!
|
||||
\brief Retrive the given channel's originator caller profile
|
||||
\param channel channel to retrive the profile from
|
||||
\brief Retrieve the given channel's originator caller profile
|
||||
\param channel channel to retrieve the profile from
|
||||
\return the requested profile
|
||||
*/
|
||||
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originator_caller_profile(switch_channel_t *channel);
|
||||
@@ -209,8 +209,8 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originator_caller_p
|
||||
SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
|
||||
|
||||
/*!
|
||||
\brief Retrive the given channel's originatee caller profile
|
||||
\param channel channel to retrive the profile from
|
||||
\brief Retrieve the given channel's originatee caller profile
|
||||
\param channel channel to retrieve the profile from
|
||||
\return the requested profile
|
||||
*/
|
||||
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originatee_caller_profile(switch_channel_t *channel);
|
||||
@@ -223,16 +223,16 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originatee_caller_p
|
||||
SWITCH_DECLARE(void) switch_channel_set_origination_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
|
||||
|
||||
/*!
|
||||
\brief Retrive the given channel's origination caller profile
|
||||
\param channel channel to retrive the profile from
|
||||
\brief Retrieve the given channel's origination caller profile
|
||||
\param channel channel to retrieve the profile from
|
||||
\return the requested profile
|
||||
*/
|
||||
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_origination_caller_profile(switch_channel_t *channel);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Retrive the given channel's unique id
|
||||
\param channel channel to retrive the unique id from
|
||||
\brief Retrieve the given channel's unique id
|
||||
\param channel channel to retrieve the unique id from
|
||||
\return the unique id
|
||||
*/
|
||||
SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel_t *channel);
|
||||
@@ -241,7 +241,7 @@ SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel_t *channel);
|
||||
\brief Set a variable on a given channel
|
||||
\param channel channel to set variable on
|
||||
\param varname the name of the variable
|
||||
\param value the vaule of the variable
|
||||
\param value the value of the variable
|
||||
\returns SWITCH_STATUS_SUCCESS if successful
|
||||
*/
|
||||
|
||||
|
||||
@@ -354,6 +354,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void);
|
||||
///\ingroup core1
|
||||
///\{
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_io_read_lock(switch_core_session_t *session);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_io_write_lock(switch_core_session_t *session);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_io_rwunlock(switch_core_session_t *session);
|
||||
|
||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_perform_read_lock(_In_ switch_core_session_t *session, const char *file, const char *func, int line);
|
||||
#endif
|
||||
@@ -882,6 +887,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(_In_ switch_core_sessio
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_get_flags(_In_ switch_core_session_t *session,
|
||||
_In_ const char *app, _In_opt_z_ const char *arg, _Out_opt_ int32_t *flags);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_async(switch_core_session_t *session, const char *app, const char *arg);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_get_app_flags(const char *app, int32_t *flags);
|
||||
|
||||
/*!
|
||||
@@ -1024,6 +1031,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_event(_In_ switch_core
|
||||
*/
|
||||
SWITCH_DECLARE(uint32_t) switch_core_session_event_count(_In_ switch_core_session_t *session);
|
||||
|
||||
/*
|
||||
Number of parsable messages waiting on the session.
|
||||
*/
|
||||
SWITCH_DECLARE(uint32_t) switch_core_session_messages_waiting(switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief DE-Queue an event on a given session
|
||||
\param session the session to de-queue the message on
|
||||
|
||||
@@ -874,6 +874,11 @@ SWITCH_DECLARE(void) switch_ivr_dmachine_set_input_timeout_ms(switch_ivr_dmachin
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_clear_realm(switch_ivr_dmachine_t *dmachine, const char *realm);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_set_realm(switch_ivr_dmachine_t *dmachine, const char *realm);
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_get_file_handle(switch_core_session_t *session, switch_file_handle_t **fh);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_release_file_handle(switch_core_session_t *session, switch_file_handle_t **fh);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_process_fh(switch_core_session_t *session, const char *cmd, switch_file_handle_t *fhp);
|
||||
|
||||
/** @} */
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
/applications/mod_spandsp/mod_spandsp.log
|
||||
/applications/mod_commands/Makefile
|
||||
/applications/mod_conference/Makefile
|
||||
/applications/mod_db/Makefile
|
||||
/applications/mod_dptools/Makefile
|
||||
/applications/mod_enum/Makefile
|
||||
/applications/mod_enum/Makefile.in
|
||||
|
||||
@@ -1346,6 +1346,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
|
||||
switch_time_t t_agent_called = 0;
|
||||
switch_time_t t_agent_answered = 0;
|
||||
switch_time_t t_member_called = atoi(h->member_joined_epoch);
|
||||
switch_event_t *event = NULL;
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
globals.threads++;
|
||||
@@ -1360,6 +1361,21 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
|
||||
switch_safe_free(sql);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Proceed contact the agent to offer the member */
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CALLCENTER_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Queue", h->queue_name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Action", "agent-offering");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Agent", h->agent_name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Agent-Type", h->agent_type);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Agent-System", h->agent_system);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Caller-UUID", h->member_uuid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Caller-CID-Name", h->member_caller_name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Caller-CID-Number", h->member_caller_number);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
/* CallBack Mode */
|
||||
if (!strcasecmp(h->agent_type, CC_AGENT_TYPE_CALLBACK)) {
|
||||
switch_event_create(&ovars, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_event_add_header(ovars, SWITCH_STACK_BOTTOM, "cc_queue", "%s", h->queue_name);
|
||||
@@ -1375,6 +1391,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
|
||||
switch_safe_free(dialstr);
|
||||
|
||||
switch_event_destroy(&ovars);
|
||||
/* UUID Standby Mode */
|
||||
} else if (!strcasecmp(h->agent_type, CC_AGENT_TYPE_UUID_STANDBY)) {
|
||||
agent_session = switch_core_session_locate(h->agent_uuid);
|
||||
if (agent_session) {
|
||||
@@ -1400,14 +1417,17 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
|
||||
cc_agent_update("status", cc_agent_status2str(CC_AGENT_STATUS_LOGGED_OUT), h->agent_name);
|
||||
cc_agent_update("uuid", "", h->agent_name);
|
||||
}
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid agent type '%s' for agent '%s', aborting member offering", h->agent_type, h->agent_name);
|
||||
status = SWITCH_CAUSE_USER_NOT_REGISTERED;
|
||||
}
|
||||
|
||||
/* Originate/Bridge is not finished, processing the return value */
|
||||
if (status == SWITCH_STATUS_SUCCESS) {
|
||||
/* Agent Answered */
|
||||
const char *agent_uuid = switch_core_session_get_uuid(agent_session);
|
||||
switch_channel_t *member_channel = switch_core_session_get_channel(member_session);
|
||||
switch_channel_t *agent_channel = switch_core_session_get_channel(agent_session);
|
||||
switch_event_t *event;
|
||||
|
||||
switch_channel_set_variable(agent_channel, "cc_member_pre_answer_uuid", NULL);
|
||||
|
||||
|
||||
@@ -3968,6 +3968,47 @@ SWITCH_STANDARD_API(uuid_getvar_function)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
#define FILEMAN_SYNTAX "<uuid> <cmd>:<val>"
|
||||
SWITCH_STANDARD_API(uuid_fileman_function)
|
||||
{
|
||||
switch_core_session_t *psession = NULL;
|
||||
char *mycmd = NULL, *argv[4] = { 0 };
|
||||
int argc = 0;
|
||||
|
||||
if (!zstr(cmd) && (mycmd = strdup(cmd))) {
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
if (argc >= 2 && !zstr(argv[0])) {
|
||||
char *uuid = argv[0];
|
||||
char *cmd = argv[1];
|
||||
|
||||
if ((psession = switch_core_session_locate(uuid))) {
|
||||
switch_channel_t *channel;
|
||||
switch_file_handle_t *fh = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(psession);
|
||||
|
||||
if (switch_ivr_get_file_handle(psession, &fh) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_ivr_process_fh(psession, cmd, fh);
|
||||
switch_ivr_release_file_handle(psession, &fh);
|
||||
}
|
||||
|
||||
switch_core_session_rwunlock(psession);
|
||||
|
||||
} else {
|
||||
stream->write_function(stream, "-ERR No Such Channel!\n");
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
stream->write_function(stream, "-USAGE: %s\n", GETVAR_SYNTAX);
|
||||
|
||||
done:
|
||||
switch_safe_free(mycmd);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#define UUID_SEND_DTMF_SYNTAX "<uuid> <dtmf_data>"
|
||||
SWITCH_STANDARD_API(uuid_send_dtmf_function)
|
||||
{
|
||||
@@ -4674,6 +4715,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
|
||||
SWITCH_ADD_API(commands_api_interface, "uuid_display", "change display", uuid_display_function, DISPLAY_SYNTAX);
|
||||
SWITCH_ADD_API(commands_api_interface, "uuid_dump", "uuid_dump", uuid_dump_function, DUMP_SYNTAX);
|
||||
SWITCH_ADD_API(commands_api_interface, "uuid_exists", "see if a uuid exists", uuid_exists_function, EXISTS_SYNTAX);
|
||||
SWITCH_ADD_API(commands_api_interface, "uuid_fileman", "uuid_fileman", uuid_fileman_function, FILEMAN_SYNTAX);
|
||||
SWITCH_ADD_API(commands_api_interface, "uuid_flush_dtmf", "Flush dtmf on a given uuid", uuid_flush_dtmf_function, "<uuid>");
|
||||
SWITCH_ADD_API(commands_api_interface, "uuid_getvar", "uuid_getvar", uuid_getvar_function, GETVAR_SYNTAX);
|
||||
SWITCH_ADD_API(commands_api_interface, "uuid_hold", "hold", uuid_hold_function, HOLD_SYNTAX);
|
||||
@@ -4785,6 +4827,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
|
||||
switch_console_set_complete("add uuid_display ::console::list_uuid");
|
||||
switch_console_set_complete("add uuid_dump ::console::list_uuid");
|
||||
switch_console_set_complete("add uuid_exists ::console::list_uuid");
|
||||
switch_console_set_complete("add uuid_fileman ::console::list_uuid");
|
||||
switch_console_set_complete("add uuid_flush_dtmf ::console::list_uuid");
|
||||
switch_console_set_complete("add uuid_getvar ::console::list_uuid");
|
||||
switch_console_set_complete("add uuid_hold ::console::list_uuid");
|
||||
|
||||
@@ -130,7 +130,7 @@ SWITCH_LIMIT_INCR(limit_incr_hash)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
char *hashkey = NULL;
|
||||
switch_bool_t status = SWITCH_STATUS_SUCCESS;
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
limit_hash_item_t *item = NULL;
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
limit_hash_private_t *pvt = NULL;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
The Cepstral SDK for Windows should be placed in c:\dev\cepstral
|
||||
ex. C:\dev\cepstral\sdk\include
|
||||
This SDK can be obtained from http://cepstral.com/
|
||||
If you want a prebuilt version you may download one from http://files.freeswitch.org/windows/installer/
|
||||
@@ -66,13 +66,13 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Cepstral\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>swift.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Cepstral\sdk\lib\winnt;C:\Program Files\Cepstral\sdk\lib\windows;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>C:\dev\cepstral\sdk\lib\lib-windows;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
@@ -83,13 +83,13 @@
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Cepstral\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>swift.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Cepstral\sdk\lib\winnt;C:\Program Files\Cepstral\sdk\lib\windows;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>C:\dev\cepstral\sdk\lib\lib-windows_x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
@@ -98,13 +98,13 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Cepstral\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>swift.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Cepstral\sdk\lib\winnt;C:\Program Files\Cepstral\sdk\lib\windows;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>C:\dev\cepstral\sdk\lib\lib-windows;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
@@ -115,13 +115,13 @@
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\Cepstral\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>swift.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\Program Files\Cepstral\sdk\lib\winnt;C:\Program Files\Cepstral\sdk\lib\windows;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>C:\dev\cepstral\sdk\lib\lib-windows_x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
@@ -132,9 +132,8 @@
|
||||
<ClCompile Include="mod_cepstral.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\w32\Library\FreeSwitchCore.2008.vcxproj">
|
||||
<ProjectReference Include="..\..\..\..\w32\Library\FreeSwitchCore.2010.vcxproj">
|
||||
<Project>{202d7a4e-760d-4d0e-afa1-d7459ced30ff}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
@@ -62,10 +62,6 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
||||
@@ -514,13 +514,19 @@ static switch_status_t chat_send(const char *proto, const char *from, const char
|
||||
from = hint;
|
||||
} else {
|
||||
char *p;
|
||||
ffrom = switch_mprintf("%s+%s", proto, from);
|
||||
from = ffrom;
|
||||
|
||||
if (!(profile->user_flags & LDL_FLAG_COMPONENT)) {
|
||||
from = ffrom = strdup(profile->login);
|
||||
} else {
|
||||
from = ffrom = switch_mprintf("%s+%s", proto, from);
|
||||
}
|
||||
|
||||
if ((p = strchr(from, '/'))) {
|
||||
*p = '\0';
|
||||
}
|
||||
}
|
||||
ldl_handle_send_msg(profile->handle, (char *) from, (char *) to, NULL, switch_str_nil(body));
|
||||
switch_safe_free(ffrom);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Profile %s\n", f_host ? f_host : "NULL");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
@@ -602,7 +608,7 @@ static void ipchanged_event_handler(switch_event_t *event)
|
||||
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
profile = (mdl_profile_t *) val;
|
||||
if (old_ip4 && !strcmp(profile->extip, old_ip4)) {
|
||||
if (old_ip4 && profile->extip && !strcmp(profile->extip, old_ip4)) {
|
||||
tmp = profile->extip;
|
||||
profile->extip = strdup(new_ip4);
|
||||
switch_safe_free(tmp);
|
||||
|
||||
@@ -158,7 +158,7 @@ typedef enum {
|
||||
#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
|
||||
#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ );
|
||||
|
||||
#define GSMOPEN_P_LOG NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->phone_callflow : -1
|
||||
#define GSMOPEN_P_LOG (void *)NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->phone_callflow : -1
|
||||
|
||||
/*********************************/
|
||||
#define GSMOPEN_CAUSE_NORMAL 1
|
||||
|
||||
@@ -3294,12 +3294,18 @@ int alsa_write(private_t * tech_pvt, short *data, int datalen)
|
||||
time_t now_timestamp;
|
||||
/* size_t frames = 0; */
|
||||
snd_pcm_state_t state;
|
||||
snd_pcm_sframes_t delayp1;
|
||||
snd_pcm_sframes_t delayp2;
|
||||
snd_pcm_sframes_t delayp1=0;
|
||||
snd_pcm_sframes_t delayp2=0;
|
||||
|
||||
if(tech_pvt->no_sound==1){
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
memset(sizbuf, 255, sizeof(sizbuf));
|
||||
memset(sizbuf2, 255, sizeof(sizbuf));
|
||||
memset(silencebuf, 255, sizeof(sizbuf));
|
||||
|
||||
//ERRORA("data=%p, datalen=%d\n", GSMOPEN_P_LOG, (void *)data, datalen);
|
||||
/* We have to digest the frame in 160-byte portions */
|
||||
if (datalen > sizeof(sizbuf) - sizpos) {
|
||||
@@ -3307,8 +3313,11 @@ int alsa_write(private_t * tech_pvt, short *data, int datalen)
|
||||
res = -1;
|
||||
} else {
|
||||
memcpy(sizbuf + sizpos, data, datalen);
|
||||
memset(data, 255, datalen);
|
||||
len += datalen;
|
||||
pos = 0;
|
||||
|
||||
|
||||
#ifdef ALSA_MONITOR
|
||||
alsa_monitor_write(sizbuf, len);
|
||||
#endif
|
||||
@@ -3456,6 +3465,7 @@ int alsa_write(private_t * tech_pvt, short *data, int datalen)
|
||||
if (res == -ESTRPIPE) {
|
||||
ERRORA("You've got some big problems\n", GSMOPEN_P_LOG);
|
||||
} else if (res == -EAGAIN) {
|
||||
DEBUGA_GSMOPEN("Momentarily busy\n", GSMOPEN_P_LOG);
|
||||
res = 0;
|
||||
} else if (res < 0) {
|
||||
ERRORA("Error %d on audio write: \"%s\"\n", GSMOPEN_P_LOG, res, snd_strerror(res));
|
||||
@@ -3572,9 +3582,11 @@ int alsa_read(private_t * tech_pvt, short *data, int datalen)
|
||||
return r;
|
||||
|
||||
} else if (r == -EAGAIN) {
|
||||
DEBUGA_GSMOPEN("ALSA read -EAGAIN, the soundcard is not ready to be read by gsmopen\n", GSMOPEN_P_LOG);
|
||||
int count=0;
|
||||
while (r == -EAGAIN) {
|
||||
gsmopen_sleep(1000);
|
||||
gsmopen_sleep(10000);
|
||||
DEBUGA_GSMOPEN("%d ALSA read -EAGAIN, the soundcard is not ready to be read by gsmopen\n", GSMOPEN_P_LOG, count);
|
||||
count++;
|
||||
|
||||
if (tech_pvt->alsa_capture_is_mono) {
|
||||
r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left);
|
||||
|
||||
@@ -1904,14 +1904,25 @@ static switch_status_t load_config(int reload_type)
|
||||
if (globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
|
||||
res = gsmopen_serial_config(&globals.GSMOPEN_INTERFACES[interface_id]);
|
||||
if (res) {
|
||||
ERRORA("gsmopen_serial_config failed\n", GSMOPEN_P_LOG);
|
||||
ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id);
|
||||
//return SWITCH_STATUS_FALSE;
|
||||
globals.GSMOPEN_INTERFACES[interface_id].running=0;
|
||||
alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_config failed");
|
||||
globals.GSMOPEN_INTERFACES[interface_id].active=0;
|
||||
globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0';
|
||||
continue;
|
||||
int count = 0;
|
||||
ERRORA("gsmopen_serial_config failed, let's try again\n", GSMOPEN_P_LOG);
|
||||
while(res && count < 5){
|
||||
switch_sleep(100000); //0.1 seconds
|
||||
res = gsmopen_serial_config(&globals.GSMOPEN_INTERFACES[interface_id]);
|
||||
count++;
|
||||
if (res) {
|
||||
ERRORA("%d: gsmopen_serial_config failed, let's try again\n", GSMOPEN_P_LOG, count);
|
||||
}
|
||||
}
|
||||
if (res) {
|
||||
ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id);
|
||||
//return SWITCH_STATUS_FALSE;
|
||||
globals.GSMOPEN_INTERFACES[interface_id].running=0;
|
||||
alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_config failed");
|
||||
globals.GSMOPEN_INTERFACES[interface_id].active=0;
|
||||
globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0';
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Since these devices are not part of 'sound' subsystem the group is forced
|
||||
# to audio by name
|
||||
# /dev/cuse can stay mode 0660 root:root since osspd is run as root
|
||||
# and drops privileges to user level when opened by user
|
||||
KERNEL=="dsp", GROUP="audio"
|
||||
KERNEL=="mixer", GROUP="audio"
|
||||
KERNEL=="adsp", GROUP="audio"
|
||||
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1,69 @@
|
||||
# These can be overridden if needed
|
||||
# DESTDIR is completely respected
|
||||
CC := gcc
|
||||
AR := ar
|
||||
CFLAGS := -Wall $(CFLAGS)
|
||||
XLDFLAGS := $(LDFLAGS)
|
||||
LDFLAGS := -L. -lossp $(LDFLAGS)
|
||||
prefix := /usr/local
|
||||
DESTDIR :=
|
||||
UDEVDIR := /etc/udev/rules.d
|
||||
|
||||
ifeq "$(origin OSSPD_CFLAGS)" "undefined"
|
||||
OSSPD_CFLAGS := $(shell pkg-config --cflags fuse)
|
||||
endif
|
||||
|
||||
ifeq "$(origin OSSPD_LDFLAGS)" "undefined"
|
||||
OSSPD_LDFLAGS := $(shell pkg-config --libs fuse)
|
||||
endif
|
||||
|
||||
ifeq "$(origin OSSP_PADSP_CFLAGS)" "undefined"
|
||||
OSSP_PADSP_CFLAGS := $(shell pkg-config --cflags libpulse)
|
||||
endif
|
||||
|
||||
ifeq "$(origin OSSP_PADSP_LDFLAGS)" "undefined"
|
||||
OSSP_PADSP_LDFLAGS := $(shell pkg-config --libs libpulse)
|
||||
endif
|
||||
|
||||
ifeq "$(origin OSSP_ALSAP_CFLAGS)" "undefined"
|
||||
OSSP_ALSAP_CFLAGS := $(shell pkg-config --libs alsa)
|
||||
endif
|
||||
|
||||
ifeq "$(origin OSSP_ALSAP_LDFLAGS)" "undefined"
|
||||
OSSP_ALSAP_LDFLAGS := $(shell pkg-config --libs alsa)
|
||||
endif
|
||||
|
||||
headers := ossp.h ossp-util.h ossp-slave.h
|
||||
|
||||
#all: osspd ossp-padsp ossp-alsap
|
||||
all: osspd ossp-alsap
|
||||
|
||||
install:
|
||||
mkdir -p $(DESTDIR)$(prefix)/sbin
|
||||
install -m755 osspd ossp-padsp ossp-alsap $(DESTDIR)$(prefix)/sbin
|
||||
mkdir -p $(DESTDIR)$(UDEVDIR)
|
||||
install -m644 98-osscuse.rules $(DESTDIR)$(UDEVDIR)
|
||||
|
||||
libossp.a: ossp.c ossp.h ossp-util.c ossp-util.h ossp-slave.c ossp-slave.h
|
||||
$(CC) $(CFLAGS) -c -o ossp.o ossp.c
|
||||
$(CC) $(CFLAGS) -c -o ossp-util.o ossp-util.c
|
||||
$(CC) $(CFLAGS) -c -o ossp-slave.o ossp-slave.c
|
||||
$(AR) rc $@ ossp.o ossp-util.o ossp-slave.o
|
||||
|
||||
osspd: osspd.c libossp.a $(headers)
|
||||
$(CC) $(CFLAGS) $(OSSPD_CFLAGS) -o $@ $< $(OSSPD_LDFLAGS) $(LDFLAGS)
|
||||
|
||||
ossp-padsp: ossp-padsp.c libossp.a $(headers)
|
||||
$(CC) $(CFLAGS) $(OSSP_PADSP_CFLAGS) -o $@ $< $(OSSP_PADSP_LDFLAGS) $(LDFLAGS)
|
||||
|
||||
ossp-alsap: ossp-alsap.c libossp.a $(headers)
|
||||
$(CC) $(CFLAGS) $(OSSP_ALSAP_CFLAGS) -o $@ $< $(OSSP_ALSAP_LDFLAGS) $(LDFLAGS)
|
||||
|
||||
osstest: osstest.c
|
||||
$(CC) $(CFLAGS) -o $@ $< $(XLDFLAGS)
|
||||
|
||||
test: osstest
|
||||
@./osstest
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a osspd ossp-padsp ossp-alsap osstest
|
||||
@@ -0,0 +1,119 @@
|
||||
|
||||
OSS Proxy - emulate OSS device using CUSE
|
||||
|
||||
Copyright (C) 2008-2009 SUSE Linux Products GmbH
|
||||
Copyright (C) 2008-2009 Tejun Heo <tj@kernel.org>
|
||||
|
||||
1. What is it?
|
||||
--------------
|
||||
|
||||
Well, first, OSS refers to Open Sound System. If it still doesn't
|
||||
ring a bell, think /dev/dsp, /dev/adsp and /dev/mixer.
|
||||
|
||||
Currently, Linux supports two audio programming interface - ALSA and
|
||||
OSS. The latter one is deprecated and has been that way for a long
|
||||
time but there still are applications which still use them including
|
||||
UML (usermode Linux) host sound support.
|
||||
|
||||
ALSA contains OSS emulation but sadly the emulation is behind
|
||||
multiplexing layer (which is in userland) which means that if your
|
||||
sound card doesn't support multiple audio streams, only either one of
|
||||
ALSA or OSS interface would be usable at any given moment.
|
||||
|
||||
There have been also attempts to emulate OSS in userland using dynamic
|
||||
library preloading - aoss and more recently padsp. This works for
|
||||
many applications but it's just not easy to emulate everything using
|
||||
the technique. Things like polling, signals, forking, privilege
|
||||
changes make it very difficult to emulate things reliably.
|
||||
|
||||
OSS Proxy uses CUSE (extension of FUSE allowing character devices to
|
||||
be implemented in userspace) to implement OSS interface - /dev/dsp,
|
||||
/dev/adsp and /dev/mixer. From the POV of the applications, these
|
||||
devices are proper character devices and behave exactly the same way
|
||||
so it can be made quite versatile.
|
||||
|
||||
|
||||
2. Hmmm... So, how does the whole thing work?
|
||||
---------------------------------------------
|
||||
|
||||
The OSS Proxy daemon - osspd - should be started first. Note that
|
||||
osspd will fail to start if sound device number regions are already
|
||||
occupied. You'll need to turn off OSS or its emulation[1].
|
||||
|
||||
On startup, osspd creates /dev/dsp, /dev/adsp and /dev/mixer using
|
||||
CUSE. When an application access one of the devices, all IOs are
|
||||
redirected to osspd via CUSE. Upon receiving a new DSP open request,
|
||||
osspd creates a slave process which drops the root privilege and
|
||||
assumes the opening process's credentials. After handshaking, osspd
|
||||
forwards all relevant IOs to the slave which is responsible for
|
||||
actually playing the sound.
|
||||
|
||||
Currently there's only one slave implemented - ossp-padsp, which as
|
||||
the name suggests forwards (again) the sound to pulseaudio. To sum
|
||||
up, the whole pipe looks like the following.
|
||||
|
||||
App <-> /dev/dsp <-> CUSE <-> osspd <-> ossp-padsp <-> pulseaudio
|
||||
|
||||
Which is a lot of forwarding, but on modern machines, it won't be too
|
||||
noticeable.
|
||||
|
||||
|
||||
3. What works?
|
||||
--------------
|
||||
|
||||
Well, MIDI part isn't implemented and I doubt it will be in any near
|
||||
future but except that everything should work. Playing, recording,
|
||||
5.1ch, A-V syncing, all should work. If not, it's a bug, so please
|
||||
report.
|
||||
|
||||
The mixer behaves a bit differently tho. In the original OSS,
|
||||
/dev/mixer is the hardware mixer, so adjusting volumes there affects
|
||||
all audio streams. When using ossp, each process group gets its own
|
||||
mixer and the mixer always contains only two knobs - PCM and IGAIN.
|
||||
Combined with per-stream volume control of pulseaudio, this scheme
|
||||
works quite well for applications with embedded volume control
|
||||
although it makes standalone OSS mixer programs virtually useless[2].
|
||||
|
||||
|
||||
4. How do I use it?
|
||||
-------------------
|
||||
|
||||
First you need CUSE support in kernel which might land on 2.6.28 with
|
||||
sufficient luck[3] and then you also need libfuse which supports
|
||||
CUSE[4]. Once you have both, it should be easy. First build it by
|
||||
running `make'. You can set OSSPD_CFLAGS, OSSPD_LDFLAGS,
|
||||
OSSP_PADSP_CFLAGS and OSSP_PADSP_LDFLAGS if you have stuff at
|
||||
non-default locations.
|
||||
|
||||
After build completes, there will be two executables - `osspd' and
|
||||
`ossp-padsp'. Just copy them to where other system executables live.
|
||||
Specific location doesn't matter as long as both files end up in the
|
||||
same directory.
|
||||
|
||||
Execute `osspd'. It will create the device files and you're all set.
|
||||
`osspd' uses syslog with LOG_DAEMON facility, so if something doesn't
|
||||
work take a look at what osspd complains about.
|
||||
|
||||
|
||||
[1] As of this writing, turning on any sound support makes the
|
||||
soundcore module claim OSS device regions. Patch to make it claim
|
||||
OSS device regions only when OSS support or emulation is enabled
|
||||
is scheduled for 2.6.28. Even with the patch, soundcore will
|
||||
claim OSS device regions if OSS support or ALSA OSS emulation is
|
||||
enabled. Make sure they're turned off.
|
||||
|
||||
[2] If you have a strong reason to use standalone OSS mixer program,
|
||||
you can play some shell tricks to put it into the same process
|
||||
group as the target audio application. e.g. To use aumix with
|
||||
mpg123 - `(mpg123 asdf.mp3 > /dev/null 2>&1 & aumix)', but
|
||||
seriously, just use PA or ALSA one.
|
||||
|
||||
[3] For the time being, here's the git tree with all the necessary
|
||||
changes. This tree is base on top of 2.6.27-rc3.
|
||||
|
||||
http://git.kernel.org/?p=linux/kernel/git/tj/misc.git;a=shortlog;h=cuse
|
||||
git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git cuse
|
||||
|
||||
[4] And libfuse with the modifications can be found at...
|
||||
|
||||
http://userweb.kernel.org/~tj/ossp/fuse-cuse.tar.gz
|
||||
@@ -0,0 +1,613 @@
|
||||
/*
|
||||
* ossp-alsap - ossp DSP slave which forwards to alsa
|
||||
*
|
||||
* Copyright (C) 2009 Maarten Lankhorst <m.b.lankhorst@gmail.com>
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
*
|
||||
* Why an alsa plugin as well? Just to show how much
|
||||
* the alsa userspace api sucks ;-)
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <poll.h>
|
||||
#include <pthread.h>
|
||||
#include <pwd.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
#include <sys/soundcard.h>
|
||||
|
||||
#include "ossp-slave.h"
|
||||
|
||||
enum {
|
||||
AFMT_FLOAT = 0x00004000,
|
||||
AFMT_S32_LE = 0x00001000,
|
||||
AFMT_S32_BE = 0x00002000,
|
||||
};
|
||||
|
||||
static size_t page_size;
|
||||
|
||||
/* alsa structures */
|
||||
static snd_pcm_t *pcm[2];
|
||||
static snd_pcm_hw_params_t *hw_params;
|
||||
static snd_pcm_sw_params_t *sw_params;
|
||||
static int block;
|
||||
|
||||
static unsigned int byte_counter[2];
|
||||
static snd_pcm_uframes_t mmap_pos[2];
|
||||
static int stream_corked[2];
|
||||
static int stream_notify;
|
||||
|
||||
static struct format {
|
||||
snd_pcm_format_t format;
|
||||
snd_pcm_sframes_t rate;
|
||||
int channels;
|
||||
} hw_format = { SND_PCM_FORMAT_U8, 8000, 1 };
|
||||
|
||||
#if 0
|
||||
/* future mmap stuff */
|
||||
static size_t mmap_raw_size, mmap_size;
|
||||
static int mmap_fd[2] = { -1, -1 };
|
||||
static void *mmap_map[2];
|
||||
static uint64_t mmap_idx[2]; /* mmap pointer */
|
||||
static uint64_t mmap_last_idx[2]; /* last idx for get_ptr */
|
||||
static struct ring_buf mmap_stg[2]; /* staging ring buffer */
|
||||
static size_t mmap_lead[2]; /* lead bytes */
|
||||
static int mmap_sync[2]; /* sync with backend stream */
|
||||
#endif
|
||||
|
||||
static snd_pcm_format_t fmt_oss_to_alsa(int fmt)
|
||||
{
|
||||
switch (fmt) {
|
||||
case AFMT_U8: return SND_PCM_FORMAT_U8;
|
||||
case AFMT_A_LAW: return SND_PCM_FORMAT_A_LAW;
|
||||
case AFMT_MU_LAW: return SND_PCM_FORMAT_MU_LAW;
|
||||
case AFMT_S16_LE: return SND_PCM_FORMAT_S16_LE;
|
||||
case AFMT_S16_BE: return SND_PCM_FORMAT_S16_BE;
|
||||
case AFMT_FLOAT: return SND_PCM_FORMAT_FLOAT;
|
||||
case AFMT_S32_LE: return SND_PCM_FORMAT_S32_LE;
|
||||
case AFMT_S32_BE: return SND_PCM_FORMAT_S32_BE;
|
||||
default: return SND_PCM_FORMAT_U8;
|
||||
}
|
||||
}
|
||||
|
||||
static int fmt_alsa_to_oss(snd_pcm_format_t fmt)
|
||||
{
|
||||
switch (fmt) {
|
||||
case SND_PCM_FORMAT_U8: return AFMT_U8;
|
||||
case SND_PCM_FORMAT_A_LAW: return AFMT_A_LAW;
|
||||
case SND_PCM_FORMAT_MU_LAW: return AFMT_MU_LAW;
|
||||
case SND_PCM_FORMAT_S16_LE: return AFMT_S16_LE;
|
||||
case SND_PCM_FORMAT_S16_BE: return AFMT_S16_BE;
|
||||
case SND_PCM_FORMAT_FLOAT: return AFMT_FLOAT;
|
||||
case SND_PCM_FORMAT_S32_LE: return AFMT_S32_LE;
|
||||
case SND_PCM_FORMAT_S32_BE: return AFMT_S32_BE;
|
||||
default: return AFMT_U8;
|
||||
}
|
||||
}
|
||||
|
||||
static void flush_streams(int drain)
|
||||
{
|
||||
/* FIXME: snd_pcm_drain appears to be able to deadlock,
|
||||
* always drop or check state? */
|
||||
if (drain) {
|
||||
if (pcm[PLAY])
|
||||
snd_pcm_drain(pcm[PLAY]);
|
||||
if (pcm[REC])
|
||||
snd_pcm_drain(pcm[REC]);
|
||||
} else {
|
||||
if (pcm[PLAY])
|
||||
snd_pcm_drop(pcm[PLAY]);
|
||||
if (pcm[REC])
|
||||
snd_pcm_drop(pcm[REC]);
|
||||
}
|
||||
|
||||
/* XXX: Really needed? */
|
||||
#if 0
|
||||
if (pcm[PLAY]) {
|
||||
snd_pcm_close(pcm[PLAY]);
|
||||
snd_pcm_open(&pcm[PLAY], "default",
|
||||
SND_PCM_STREAM_PLAYBACK, block);
|
||||
}
|
||||
if (pcm[REC]) {
|
||||
snd_pcm_close(pcm[REC]);
|
||||
snd_pcm_open(&pcm[REC], "default",
|
||||
SND_PCM_STREAM_CAPTURE, block);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void kill_streams(void)
|
||||
{
|
||||
flush_streams(0);
|
||||
}
|
||||
|
||||
static int trigger_streams(int play, int rec)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (pcm[PLAY] && play >= 0) {
|
||||
ret = snd_pcm_sw_params_set_start_threshold(pcm[PLAY], sw_params,
|
||||
play ? 1 : -1);
|
||||
if (ret >= 0)
|
||||
snd_pcm_sw_params(pcm[PLAY], sw_params);
|
||||
}
|
||||
if (ret >= 0 && pcm[REC] && rec >= 0) {
|
||||
ret = snd_pcm_sw_params_set_start_threshold(pcm[REC], sw_params,
|
||||
rec ? 1 : -1);
|
||||
if (ret >= 0)
|
||||
snd_pcm_sw_params(pcm[REC], sw_params);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t alsap_mixer(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
static int set_hw_params(snd_pcm_t *pcm)
|
||||
{
|
||||
int ret;
|
||||
unsigned rate;
|
||||
|
||||
ret = snd_pcm_hw_params_any(pcm, hw_params);
|
||||
if (ret >= 0)
|
||||
ret = snd_pcm_hw_params_set_access(pcm, hw_params,
|
||||
SND_PCM_ACCESS_RW_INTERLEAVED);
|
||||
rate = hw_format.rate;
|
||||
if (ret >= 0)
|
||||
ret = snd_pcm_hw_params_set_rate_minmax(pcm, hw_params,
|
||||
&rate, NULL,
|
||||
&rate, NULL);
|
||||
if (ret >= 0)
|
||||
ret = snd_pcm_hw_params_set_format(pcm, hw_params, hw_format.format);
|
||||
if (ret >= 0)
|
||||
ret = snd_pcm_hw_params_set_channels(pcm, hw_params,
|
||||
hw_format.channels);
|
||||
if (ret >= 0)
|
||||
ret = snd_pcm_hw_params(pcm, hw_params);
|
||||
if (ret >= 0)
|
||||
ret = snd_pcm_sw_params_current(pcm, sw_params);
|
||||
if (ret >= 0)
|
||||
ret = snd_pcm_sw_params(pcm, sw_params);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t alsap_open(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
struct ossp_dsp_open_arg *arg = carg;
|
||||
int ret;
|
||||
block = arg->flags & O_NONBLOCK ? SND_PCM_NONBLOCK : 0;
|
||||
int access;
|
||||
// block |= SND_PCM_ASYNC;
|
||||
/* Woop dee dooo.. I love handling things in SIGIO (PAIN!!)
|
||||
* Probably needed for MMAP
|
||||
*/
|
||||
|
||||
if (!hw_params)
|
||||
ret = snd_pcm_hw_params_malloc(&hw_params);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!sw_params)
|
||||
ret = snd_pcm_sw_params_malloc(&sw_params);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (pcm[PLAY])
|
||||
snd_pcm_close(pcm[PLAY]);
|
||||
if (pcm[REC])
|
||||
snd_pcm_close(pcm[REC]);
|
||||
pcm[REC] = pcm[PLAY] = NULL;
|
||||
|
||||
access = arg->flags & O_ACCMODE;
|
||||
if (access == O_WRONLY || access == O_RDWR) {
|
||||
ret = snd_pcm_open(&pcm[PLAY], "default",
|
||||
SND_PCM_STREAM_PLAYBACK, block);
|
||||
if (ret >= 0)
|
||||
ret = set_hw_params(pcm[PLAY]);
|
||||
}
|
||||
|
||||
if (ret >= 0 && (access == O_RDONLY || access == O_RDWR)) {
|
||||
ret = snd_pcm_open(&pcm[REC], "default",
|
||||
SND_PCM_STREAM_CAPTURE, block);
|
||||
if (ret >= 0)
|
||||
ret = set_hw_params(pcm[REC]);
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
if (pcm[PLAY])
|
||||
snd_pcm_close(pcm[PLAY]);
|
||||
if (pcm[REC])
|
||||
snd_pcm_close(pcm[REC]);
|
||||
pcm[REC] = pcm[PLAY] = NULL;
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define GIOVANNI
|
||||
#ifdef GIOVANNI
|
||||
|
||||
#define GIOVA_SLEEP 40000
|
||||
#define GIOVA_BLK 3840
|
||||
static ssize_t alsap_write(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
usleep((GIOVA_SLEEP/GIOVA_BLK)* din_sz);
|
||||
return din_sz;
|
||||
}
|
||||
static ssize_t alsap_read(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
usleep((GIOVA_SLEEP/GIOVA_BLK)* *dout_szp);
|
||||
return *dout_szp;
|
||||
}
|
||||
#else// GIOVANNI
|
||||
static ssize_t alsap_write(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
// struct ossp_dsp_rw_arg *arg = carg;
|
||||
int ret, insize;
|
||||
|
||||
insize = snd_pcm_bytes_to_frames(pcm[PLAY], din_sz);
|
||||
|
||||
if (snd_pcm_state(pcm[PLAY]) == SND_PCM_STATE_SETUP)
|
||||
snd_pcm_prepare(pcm[PLAY]);
|
||||
|
||||
// snd_pcm_start(pcm[PLAY]);
|
||||
ret = snd_pcm_writei(pcm[PLAY], din, insize);
|
||||
if (ret < 0)
|
||||
ret = snd_pcm_recover(pcm[PLAY], ret, 1);
|
||||
|
||||
if (ret >= 0)
|
||||
return snd_pcm_frames_to_bytes(pcm[PLAY], ret);
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t alsap_read(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
// struct ossp_dsp_rw_arg *arg = carg;
|
||||
int ret, outsize;
|
||||
|
||||
outsize = snd_pcm_bytes_to_frames(pcm[REC], *dout_szp);
|
||||
|
||||
if (snd_pcm_state(pcm[REC]) == SND_PCM_STATE_SETUP)
|
||||
snd_pcm_prepare(pcm[REC]);
|
||||
|
||||
ret = snd_pcm_readi(pcm[REC], dout, outsize);
|
||||
if (ret < 0)
|
||||
ret = snd_pcm_recover(pcm[REC], ret, 1);
|
||||
if (ret >= 0)
|
||||
*dout_szp = ret = snd_pcm_frames_to_bytes(pcm[REC], ret);
|
||||
else
|
||||
*dout_szp = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif// GIOVANNI
|
||||
|
||||
static ssize_t alsap_poll(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
unsigned revents = 0;
|
||||
|
||||
stream_notify |= *(int *)carg;
|
||||
|
||||
if (pcm[PLAY])
|
||||
revents |= POLLOUT;
|
||||
if (pcm[REC])
|
||||
revents |= POLLIN;
|
||||
|
||||
*(unsigned *)rarg = revents;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static ssize_t alsap_flush(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
flush_streams(opcode == OSSP_DSP_SYNC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t alsap_post(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = trigger_streams(1, 1);
|
||||
if (ret >= 0 && pcm[PLAY])
|
||||
ret = snd_pcm_start(pcm[PLAY]);
|
||||
if (pcm[REC])
|
||||
ret = snd_pcm_start(pcm[REC]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t alsap_get_param(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp,
|
||||
int tfd)
|
||||
{
|
||||
int v = 0;
|
||||
|
||||
switch (opcode) {
|
||||
case OSSP_DSP_GET_RATE:
|
||||
return hw_format.rate;
|
||||
|
||||
case OSSP_DSP_GET_CHANNELS:
|
||||
return hw_format.channels;
|
||||
|
||||
case OSSP_DSP_GET_FORMAT: {
|
||||
v = fmt_alsa_to_oss(hw_format.format);
|
||||
break;
|
||||
}
|
||||
|
||||
case OSSP_DSP_GET_BLKSIZE: {
|
||||
snd_pcm_uframes_t psize;
|
||||
snd_pcm_hw_params_get_period_size(hw_params, &psize, NULL);
|
||||
v = psize;
|
||||
break;
|
||||
}
|
||||
|
||||
case OSSP_DSP_GET_FORMATS:
|
||||
v = AFMT_U8 | AFMT_A_LAW | AFMT_MU_LAW | AFMT_S16_LE |
|
||||
AFMT_S16_BE | AFMT_FLOAT | AFMT_S32_LE | AFMT_S32_BE;
|
||||
break;
|
||||
|
||||
case OSSP_DSP_GET_TRIGGER:
|
||||
if (!stream_corked[PLAY])
|
||||
v |= PCM_ENABLE_OUTPUT;
|
||||
if (!stream_corked[REC])
|
||||
v |= PCM_ENABLE_INPUT;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
|
||||
*(int *)rarg = v;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t alsap_set_param(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp,
|
||||
int tfd)
|
||||
{
|
||||
int v = *(int *)carg;
|
||||
int ret = 0;
|
||||
|
||||
/* kill the streams before changing parameters */
|
||||
kill_streams();
|
||||
|
||||
switch (opcode) {
|
||||
case OSSP_DSP_SET_RATE: {
|
||||
hw_format.rate = v;
|
||||
break;
|
||||
}
|
||||
|
||||
case OSSP_DSP_SET_CHANNELS: {
|
||||
hw_format.channels = v;
|
||||
break;
|
||||
}
|
||||
|
||||
case OSSP_DSP_SET_FORMAT: {
|
||||
snd_pcm_format_t format = fmt_oss_to_alsa(v);
|
||||
hw_format.format = format;
|
||||
break;
|
||||
}
|
||||
|
||||
case OSSP_DSP_SET_SUBDIVISION:
|
||||
if (!v)
|
||||
v = 1;
|
||||
#if 0
|
||||
if (!v) {
|
||||
v = user_subdivision ?: 1;
|
||||
break;
|
||||
}
|
||||
user_frag_size = 0;
|
||||
user_subdivision = v;
|
||||
break;
|
||||
|
||||
case OSSP_DSP_SET_FRAGMENT:
|
||||
user_subdivision = 0;
|
||||
user_frag_size = 1 << (v & 0xffff);
|
||||
user_max_frags = (v >> 16) & 0xffff;
|
||||
if (user_frag_size < 4)
|
||||
user_frag_size = 4;
|
||||
if (user_max_frags < 2)
|
||||
user_max_frags = 2;
|
||||
#else
|
||||
case OSSP_DSP_SET_FRAGMENT:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
|
||||
if (pcm[PLAY])
|
||||
ret = set_hw_params(pcm[PLAY]);
|
||||
if (ret >= 0 && pcm[REC])
|
||||
ret = set_hw_params(pcm[REC]);
|
||||
|
||||
if (rarg)
|
||||
*(int *)rarg = v;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t alsap_set_trigger(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp,
|
||||
int fd)
|
||||
{
|
||||
int enable = *(int *)carg;
|
||||
|
||||
stream_corked[PLAY] = !!(enable & PCM_ENABLE_OUTPUT);
|
||||
stream_corked[REC] = !!(enable & PCM_ENABLE_INPUT);
|
||||
|
||||
return trigger_streams(enable & PCM_ENABLE_OUTPUT,
|
||||
enable & PCM_ENABLE_INPUT);
|
||||
}
|
||||
|
||||
static ssize_t alsap_get_space(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
int dir = (opcode == OSSP_DSP_GET_OSPACE) ? PLAY : REC;
|
||||
int underrun = 0;
|
||||
struct audio_buf_info info = { };
|
||||
unsigned long bufsize;
|
||||
snd_pcm_uframes_t avail, fragsize;
|
||||
snd_pcm_state_t state;
|
||||
|
||||
if (!pcm[dir])
|
||||
return -EINVAL;
|
||||
|
||||
state = snd_pcm_state(pcm[dir]);
|
||||
if (state == SND_PCM_STATE_XRUN) {
|
||||
snd_pcm_recover(pcm[dir], -EPIPE, 0);
|
||||
underrun = 1;
|
||||
} else if (state == SND_PCM_STATE_SUSPENDED) {
|
||||
snd_pcm_recover(pcm[dir], -ESTRPIPE, 0);
|
||||
underrun = 1;
|
||||
}
|
||||
|
||||
snd_pcm_hw_params_current(pcm[dir], hw_params);
|
||||
snd_pcm_hw_params_get_period_size(hw_params, &fragsize, NULL);
|
||||
snd_pcm_hw_params_get_buffer_size(hw_params, &bufsize);
|
||||
info.fragsize = snd_pcm_frames_to_bytes(pcm[dir], fragsize);
|
||||
info.fragstotal = bufsize / fragsize;
|
||||
if (!underrun) {
|
||||
avail = snd_pcm_avail_update(pcm[dir]);
|
||||
info.fragments = avail / fragsize;
|
||||
} else
|
||||
info.fragments = info.fragstotal;
|
||||
|
||||
info.bytes = info.fragsize * info.fragments;
|
||||
|
||||
*(struct audio_buf_info *)rarg = info;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t alsap_get_ptr(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp, int tfd)
|
||||
{
|
||||
int dir = (opcode == OSSP_DSP_GET_OPTR) ? PLAY : REC;
|
||||
struct count_info info = { };
|
||||
|
||||
if (!pcm[dir])
|
||||
return -EIO;
|
||||
|
||||
snd_pcm_hw_params_current(pcm[dir], hw_params);
|
||||
info.bytes = byte_counter[dir];
|
||||
snd_pcm_hw_params_get_periods(hw_params, (unsigned int *)&info.blocks, NULL);
|
||||
info.ptr = mmap_pos[dir];
|
||||
|
||||
*(struct count_info *)rarg = info;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t alsap_get_odelay(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp,
|
||||
int fd)
|
||||
{
|
||||
snd_pcm_sframes_t delay;
|
||||
|
||||
if (!pcm[PLAY])
|
||||
return -EIO;
|
||||
|
||||
if (snd_pcm_delay(pcm[PLAY], &delay) < 0)
|
||||
return -EIO;
|
||||
|
||||
*(int *)rarg = snd_pcm_frames_to_bytes(pcm[PLAY], delay);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ossp_action_fn_t action_fn_tbl[OSSP_NR_OPCODES] = {
|
||||
[OSSP_MIXER] = alsap_mixer,
|
||||
[OSSP_DSP_OPEN] = alsap_open,
|
||||
[OSSP_DSP_READ] = alsap_read,
|
||||
[OSSP_DSP_WRITE] = alsap_write,
|
||||
[OSSP_DSP_POLL] = alsap_poll,
|
||||
#if 0
|
||||
[OSSP_DSP_MMAP] = alsap_mmap,
|
||||
[OSSP_DSP_MUNMAP] = alsap_munmap,
|
||||
#endif
|
||||
[OSSP_DSP_RESET] = alsap_flush,
|
||||
[OSSP_DSP_SYNC] = alsap_flush,
|
||||
[OSSP_DSP_POST] = alsap_post,
|
||||
[OSSP_DSP_GET_RATE] = alsap_get_param,
|
||||
[OSSP_DSP_GET_CHANNELS] = alsap_get_param,
|
||||
[OSSP_DSP_GET_FORMAT] = alsap_get_param,
|
||||
[OSSP_DSP_GET_BLKSIZE] = alsap_get_param,
|
||||
[OSSP_DSP_GET_FORMATS] = alsap_get_param,
|
||||
[OSSP_DSP_SET_RATE] = alsap_set_param,
|
||||
[OSSP_DSP_SET_CHANNELS] = alsap_set_param,
|
||||
[OSSP_DSP_SET_FORMAT] = alsap_set_param,
|
||||
[OSSP_DSP_SET_SUBDIVISION] = alsap_set_param,
|
||||
[OSSP_DSP_SET_FRAGMENT] = alsap_set_param,
|
||||
[OSSP_DSP_GET_TRIGGER] = alsap_get_param,
|
||||
[OSSP_DSP_SET_TRIGGER] = alsap_set_trigger,
|
||||
[OSSP_DSP_GET_OSPACE] = alsap_get_space,
|
||||
[OSSP_DSP_GET_ISPACE] = alsap_get_space,
|
||||
[OSSP_DSP_GET_OPTR] = alsap_get_ptr,
|
||||
[OSSP_DSP_GET_IPTR] = alsap_get_ptr,
|
||||
[OSSP_DSP_GET_ODELAY] = alsap_get_odelay,
|
||||
};
|
||||
|
||||
static int action_pre(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void action_post(void)
|
||||
{
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int rc;
|
||||
|
||||
ossp_slave_init(argc, argv);
|
||||
|
||||
page_size = sysconf(_SC_PAGE_SIZE);
|
||||
|
||||
/* Okay, now we're open for business */
|
||||
rc = 0;
|
||||
do {
|
||||
rc = ossp_slave_process_command(ossp_cmd_fd, action_fn_tbl,
|
||||
action_pre, action_post);
|
||||
} while (rc > 0);
|
||||
|
||||
return rc ? 1 : 0;
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
* ossp-slave - OSS Proxy: Common codes for slaves
|
||||
*
|
||||
* Copyright (C) 2008-2010 SUSE Linux Products GmbH
|
||||
* Copyright (C) 2008-2010 Tejun Heo <tj@kernel.org>
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <pwd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "ossp-slave.h"
|
||||
|
||||
static const char *usage =
|
||||
"usage: ossp-SLAVE [options]\n"
|
||||
"\n"
|
||||
"proxies commands from osspd to pulseaudio\n"
|
||||
"\n"
|
||||
"options:\n"
|
||||
" -u UID uid to use\n"
|
||||
" -g GID gid to use\n"
|
||||
" -c CMD_FD fd to receive commands from osspd\n"
|
||||
" -n NOTIFY_FD fd to send async notifications to osspd\n"
|
||||
" -m MMAP_FD fd to use for mmap\n"
|
||||
" -o MMAP_OFFSET mmap offset\n"
|
||||
" -s MMAP_SIZE mmap size\n"
|
||||
" -l LOG_LEVEL set log level\n"
|
||||
" -t enable log timestamps\n";
|
||||
|
||||
char ossp_user_name[OSSP_USER_NAME_LEN];
|
||||
int ossp_cmd_fd = -1, ossp_notify_fd = -1;
|
||||
void *ossp_mmap_addr[2];
|
||||
|
||||
void ossp_slave_init(int argc, char **argv)
|
||||
{
|
||||
int have_uid = 0, have_gid = 0;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
int mmap_fd = -1;
|
||||
off_t mmap_off = 0;
|
||||
size_t mmap_size = 0;
|
||||
int opt;
|
||||
struct passwd *pw, pw_buf;
|
||||
struct sigaction sa;
|
||||
char pw_sbuf[sysconf(_SC_GETPW_R_SIZE_MAX)];
|
||||
|
||||
while ((opt = getopt(argc, argv, "u:g:c:n:m:o:s:l:t")) != -1) {
|
||||
switch (opt) {
|
||||
case 'u':
|
||||
have_uid = 1;
|
||||
uid = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
case 'g':
|
||||
have_gid = 1;
|
||||
gid = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
case 'c':
|
||||
ossp_cmd_fd = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
case 'n':
|
||||
ossp_notify_fd = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
case 'm':
|
||||
mmap_fd = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
case 'o':
|
||||
mmap_off = strtoull(optarg, NULL, 0);
|
||||
break;
|
||||
case 's':
|
||||
mmap_size = strtoul(optarg, NULL, 0);
|
||||
break;
|
||||
case 'l':
|
||||
ossp_log_level = strtol(optarg, NULL, 0);
|
||||
break;
|
||||
case 't':
|
||||
ossp_log_timestamp = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!have_uid || !have_gid || ossp_cmd_fd < 0 || ossp_notify_fd < 0) {
|
||||
fprintf(stderr, usage);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
snprintf(ossp_user_name, sizeof(ossp_user_name), "uid%d", uid);
|
||||
if (getpwuid_r(uid, &pw_buf, pw_sbuf, sizeof(pw_sbuf), &pw) == 0)
|
||||
snprintf(ossp_user_name, sizeof(ossp_user_name), "%s",
|
||||
pw->pw_name);
|
||||
|
||||
snprintf(ossp_log_name, sizeof(ossp_log_name), "ossp-padsp[%s:%d]",
|
||||
ossp_user_name, getpid());
|
||||
|
||||
if (mmap_fd >= 0) {
|
||||
void *p;
|
||||
|
||||
if (!mmap_off || !mmap_size) {
|
||||
fprintf(stderr, usage);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
p = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
mmap_fd, mmap_off);
|
||||
if (p == MAP_FAILED)
|
||||
fatal_e(-errno, "mmap failed");
|
||||
|
||||
ossp_mmap_addr[PLAY] = p;
|
||||
ossp_mmap_addr[REC] = p + mmap_size / 2;
|
||||
close(mmap_fd);
|
||||
}
|
||||
|
||||
/* mmap done, drop privileges */
|
||||
if (setresgid(gid, gid, gid) || setresuid(uid, uid, uid))
|
||||
fatal_e(-errno, "failed to drop privileges");
|
||||
|
||||
/* block SIGPIPE */
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_handler = SIG_IGN;
|
||||
if (sigaction(SIGPIPE, &sa, NULL))
|
||||
fatal_e(-errno, "failed to ignore SIGPIPE");
|
||||
}
|
||||
|
||||
int ossp_slave_process_command(int cmd_fd,
|
||||
ossp_action_fn_t const *action_fn_tbl,
|
||||
int (*action_pre_fn)(void),
|
||||
void (*action_post_fn)(void))
|
||||
{
|
||||
static struct sized_buf carg_sbuf = { }, rarg_sbuf = { };
|
||||
static struct sized_buf din_sbuf = { }, dout_sbuf = { };
|
||||
struct ossp_cmd cmd;
|
||||
int fd = -1;
|
||||
char cmsg_buf[CMSG_SPACE(sizeof(fd))];
|
||||
struct iovec iov = { &cmd, sizeof(cmd) };
|
||||
struct msghdr msg = { .msg_iov = &iov, .msg_iovlen = 1,
|
||||
.msg_control = cmsg_buf,
|
||||
.msg_controllen = sizeof(cmsg_buf) };
|
||||
struct cmsghdr *cmsg;
|
||||
size_t carg_size, din_size, rarg_size, dout_size;
|
||||
char *carg = NULL, *din = NULL, *rarg = NULL, *dout = NULL;
|
||||
struct ossp_reply reply = { .magic = OSSP_REPLY_MAGIC };
|
||||
ssize_t ret;
|
||||
|
||||
ret = recvmsg(cmd_fd, &msg, 0);
|
||||
if (ret == 0)
|
||||
return 0;
|
||||
if (ret < 0) {
|
||||
ret = -errno;
|
||||
err_e(ret, "failed to read command channel");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ret != sizeof(cmd)) {
|
||||
err("command struct size mismatch (%zu, should be %zu)",
|
||||
ret, sizeof(cmd));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (cmd.magic != OSSP_CMD_MAGIC) {
|
||||
err("illegal command magic 0x%x", cmd.magic);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg;
|
||||
cmsg = CMSG_NXTHDR(&msg, cmsg)) {
|
||||
if (cmsg->cmsg_level == SOL_SOCKET &&
|
||||
cmsg->cmsg_type == SCM_RIGHTS)
|
||||
fd = *(int *)CMSG_DATA(cmsg);
|
||||
else {
|
||||
err("unknown cmsg %d:%d received (opcode %d)",
|
||||
cmsg->cmsg_level, cmsg->cmsg_type, cmd.opcode);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.opcode >= OSSP_NR_OPCODES) {
|
||||
err("unknown opcode %d", cmd.opcode);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
carg_size = ossp_arg_sizes[cmd.opcode].carg_size;
|
||||
din_size = cmd.din_size;
|
||||
rarg_size = ossp_arg_sizes[cmd.opcode].rarg_size;
|
||||
dout_size = cmd.dout_size;
|
||||
|
||||
if ((fd >= 0) != ossp_arg_sizes[cmd.opcode].has_fd) {
|
||||
err("fd=%d unexpected for opcode %d", fd, cmd.opcode);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ensure_sbuf_size(&carg_sbuf, carg_size) ||
|
||||
ensure_sbuf_size(&din_sbuf, din_size) ||
|
||||
ensure_sbuf_size(&rarg_sbuf, rarg_size) ||
|
||||
ensure_sbuf_size(&dout_sbuf, dout_size)) {
|
||||
err("failed to allocate command buffers");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (carg_size) {
|
||||
carg = carg_sbuf.buf;
|
||||
ret = read_fill(cmd_fd, carg, carg_size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
if (din_size) {
|
||||
din = din_sbuf.buf;
|
||||
ret = read_fill(cmd_fd, din, din_size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
if (rarg_size)
|
||||
rarg = rarg_sbuf.buf;
|
||||
if (dout_size)
|
||||
dout = dout_sbuf.buf;
|
||||
|
||||
ret = -EINVAL;
|
||||
if (action_fn_tbl[cmd.opcode]) {
|
||||
ret = action_pre_fn();
|
||||
if (ret == 0) {
|
||||
ret = action_fn_tbl[cmd.opcode](cmd.opcode, carg,
|
||||
din, din_size, rarg,
|
||||
dout, &dout_size, fd);
|
||||
action_post_fn();
|
||||
}
|
||||
}
|
||||
|
||||
reply.result = ret;
|
||||
if (ret >= 0)
|
||||
reply.dout_size = dout_size;
|
||||
else {
|
||||
rarg_size = 0;
|
||||
dout_size = 0;
|
||||
}
|
||||
|
||||
if (write_fill(cmd_fd, &reply, sizeof(reply)) < 0 ||
|
||||
write_fill(cmd_fd, rarg, rarg_size) < 0 ||
|
||||
write_fill(cmd_fd, dout, dout_size) < 0)
|
||||
return -EIO;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* ossp-slave - OSS Proxy: Common codes for slaves
|
||||
*
|
||||
* Copyright (C) 2008-2010 SUSE Linux Products GmbH
|
||||
* Copyright (C) 2008-2010 Tejun Heo <tj@kernel.org>
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
*/
|
||||
|
||||
#ifndef _OSSP_SLAVE_H
|
||||
#define _OSSP_SLAVE_H
|
||||
|
||||
#include "ossp.h"
|
||||
#include "ossp-util.h"
|
||||
|
||||
#define OSSP_USER_NAME_LEN 128
|
||||
|
||||
extern char ossp_user_name[OSSP_USER_NAME_LEN];
|
||||
extern int ossp_cmd_fd, ossp_notify_fd;
|
||||
extern void *ossp_mmap_addr[2];
|
||||
|
||||
void ossp_slave_init(int argc, char **argv);
|
||||
int ossp_slave_process_command(int cmd_fd,
|
||||
ossp_action_fn_t const *action_fn_tbl,
|
||||
int (*action_pre_fn)(void),
|
||||
void (*action_post_fn)(void));
|
||||
|
||||
#endif /* _OSSP_SLAVE_H */
|
||||
@@ -0,0 +1,369 @@
|
||||
/*
|
||||
* ossp-util - OSS Proxy: Common utilities
|
||||
*
|
||||
* Copyright (C) 2008-2010 SUSE Linux Products GmbH
|
||||
* Copyright (C) 2008-2010 Tejun Heo <tj@kernel.org>
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
#include "ossp-util.h"
|
||||
|
||||
#define BIT(nr) (1UL << (nr))
|
||||
#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
|
||||
#define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
|
||||
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
|
||||
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
|
||||
|
||||
char ossp_log_name[OSSP_LOG_NAME_LEN];
|
||||
int ossp_log_level = OSSP_LOG_DFL;
|
||||
int ossp_log_timestamp;
|
||||
|
||||
static const char *severity_strs[] = {
|
||||
[OSSP_LOG_CRIT] = "CRIT",
|
||||
[OSSP_LOG_ERR] = " ERR",
|
||||
[OSSP_LOG_WARN] = "WARN",
|
||||
[OSSP_LOG_INFO] = NULL,
|
||||
[OSSP_LOG_DBG0] = "DBG0",
|
||||
[OSSP_LOG_DBG1] = "DBG1",
|
||||
};
|
||||
|
||||
static int severity_map[] = {
|
||||
[OSSP_LOG_CRIT] = LOG_ERR,
|
||||
[OSSP_LOG_ERR] = LOG_ERR,
|
||||
[OSSP_LOG_WARN] = LOG_WARNING,
|
||||
[OSSP_LOG_INFO] = LOG_INFO,
|
||||
[OSSP_LOG_DBG0] = LOG_DEBUG,
|
||||
[OSSP_LOG_DBG1] = LOG_DEBUG,
|
||||
};
|
||||
|
||||
void log_msg(int severity, const char *fmt, ...)
|
||||
{
|
||||
static int syslog_opened = 0;
|
||||
char buf[1024];
|
||||
size_t len = sizeof(buf), off = 0;
|
||||
va_list ap;
|
||||
|
||||
if (severity > abs(ossp_log_level))
|
||||
return;
|
||||
|
||||
if (ossp_log_level < 0 && !syslog_opened)
|
||||
openlog(ossp_log_name, 0, LOG_DAEMON);
|
||||
|
||||
assert(severity >= 0 && severity < ARRAY_SIZE(severity_strs));
|
||||
|
||||
if (ossp_log_timestamp) {
|
||||
static uint64_t start;
|
||||
uint64_t now;
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
now = tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
||||
if (!start)
|
||||
start = now;
|
||||
|
||||
off += snprintf(buf + off, len - off, "<%08"PRIu64"> ",
|
||||
now - start);
|
||||
}
|
||||
|
||||
if (ossp_log_level > 0) {
|
||||
char sev_buf[16] = "";
|
||||
if (severity_strs[severity])
|
||||
snprintf(sev_buf, sizeof(sev_buf), " %s",
|
||||
severity_strs[severity]);
|
||||
off += snprintf(buf + off, len - off, "%s%s: ",
|
||||
ossp_log_name, sev_buf);
|
||||
} else if (severity_strs[severity])
|
||||
off += snprintf(buf + off, len - off, "%s ",
|
||||
severity_strs[severity]);
|
||||
|
||||
va_start(ap, fmt);
|
||||
off += vsnprintf(buf + off, len - off, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
off += snprintf(buf + off, len - off, "\n");
|
||||
|
||||
if (ossp_log_level > 0)
|
||||
fputs(buf, stderr);
|
||||
else
|
||||
syslog(severity_map[severity], "%s", buf);
|
||||
}
|
||||
|
||||
int read_fill(int fd, void *buf, size_t size)
|
||||
{
|
||||
while (size) {
|
||||
ssize_t ret;
|
||||
int rc;
|
||||
|
||||
ret = read(fd, buf, size);
|
||||
if (ret <= 0) {
|
||||
if (ret == 0)
|
||||
rc = -EIO;
|
||||
else
|
||||
rc = -errno;
|
||||
err_e(rc, "failed to read_fill %zu bytes from fd %d",
|
||||
size, fd);
|
||||
return rc;
|
||||
}
|
||||
buf += ret;
|
||||
size -= ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_fill(int fd, const void *buf, size_t size)
|
||||
{
|
||||
while (size) {
|
||||
ssize_t ret;
|
||||
int rc;
|
||||
|
||||
ret = write(fd, buf, size);
|
||||
if (ret <= 0) {
|
||||
if (ret == 0)
|
||||
rc = -EIO;
|
||||
else
|
||||
rc = -errno;
|
||||
err_e(rc, "failed to write_fill %zu bytes to fd %d",
|
||||
size, fd);
|
||||
return rc;
|
||||
}
|
||||
buf += ret;
|
||||
size -= ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ring_fill(struct ring_buf *ring, const void *buf, size_t size)
|
||||
{
|
||||
size_t tail;
|
||||
|
||||
assert(ring_space(ring) >= size);
|
||||
|
||||
tail = (ring->head + ring->size - ring->bytes) % ring->size;
|
||||
|
||||
if (ring->head >= tail) {
|
||||
size_t todo = min(size, ring->size - ring->head);
|
||||
|
||||
memcpy(ring->buf + ring->head, buf, todo);
|
||||
ring->head = (ring->head + todo) % ring->size;
|
||||
ring->bytes += todo;
|
||||
buf += todo;
|
||||
size -= todo;
|
||||
}
|
||||
|
||||
assert(ring->size - ring->head >= size);
|
||||
memcpy(ring->buf + ring->head, buf, size);
|
||||
ring->head += size;
|
||||
ring->bytes += size;
|
||||
}
|
||||
|
||||
void *ring_data(struct ring_buf *ring, size_t *sizep)
|
||||
{
|
||||
size_t tail;
|
||||
|
||||
if (!ring->bytes)
|
||||
return NULL;
|
||||
|
||||
tail = (ring->head + ring->size - ring->bytes) % ring->size;
|
||||
|
||||
*sizep = min(ring->bytes, ring->size - tail);
|
||||
return ring->buf + tail;
|
||||
}
|
||||
|
||||
int ring_resize(struct ring_buf *ring, size_t new_size)
|
||||
{
|
||||
struct ring_buf new_ring = { .size = new_size };
|
||||
void *p;
|
||||
size_t size;
|
||||
|
||||
if (ring_bytes(ring) > new_size)
|
||||
return -ENOSPC;
|
||||
|
||||
new_ring.buf = calloc(1, new_size);
|
||||
if (new_size && !new_ring.buf)
|
||||
return -ENOMEM;
|
||||
|
||||
while ((p = ring_data(ring, &size))) {
|
||||
ring_fill(&new_ring, p, size);
|
||||
ring_consume(ring, size);
|
||||
}
|
||||
|
||||
free(ring->buf);
|
||||
*ring = new_ring;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ensure_sbuf_size(struct sized_buf *sbuf, size_t size)
|
||||
{
|
||||
char *new_buf;
|
||||
|
||||
if (sbuf->size >= size)
|
||||
return 0;
|
||||
|
||||
new_buf = realloc(sbuf->buf, size);
|
||||
if (size && !new_buf)
|
||||
return -ENOMEM;
|
||||
|
||||
sbuf->buf = new_buf;
|
||||
sbuf->size = size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned long __ffs(unsigned long word)
|
||||
{
|
||||
int num = 0;
|
||||
|
||||
if (BITS_PER_LONG == 64) {
|
||||
if ((word & 0xffffffff) == 0) {
|
||||
num += 32;
|
||||
word >>= 32;
|
||||
}
|
||||
}
|
||||
|
||||
if ((word & 0xffff) == 0) {
|
||||
num += 16;
|
||||
word >>= 16;
|
||||
}
|
||||
if ((word & 0xff) == 0) {
|
||||
num += 8;
|
||||
word >>= 8;
|
||||
}
|
||||
if ((word & 0xf) == 0) {
|
||||
num += 4;
|
||||
word >>= 4;
|
||||
}
|
||||
if ((word & 0x3) == 0) {
|
||||
num += 2;
|
||||
word >>= 2;
|
||||
}
|
||||
if ((word & 0x1) == 0)
|
||||
num += 1;
|
||||
return num;
|
||||
}
|
||||
|
||||
#define ffz(x) __ffs(~(x))
|
||||
|
||||
unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
|
||||
unsigned long offset)
|
||||
{
|
||||
const unsigned long *p = addr + BITOP_WORD(offset);
|
||||
unsigned long result = offset & ~(BITS_PER_LONG-1);
|
||||
unsigned long tmp;
|
||||
|
||||
if (offset >= size)
|
||||
return size;
|
||||
size -= result;
|
||||
offset %= BITS_PER_LONG;
|
||||
if (offset) {
|
||||
tmp = *(p++);
|
||||
tmp |= ~0UL >> (BITS_PER_LONG - offset);
|
||||
if (size < BITS_PER_LONG)
|
||||
goto found_first;
|
||||
if (~tmp)
|
||||
goto found_middle;
|
||||
size -= BITS_PER_LONG;
|
||||
result += BITS_PER_LONG;
|
||||
}
|
||||
while (size & ~(BITS_PER_LONG-1)) {
|
||||
if (~(tmp = *(p++)))
|
||||
goto found_middle;
|
||||
result += BITS_PER_LONG;
|
||||
size -= BITS_PER_LONG;
|
||||
}
|
||||
if (!size)
|
||||
return result;
|
||||
tmp = *p;
|
||||
|
||||
found_first:
|
||||
tmp |= ~0UL << size;
|
||||
if (tmp == ~0UL) /* Are any bits zero? */
|
||||
return result + size; /* Nope. */
|
||||
found_middle:
|
||||
return result + ffz(tmp);
|
||||
}
|
||||
|
||||
void __set_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
unsigned long mask = BIT_MASK(nr);
|
||||
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
|
||||
|
||||
*p |= mask;
|
||||
}
|
||||
|
||||
void __clear_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
unsigned long mask = BIT_MASK(nr);
|
||||
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
|
||||
|
||||
*p &= ~mask;
|
||||
}
|
||||
|
||||
int get_proc_self_info(pid_t pid, pid_t *ppid_r,
|
||||
char *cmd_buf, size_t cmd_buf_sz)
|
||||
|
||||
{
|
||||
char path[64], buf[4096];
|
||||
int fd = -1;
|
||||
char *cmd_start, *cmd_end, *ppid_start, *end;
|
||||
ssize_t ret;
|
||||
pid_t ppid;
|
||||
int i, rc;
|
||||
|
||||
snprintf(path, sizeof(path), "/proc/%ld/stat", (long)pid);
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
rc = -errno;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = read(fd, buf, sizeof(buf));
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
if (ret == sizeof(buf)) {
|
||||
rc = -EOVERFLOW;
|
||||
goto out;
|
||||
}
|
||||
buf[ret] = '\0';
|
||||
|
||||
rc = -EINVAL;
|
||||
cmd_start = strchr(buf, '(');
|
||||
cmd_end = strrchr(buf, ')');
|
||||
if (!cmd_start || !cmd_end)
|
||||
goto out;
|
||||
cmd_start++;
|
||||
|
||||
ppid_start = cmd_end;
|
||||
for (i = 0; i < 3; i++) {
|
||||
ppid_start = strchr(ppid_start, ' ');
|
||||
if (!ppid_start)
|
||||
goto out;
|
||||
ppid_start++;
|
||||
}
|
||||
|
||||
ppid = strtoul(ppid_start, &end, 10);
|
||||
if (end == ppid_start || *end != ' ')
|
||||
goto out;
|
||||
|
||||
if (ppid_r)
|
||||
*ppid_r = ppid;
|
||||
if (cmd_buf) {
|
||||
size_t len = min_t(size_t, cmd_end - cmd_start, cmd_buf_sz - 1);
|
||||
memcpy(cmd_buf, cmd_start, len);
|
||||
cmd_buf[len] = '\0';
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
out:
|
||||
close(fd);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -0,0 +1,609 @@
|
||||
/*
|
||||
* ossp-util - OSS Proxy: Common utilities
|
||||
*
|
||||
* Copyright (C) 2008-2010 SUSE Linux Products GmbH
|
||||
* Copyright (C) 2008-2010 Tejun Heo <tj@kernel.org>
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
*/
|
||||
|
||||
#ifndef _OSSP_UTIL_H
|
||||
#define _OSSP_UTIL_H
|
||||
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include "ossp.h"
|
||||
|
||||
#define OSSP_LOG_NAME_LEN 128
|
||||
|
||||
enum {
|
||||
OSSP_LOG_CRIT = 1,
|
||||
OSSP_LOG_ERR,
|
||||
OSSP_LOG_WARN,
|
||||
OSSP_LOG_INFO,
|
||||
OSSP_LOG_DFL = OSSP_LOG_INFO, /* default log level */
|
||||
OSSP_LOG_DBG0,
|
||||
OSSP_LOG_DBG1,
|
||||
OSSP_LOG_MAX = OSSP_LOG_DBG1,
|
||||
};
|
||||
|
||||
extern char ossp_log_name[OSSP_LOG_NAME_LEN];
|
||||
extern int ossp_log_level;
|
||||
extern int ossp_log_timestamp;
|
||||
|
||||
#define BITS_PER_BYTE 8
|
||||
#define BITS_PER_LONG (BITS_PER_BYTE * sizeof(long))
|
||||
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
|
||||
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
|
||||
|
||||
/* ARRAY_SIZE and min/max macros stolen from linux/kernel.h */
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
|
||||
#define min(x, y) ({ \
|
||||
typeof(x) _min1 = (x); \
|
||||
typeof(y) _min2 = (y); \
|
||||
(void) (&_min1 == &_min2); \
|
||||
_min1 < _min2 ? _min1 : _min2; })
|
||||
|
||||
#define max(x, y) ({ \
|
||||
typeof(x) _max1 = (x); \
|
||||
typeof(y) _max2 = (y); \
|
||||
(void) (&_max1 == &_max2); \
|
||||
_max1 > _max2 ? _max1 : _max2; })
|
||||
|
||||
#define min_t(type, x, y) ({ \
|
||||
type __min1 = (x); \
|
||||
type __min2 = (y); \
|
||||
__min1 < __min2 ? __min1: __min2; })
|
||||
|
||||
#define max_t(type, x, y) ({ \
|
||||
type __max1 = (x); \
|
||||
type __max2 = (y); \
|
||||
__max1 > __max2 ? __max1: __max2; })
|
||||
|
||||
void log_msg(int severity, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
#define fatal(fmt, args...) do { \
|
||||
log_msg(OSSP_LOG_CRIT, fmt , ##args); \
|
||||
_exit(1); \
|
||||
} while (0)
|
||||
#define err(fmt, args...) log_msg(OSSP_LOG_ERR, fmt , ##args)
|
||||
#define warn(fmt, args...) log_msg(OSSP_LOG_WARN, fmt , ##args)
|
||||
#define info(fmt, args...) log_msg(OSSP_LOG_INFO, fmt , ##args)
|
||||
#define dbg0(fmt, args...) log_msg(OSSP_LOG_DBG0, fmt , ##args)
|
||||
#define dbg1(fmt, args...) log_msg(OSSP_LOG_DBG1, fmt , ##args)
|
||||
|
||||
#define fatal_e(e, fmt, args...) \
|
||||
fatal(fmt" (%s)" , ##args, strerror(-(e)))
|
||||
#define err_e(e, fmt, args...) \
|
||||
err(fmt" (%s)" , ##args, strerror(-(e)))
|
||||
#define warn_e(e, fmt, args...) \
|
||||
warn(fmt" (%s)" , ##args, strerror(-(e)))
|
||||
#define info_e(e, fmt, args...) \
|
||||
info(fmt" (%s)" , ##args, strerror(-(e)))
|
||||
#define dbg0_e(e, fmt, args...) \
|
||||
dbg0(fmt" (%s)" , ##args, strerror(-(e)))
|
||||
#define dbg1_e(e, fmt, args...) \
|
||||
dbg1(fmt" (%s)" , ##args, strerror(-(e)))
|
||||
|
||||
struct ring_buf {
|
||||
char *buf;
|
||||
size_t size;
|
||||
size_t head;
|
||||
size_t bytes;
|
||||
};
|
||||
|
||||
static inline size_t ring_size(struct ring_buf *ring)
|
||||
{
|
||||
return ring->size;
|
||||
}
|
||||
|
||||
static inline size_t ring_bytes(struct ring_buf *ring)
|
||||
{
|
||||
return ring->bytes;
|
||||
}
|
||||
|
||||
static inline size_t ring_space(struct ring_buf *ring)
|
||||
{
|
||||
return ring->size - ring->bytes;
|
||||
}
|
||||
|
||||
static inline void ring_consume(struct ring_buf *ring, size_t size)
|
||||
{
|
||||
assert(ring->bytes >= size);
|
||||
ring->bytes -= size;
|
||||
}
|
||||
|
||||
static inline void ring_manual_init(struct ring_buf *ring, void *buf,
|
||||
size_t size, size_t head, size_t bytes)
|
||||
{
|
||||
ring->buf = buf;
|
||||
ring->size = size;
|
||||
ring->head = head;
|
||||
ring->bytes = bytes;
|
||||
}
|
||||
|
||||
void ring_fill(struct ring_buf *ring, const void *buf, size_t size);
|
||||
void *ring_data(struct ring_buf *ring, size_t *sizep);
|
||||
int ring_resize(struct ring_buf *ring, size_t new_size);
|
||||
|
||||
struct sized_buf {
|
||||
char *buf;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
int ensure_sbuf_size(struct sized_buf *sbuf, size_t size);
|
||||
|
||||
int read_fill(int fd, void *buf, size_t size);
|
||||
int write_fill(int fd, const void *buf, size_t size);
|
||||
|
||||
/*
|
||||
* Bitops lifted from linux asm-generic implementation.
|
||||
*/
|
||||
unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
|
||||
long size, unsigned long offset);
|
||||
#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
|
||||
extern void __set_bit(int nr, volatile unsigned long *addr);
|
||||
extern void __clear_bit(int nr, volatile unsigned long *addr);
|
||||
|
||||
typedef ssize_t (*ossp_action_fn_t)(enum ossp_opcode opcode,
|
||||
void *carg, void *din, size_t din_sz,
|
||||
void *rarg, void *dout, size_t *dout_szp,
|
||||
int fd);
|
||||
|
||||
int get_proc_self_info(pid_t tid, pid_t *pgrp,
|
||||
char *cmd_buf, size_t cmd_buf_sz);
|
||||
|
||||
/*
|
||||
* Doubly linked list handling code shamelessly stolen from the Linux
|
||||
* kernel 2.6.26 include/linux/list.h.
|
||||
*/
|
||||
|
||||
/**
|
||||
* container_of - cast a member of a structure out to the containing structure
|
||||
* @ptr: the pointer to the member.
|
||||
* @type: the type of the container struct this is embedded in.
|
||||
* @member: the name of the member within the struct.
|
||||
*
|
||||
*/
|
||||
#define container_of(ptr, type, member) ({ \
|
||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
||||
(type *)( (char *)__mptr - offsetof(type,member) );})
|
||||
|
||||
#define LIST_POISON1 ((void *) 0x00100100)
|
||||
#define LIST_POISON2 ((void *) 0x00200200)
|
||||
|
||||
/*
|
||||
* Simple doubly linked list implementation.
|
||||
*
|
||||
* Some of the internal functions ("__xxx") are useful when
|
||||
* manipulating whole lists rather than single entries, as
|
||||
* sometimes we already know the next/prev entries and we can
|
||||
* generate better code by using them directly rather than
|
||||
* using the generic single-entry routines.
|
||||
*/
|
||||
|
||||
struct list_head {
|
||||
struct list_head *next, *prev;
|
||||
};
|
||||
|
||||
#define LIST_HEAD_INIT(name) { &(name), &(name) }
|
||||
|
||||
#define LIST_HEAD(name) \
|
||||
struct list_head name = LIST_HEAD_INIT(name)
|
||||
|
||||
static inline void INIT_LIST_HEAD(struct list_head *list)
|
||||
{
|
||||
list->next = list;
|
||||
list->prev = list;
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert a new entry between two known consecutive entries.
|
||||
*
|
||||
* This is only for internal list manipulation where we know
|
||||
* the prev/next entries already!
|
||||
*/
|
||||
static inline void __list_add(struct list_head *new,
|
||||
struct list_head *prev,
|
||||
struct list_head *next)
|
||||
{
|
||||
next->prev = new;
|
||||
new->next = next;
|
||||
new->prev = prev;
|
||||
prev->next = new;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_add - add a new entry
|
||||
* @new: new entry to be added
|
||||
* @head: list head to add it after
|
||||
*
|
||||
* Insert a new entry after the specified head.
|
||||
* This is good for implementing stacks.
|
||||
*/
|
||||
static inline void list_add(struct list_head *new, struct list_head *head)
|
||||
{
|
||||
__list_add(new, head, head->next);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_add_tail - add a new entry
|
||||
* @new: new entry to be added
|
||||
* @head: list head to add it before
|
||||
*
|
||||
* Insert a new entry before the specified head.
|
||||
* This is useful for implementing queues.
|
||||
*/
|
||||
static inline void list_add_tail(struct list_head *new, struct list_head *head)
|
||||
{
|
||||
__list_add(new, head->prev, head);
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete a list entry by making the prev/next entries
|
||||
* point to each other.
|
||||
*
|
||||
* This is only for internal list manipulation where we know
|
||||
* the prev/next entries already!
|
||||
*/
|
||||
static inline void __list_del(struct list_head * prev, struct list_head * next)
|
||||
{
|
||||
next->prev = prev;
|
||||
prev->next = next;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_del - deletes entry from list.
|
||||
* @entry: the element to delete from the list.
|
||||
* Note: list_empty() on entry does not return true after this, the entry is
|
||||
* in an undefined state.
|
||||
*/
|
||||
static inline void list_del(struct list_head *entry)
|
||||
{
|
||||
__list_del(entry->prev, entry->next);
|
||||
entry->next = LIST_POISON1;
|
||||
entry->prev = LIST_POISON2;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_replace - replace old entry by new one
|
||||
* @old : the element to be replaced
|
||||
* @new : the new element to insert
|
||||
*
|
||||
* If @old was empty, it will be overwritten.
|
||||
*/
|
||||
static inline void list_replace(struct list_head *old,
|
||||
struct list_head *new)
|
||||
{
|
||||
new->next = old->next;
|
||||
new->next->prev = new;
|
||||
new->prev = old->prev;
|
||||
new->prev->next = new;
|
||||
}
|
||||
|
||||
static inline void list_replace_init(struct list_head *old,
|
||||
struct list_head *new)
|
||||
{
|
||||
list_replace(old, new);
|
||||
INIT_LIST_HEAD(old);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_del_init - deletes entry from list and reinitialize it.
|
||||
* @entry: the element to delete from the list.
|
||||
*/
|
||||
static inline void list_del_init(struct list_head *entry)
|
||||
{
|
||||
__list_del(entry->prev, entry->next);
|
||||
INIT_LIST_HEAD(entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_move - delete from one list and add as another's head
|
||||
* @list: the entry to move
|
||||
* @head: the head that will precede our entry
|
||||
*/
|
||||
static inline void list_move(struct list_head *list, struct list_head *head)
|
||||
{
|
||||
__list_del(list->prev, list->next);
|
||||
list_add(list, head);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_move_tail - delete from one list and add as another's tail
|
||||
* @list: the entry to move
|
||||
* @head: the head that will follow our entry
|
||||
*/
|
||||
static inline void list_move_tail(struct list_head *list,
|
||||
struct list_head *head)
|
||||
{
|
||||
__list_del(list->prev, list->next);
|
||||
list_add_tail(list, head);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_is_last - tests whether @list is the last entry in list @head
|
||||
* @list: the entry to test
|
||||
* @head: the head of the list
|
||||
*/
|
||||
static inline int list_is_last(const struct list_head *list,
|
||||
const struct list_head *head)
|
||||
{
|
||||
return list->next == head;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_empty - tests whether a list is empty
|
||||
* @head: the list to test.
|
||||
*/
|
||||
static inline int list_empty(const struct list_head *head)
|
||||
{
|
||||
return head->next == head;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_empty_careful - tests whether a list is empty and not being modified
|
||||
* @head: the list to test
|
||||
*
|
||||
* Description:
|
||||
* tests whether a list is empty _and_ checks that no other CPU might be
|
||||
* in the process of modifying either member (next or prev)
|
||||
*
|
||||
* NOTE: using list_empty_careful() without synchronization
|
||||
* can only be safe if the only activity that can happen
|
||||
* to the list entry is list_del_init(). Eg. it cannot be used
|
||||
* if another CPU could re-list_add() it.
|
||||
*/
|
||||
static inline int list_empty_careful(const struct list_head *head)
|
||||
{
|
||||
struct list_head *next = head->next;
|
||||
return (next == head) && (next == head->prev);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_is_singular - tests whether a list has just one entry.
|
||||
* @head: the list to test.
|
||||
*/
|
||||
static inline int list_is_singular(const struct list_head *head)
|
||||
{
|
||||
return !list_empty(head) && (head->next == head->prev);
|
||||
}
|
||||
|
||||
static inline void __list_splice(const struct list_head *list,
|
||||
struct list_head *head)
|
||||
{
|
||||
struct list_head *first = list->next;
|
||||
struct list_head *last = list->prev;
|
||||
struct list_head *at = head->next;
|
||||
|
||||
first->prev = head;
|
||||
head->next = first;
|
||||
|
||||
last->next = at;
|
||||
at->prev = last;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_splice - join two lists
|
||||
* @list: the new list to add.
|
||||
* @head: the place to add it in the first list.
|
||||
*/
|
||||
static inline void list_splice(const struct list_head *list,
|
||||
struct list_head *head)
|
||||
{
|
||||
if (!list_empty(list))
|
||||
__list_splice(list, head);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_splice_init - join two lists and reinitialise the emptied list.
|
||||
* @list: the new list to add.
|
||||
* @head: the place to add it in the first list.
|
||||
*
|
||||
* The list at @list is reinitialised
|
||||
*/
|
||||
static inline void list_splice_init(struct list_head *list,
|
||||
struct list_head *head)
|
||||
{
|
||||
if (!list_empty(list)) {
|
||||
__list_splice(list, head);
|
||||
INIT_LIST_HEAD(list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* list_entry - get the struct for this entry
|
||||
* @ptr: the &struct list_head pointer.
|
||||
* @type: the type of the struct this is embedded in.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*/
|
||||
#define list_entry(ptr, type, member) \
|
||||
container_of(ptr, type, member)
|
||||
|
||||
/**
|
||||
* list_first_entry - get the first element from a list
|
||||
* @ptr: the list head to take the element from.
|
||||
* @type: the type of the struct this is embedded in.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Note, that list is expected to be not empty.
|
||||
*/
|
||||
#define list_first_entry(ptr, type, member) \
|
||||
list_entry((ptr)->next, type, member)
|
||||
|
||||
/**
|
||||
* list_for_each - iterate over a list
|
||||
* @pos: the &struct list_head to use as a loop cursor.
|
||||
* @head: the head for your list.
|
||||
*/
|
||||
#define list_for_each(pos, head) \
|
||||
for (pos = (head)->next; pos != (head); pos = pos->next)
|
||||
|
||||
/**
|
||||
* list_for_each_prev - iterate over a list backwards
|
||||
* @pos: the &struct list_head to use as a loop cursor.
|
||||
* @head: the head for your list.
|
||||
*/
|
||||
#define list_for_each_prev(pos, head) \
|
||||
for (pos = (head)->prev; pos != (head); pos = pos->prev)
|
||||
|
||||
/**
|
||||
* list_for_each_safe - iterate over a list safe against removal of list entry
|
||||
* @pos: the &struct list_head to use as a loop cursor.
|
||||
* @n: another &struct list_head to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
*/
|
||||
#define list_for_each_safe(pos, n, head) \
|
||||
for (pos = (head)->next, n = pos->next; pos != (head); \
|
||||
pos = n, n = pos->next)
|
||||
|
||||
/**
|
||||
* list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
|
||||
* @pos: the &struct list_head to use as a loop cursor.
|
||||
* @n: another &struct list_head to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
*/
|
||||
#define list_for_each_prev_safe(pos, n, head) \
|
||||
for (pos = (head)->prev, n = pos->prev; \
|
||||
pos != (head); pos = n, n = pos->prev)
|
||||
|
||||
/**
|
||||
* list_for_each_entry - iterate over list of given type
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*/
|
||||
#define list_for_each_entry(pos, head, member) \
|
||||
for (pos = list_entry((head)->next, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = list_entry(pos->member.next, typeof(*pos), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_reverse - iterate backwards over list of given type.
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*/
|
||||
#define list_for_each_entry_reverse(pos, head, member) \
|
||||
for (pos = list_entry((head)->prev, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = list_entry(pos->member.prev, typeof(*pos), member))
|
||||
|
||||
/**
|
||||
* list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()
|
||||
* @pos: the type * to use as a start point
|
||||
* @head: the head of the list
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Prepares a pos entry for use as a start point in list_for_each_entry_continue().
|
||||
*/
|
||||
#define list_prepare_entry(pos, head, member) \
|
||||
((pos) ? : list_entry(head, typeof(*pos), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_continue - continue iteration over list of given type
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Continue to iterate over list of given type, continuing after
|
||||
* the current position.
|
||||
*/
|
||||
#define list_for_each_entry_continue(pos, head, member) \
|
||||
for (pos = list_entry(pos->member.next, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = list_entry(pos->member.next, typeof(*pos), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_continue_reverse - iterate backwards from the given point
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Start to iterate over list of given type backwards, continuing after
|
||||
* the current position.
|
||||
*/
|
||||
#define list_for_each_entry_continue_reverse(pos, head, member) \
|
||||
for (pos = list_entry(pos->member.prev, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = list_entry(pos->member.prev, typeof(*pos), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_from - iterate over list of given type from the current point
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Iterate over list of given type, continuing from current position.
|
||||
*/
|
||||
#define list_for_each_entry_from(pos, head, member) \
|
||||
for (; &pos->member != (head); \
|
||||
pos = list_entry(pos->member.next, typeof(*pos), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*/
|
||||
#define list_for_each_entry_safe(pos, n, head, member) \
|
||||
for (pos = list_entry((head)->next, typeof(*pos), member), \
|
||||
n = list_entry(pos->member.next, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = n, n = list_entry(n->member.next, typeof(*n), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_safe_continue
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Iterate over list of given type, continuing after current point,
|
||||
* safe against removal of list entry.
|
||||
*/
|
||||
#define list_for_each_entry_safe_continue(pos, n, head, member) \
|
||||
for (pos = list_entry(pos->member.next, typeof(*pos), member), \
|
||||
n = list_entry(pos->member.next, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = n, n = list_entry(n->member.next, typeof(*n), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_safe_from
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Iterate over list of given type from current point, safe against
|
||||
* removal of list entry.
|
||||
*/
|
||||
#define list_for_each_entry_safe_from(pos, n, head, member) \
|
||||
for (n = list_entry(pos->member.next, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = n, n = list_entry(n->member.next, typeof(*n), member))
|
||||
|
||||
/**
|
||||
* list_for_each_entry_safe_reverse
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Iterate backwards over list of given type, safe against removal
|
||||
* of list entry.
|
||||
*/
|
||||
#define list_for_each_entry_safe_reverse(pos, n, head, member) \
|
||||
for (pos = list_entry((head)->prev, typeof(*pos), member), \
|
||||
n = list_entry(pos->member.prev, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = n, n = list_entry(n->member.prev, typeof(*n), member))
|
||||
|
||||
#endif /*_OSSP_UTIL_H*/
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* ossp - OSS Proxy: emulate OSS device using CUSE
|
||||
*
|
||||
* Copyright (C) 2008-2010 SUSE Linux Products GmbH
|
||||
* Copyright (C) 2008-2010 Tejun Heo <tj@kernel.org>
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
*/
|
||||
|
||||
#include "ossp.h"
|
||||
|
||||
const struct ossp_arg_size ossp_arg_sizes[OSSP_NR_OPCODES] = {
|
||||
[OSSP_MIXER] = { sizeof(struct ossp_mixer_arg),
|
||||
sizeof(struct ossp_mixer_arg), 0 },
|
||||
|
||||
[OSSP_DSP_OPEN] = { sizeof(struct ossp_dsp_open_arg), 0, 0 },
|
||||
[OSSP_DSP_READ] = { sizeof(struct ossp_dsp_rw_arg), 0, 0 },
|
||||
[OSSP_DSP_WRITE] = { sizeof(struct ossp_dsp_rw_arg), 0, 0 },
|
||||
[OSSP_DSP_POLL] = { sizeof(int), sizeof(unsigned), 0 },
|
||||
[OSSP_DSP_MMAP] = { sizeof(struct ossp_dsp_mmap_arg), 0, 0 },
|
||||
[OSSP_DSP_MUNMAP] = { sizeof(int), 0, 0 },
|
||||
|
||||
[OSSP_DSP_RESET] = { 0, 0, 0 },
|
||||
[OSSP_DSP_SYNC] = { 0, 0, 0 },
|
||||
[OSSP_DSP_POST] = { 0, 0, 0 },
|
||||
[OSSP_DSP_GET_RATE] = { 0, sizeof(int), 0 },
|
||||
[OSSP_DSP_GET_CHANNELS] = { 0, sizeof(int), 0 },
|
||||
[OSSP_DSP_GET_FORMAT] = { 0, sizeof(int), 0 },
|
||||
[OSSP_DSP_GET_BLKSIZE] = { 0, sizeof(int), 0 },
|
||||
[OSSP_DSP_GET_FORMATS] = { 0, sizeof(int), 0 },
|
||||
[OSSP_DSP_SET_RATE] = { sizeof(int), sizeof(int), 0 },
|
||||
[OSSP_DSP_SET_CHANNELS] = { sizeof(int), sizeof(int), 0 },
|
||||
[OSSP_DSP_SET_FORMAT] = { sizeof(int), sizeof(int), 0 },
|
||||
[OSSP_DSP_SET_SUBDIVISION] = { sizeof(int), sizeof(int), 0 },
|
||||
[OSSP_DSP_SET_FRAGMENT] = { sizeof(int), 0, 0 },
|
||||
[OSSP_DSP_GET_TRIGGER] = { 0, sizeof(int), 0 },
|
||||
[OSSP_DSP_SET_TRIGGER] = { sizeof(int), 0, 0 },
|
||||
[OSSP_DSP_GET_OSPACE] = { 0, sizeof(struct audio_buf_info), 0 },
|
||||
[OSSP_DSP_GET_ISPACE] = { 0, sizeof(struct audio_buf_info), 0 },
|
||||
[OSSP_DSP_GET_OPTR] = { 0, sizeof(struct count_info), 0 },
|
||||
[OSSP_DSP_GET_IPTR] = { 0, sizeof(struct count_info), 0 },
|
||||
[OSSP_DSP_GET_ODELAY] = { 0, sizeof(int), 0 },
|
||||
};
|
||||
|
||||
const char *ossp_cmd_str[OSSP_NR_OPCODES] = {
|
||||
[OSSP_MIXER] = "MIXER",
|
||||
|
||||
[OSSP_DSP_OPEN] = "OPEN",
|
||||
[OSSP_DSP_READ] = "READ",
|
||||
[OSSP_DSP_WRITE] = "WRITE",
|
||||
[OSSP_DSP_POLL] = "POLL",
|
||||
[OSSP_DSP_MMAP] = "MMAP",
|
||||
[OSSP_DSP_MUNMAP] = "MUNMAP",
|
||||
|
||||
[OSSP_DSP_RESET] = "RESET",
|
||||
[OSSP_DSP_SYNC] = "SYNC",
|
||||
[OSSP_DSP_POST] = "POST",
|
||||
|
||||
[OSSP_DSP_GET_RATE] = "GET_RATE",
|
||||
[OSSP_DSP_GET_CHANNELS] = "GET_CHANNELS",
|
||||
[OSSP_DSP_GET_FORMAT] = "GET_FORMAT",
|
||||
[OSSP_DSP_GET_BLKSIZE] = "GET_BLKSIZE",
|
||||
[OSSP_DSP_GET_FORMATS] = "GET_FORMATS",
|
||||
[OSSP_DSP_SET_RATE] = "SET_RATE",
|
||||
[OSSP_DSP_SET_CHANNELS] = "SET_CHANNELS",
|
||||
[OSSP_DSP_SET_FORMAT] = "SET_FORMAT",
|
||||
[OSSP_DSP_SET_SUBDIVISION] = "SET_BUSDIVISION",
|
||||
|
||||
[OSSP_DSP_SET_FRAGMENT] = "SET_FRAGMENT",
|
||||
[OSSP_DSP_GET_TRIGGER] = "GET_TRIGGER",
|
||||
[OSSP_DSP_SET_TRIGGER] = "SET_TRIGGER",
|
||||
[OSSP_DSP_GET_OSPACE] = "GET_OSPACE",
|
||||
[OSSP_DSP_GET_ISPACE] = "GET_ISPACE",
|
||||
[OSSP_DSP_GET_OPTR] = "GET_OPTR",
|
||||
[OSSP_DSP_GET_IPTR] = "GET_IPTR",
|
||||
[OSSP_DSP_GET_ODELAY] = "GET_ODELAY",
|
||||
};
|
||||
|
||||
const char *ossp_notify_str[OSSP_NR_NOTIFY_OPCODES] = {
|
||||
[OSSP_NOTIFY_POLL] = "POLL",
|
||||
[OSSP_NOTIFY_OBITUARY] = "OBITUARY",
|
||||
[OSSP_NOTIFY_VOLCHG] = "VOLCHG",
|
||||
};
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* ossp - OSS Proxy: emulate OSS device using CUSE
|
||||
*
|
||||
* Copyright (C) 2008-2010 SUSE Linux Products GmbH
|
||||
* Copyright (C) 2008-2010 Tejun Heo <tj@kernel.org>
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
*/
|
||||
|
||||
#ifndef _OSSP_H
|
||||
#define _OSSP_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <inttypes.h>
|
||||
#include <sys/soundcard.h>
|
||||
|
||||
#define OSSP_VERSION "1.3.2"
|
||||
#define OSSP_CMD_MAGIC 0xdeadbeef
|
||||
#define OSSP_REPLY_MAGIC 0xbeefdead
|
||||
#define OSSP_NOTIFY_MAGIC 0xbebebebe
|
||||
|
||||
#define PLAY 0
|
||||
#define REC 1
|
||||
#define LEFT 0
|
||||
#define RIGHT 1
|
||||
|
||||
enum ossp_opcode {
|
||||
OSSP_MIXER,
|
||||
|
||||
OSSP_DSP_OPEN,
|
||||
OSSP_DSP_READ,
|
||||
OSSP_DSP_WRITE,
|
||||
OSSP_DSP_POLL,
|
||||
OSSP_DSP_MMAP,
|
||||
OSSP_DSP_MUNMAP,
|
||||
|
||||
OSSP_DSP_RESET,
|
||||
OSSP_DSP_SYNC,
|
||||
OSSP_DSP_POST,
|
||||
|
||||
OSSP_DSP_GET_RATE,
|
||||
OSSP_DSP_GET_CHANNELS,
|
||||
OSSP_DSP_GET_FORMAT,
|
||||
OSSP_DSP_GET_BLKSIZE,
|
||||
OSSP_DSP_GET_FORMATS,
|
||||
OSSP_DSP_SET_RATE,
|
||||
OSSP_DSP_SET_CHANNELS,
|
||||
OSSP_DSP_SET_FORMAT,
|
||||
OSSP_DSP_SET_SUBDIVISION,
|
||||
|
||||
OSSP_DSP_SET_FRAGMENT,
|
||||
OSSP_DSP_GET_TRIGGER,
|
||||
OSSP_DSP_SET_TRIGGER,
|
||||
OSSP_DSP_GET_OSPACE,
|
||||
OSSP_DSP_GET_ISPACE,
|
||||
OSSP_DSP_GET_OPTR,
|
||||
OSSP_DSP_GET_IPTR,
|
||||
OSSP_DSP_GET_ODELAY,
|
||||
|
||||
OSSP_NR_OPCODES,
|
||||
};
|
||||
|
||||
enum ossp_notify_opcode {
|
||||
OSSP_NOTIFY_POLL,
|
||||
OSSP_NOTIFY_OBITUARY,
|
||||
OSSP_NOTIFY_VOLCHG,
|
||||
|
||||
OSSP_NR_NOTIFY_OPCODES,
|
||||
};
|
||||
|
||||
struct ossp_mixer_arg {
|
||||
int vol[2][2];
|
||||
};
|
||||
|
||||
struct ossp_dsp_open_arg {
|
||||
int flags;
|
||||
pid_t opener_pid;
|
||||
};
|
||||
|
||||
struct ossp_dsp_rw_arg {
|
||||
unsigned nonblock:1;
|
||||
};
|
||||
|
||||
struct ossp_dsp_mmap_arg {
|
||||
int dir;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct ossp_cmd {
|
||||
unsigned magic;
|
||||
enum ossp_opcode opcode;
|
||||
size_t din_size;
|
||||
size_t dout_size;
|
||||
};
|
||||
|
||||
struct ossp_reply {
|
||||
unsigned magic;
|
||||
int result;
|
||||
size_t dout_size; /* <= cmd.data_in_size */
|
||||
};
|
||||
|
||||
struct ossp_notify {
|
||||
unsigned magic;
|
||||
enum ossp_notify_opcode opcode;
|
||||
};
|
||||
|
||||
struct ossp_arg_size {
|
||||
ssize_t carg_size;
|
||||
ssize_t rarg_size;
|
||||
unsigned has_fd:1;
|
||||
};
|
||||
|
||||
extern const struct ossp_arg_size ossp_arg_sizes[OSSP_NR_OPCODES];
|
||||
extern const char *ossp_cmd_str[OSSP_NR_OPCODES];
|
||||
extern const char *ossp_notify_str[OSSP_NR_NOTIFY_OPCODES];
|
||||
|
||||
#endif /* _OSSP_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user