├── .DS_Store ├── APIcommands └── README.md ├── Auth ├── README.md ├── directory │ └── default.xml └── sip_profiles │ ├── external.xml │ └── internal.xml ├── Lua ├── README.md ├── lua_autoload │ ├── arguments_pass.lua │ ├── autoload_configs │ │ └── lua.conf.xml │ └── helloworld.lua └── lua_dialplan │ ├── dialplan │ ├── lua_session_answer_prompt_hangup.lua │ ├── lua_session_leg_bridge.lua │ └── public.xml │ └── lua_autoattendant.lua ├── Media_handling ├── README.md ├── audio_codecs.md └── video_codecs.md ├── README.md ├── codecs.txt ├── dialplan_authcheck.xml ├── dialplan_common ├── dialplan_Securecall_musiconhold.xml ├── dialplan_bridge_or_voicemail.xml ├── dialplan_conf_with_user.xml ├── dialplan_debugcall.xml ├── dialplan_delay_echo.xml ├── dialplan_earlymedia.xml ├── dialplan_eavesdrop.xml ├── dialplan_groupconf_bridge.xml ├── dialplan_groupdial.xml ├── dialplan_park_unpark.xml ├── dialplan_playback_music.xml ├── dialplan_postanswer_ringtone.xml ├── dialplan_redial.xml ├── dialplan_ringready_playback.xml ├── dialplan_transfer_default.xml ├── dialplan_unloop.xml ├── dialplan_videoplayback.xml ├── dialplan_videorecord.xml ├── readme.md └── tone_detect.xml ├── dialplan_transfer_extension.xml ├── gateways └── README.md ├── ivr ├── README.md ├── demo_ivr.xml └── dialplan_IVR.xml ├── pbx_configurations ├── README.md ├── dialplan │ ├── README.md │ ├── deafult.xml │ └── public.xml ├── directory │ └── default.xml ├── freeswitch.xml ├── sip_profiles │ ├── README.md │ ├── external.xml │ ├── external │ │ └── gw-prod.xml │ └── internal.xml └── vars.xml ├── playback └── README.md ├── presence └── README.md ├── quickstart ├── README.md ├── freeswitch_simple.xml └── freswitch.xml ├── screenshots ├── bootstarp_freeswitch.png ├── configure_freeswitch.png ├── make_freeswitch.png ├── make_install_freeswitch.png └── run_freeswitch.png ├── secure_sip_tls_srtp ├── README.md ├── dialplan │ └── default.xml ├── directory │ ├── deafult.xml │ └── default │ │ ├── 7777777777.xml │ │ └── altanai.xml ├── sip_profiles │ ├── external.xml │ └── internal.xml └── vars.xml ├── video_mcu_conference ├── 5_party_webrtc_MCU.txt ├── Q850_cause_88_INCOMPATIBLE_DESTINATION.txt ├── README.md ├── autoload_configs │ └── conference.conf.xml ├── dialplan │ └── public.xml ├── freeswitch_logs_jssip_p2p_call.txt └── session_interval_too_small.txt └── voip_appserver └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altanai/freeswitchexamples/f877a239738e7c8704ef49caa946d0cbdf17a2a4/.DS_Store -------------------------------------------------------------------------------- /APIcommands/README.md: -------------------------------------------------------------------------------- 1 | # API commands 2 | 3 | ## Orignate 4 | orignate a call syntax : *originate ALEG BLEG* 5 | 6 | ### Orignate a call via dialplan 7 | 8 | originate {origination_caller_id_number=9999999999}sofia/default/2222222222@10.20.30.40 9999999999 XML default CALLER_ID_NAME CALLER_ID_NUMBER 9 | 10 | make a call out to sip:2222222222@10.20.30.40 11 | Caller ID number set to 9999999999. 12 | send call to XML dialplan using context=default with the destination number of 19005551212 13 | 14 | 15 | ### bypasses the dialplan and just sends the connected A-leg directly to the bridge app for B-leg. 16 | 17 | originate {origination_caller_id_number=9999999999}sofia/default/2222222222@10.20.30.40 &bridge({origination_caller_id_number=8001234567}sofia/profile/someother@destination.com) 18 | 19 | 20 | ## show 21 | 22 | > show 23 | -USAGE: codec|endpoint|application|api|dialplan|file|timer|calls [count]|channels [count|like ]|calls|detailed_calls|bridged_calls|detailed_bridged_calls|aliases|complete|chat|management|modules|nat_map|say|interfaces|interface_types|tasks|limits|status -------------------------------------------------------------------------------- /Auth/README.md: -------------------------------------------------------------------------------- 1 | # Auth capabilities in Freeswitch 2 | 3 | Auth is identifying SIP endpoints to FreeSWITCH. 4 | 5 | FreeSWICH will default to $${local_ip_v4} unless changed. Changing this setting does affect the sip authentication. 6 | review conf/directory/default.xml for more 7 | ```xml 8 | 9 | 10 | 11 | ``` 12 | 13 | - challenge-realm - realm challenge key. Default is auto_to if not set. 14 | auto_from - uses the from field as the value for the SIP realm. auto_to - uses the to field as the value for the SIP realm. - you can input any value to use for the SIP realm. 15 | If you want URL dialing to work you'll want to set this to auto_from. 16 | If you use any other value besides auto_to or auto_from you'll loose the ability to do multiple domains. 17 | 18 | 19 | accept-blind-auth - accept any authentication without actually checking 20 | 21 | 22 | - auth-calls - Users in the directory can have "auth-acl" parameters applied to them so as to restrict users access to a predefined ACL or a CIDR. 23 | 24 | Value can be "false" to disable authentication on this profile, meaning that when calls come in the profile will *not* send an auth challenge to the caller. 25 | 26 | - log-auth-failures - log entries ( Warning ) on authentication failures ( Registration & Invite ). 27 | 28 | 29 | - auth-all-packets - On authed calls, authenticate *all* the packets instead of only INVITE and REGISTER ( Note: OPTIONS, SUBSCRIBE, INFO and MESSAGE are not authenticated even with this option set to true, see http://jira.freeswitch.org/browse/FS-2871) 30 | 31 | 32 | ## answer auth challenges without defining a full gateway. 33 | 34 | originate {sip_auth_username=1111111111,sip_auth_password=123456}sofia/internal/2222222222@x.x.x.x &echo 35 | 36 | ## output 407 Proxy Authentication Required 37 | 38 | Auth settings will ensure that a proxy auth challenge like below is send back for every incoming sip request 39 | ``` 40 | SIP/2.0 407 Proxy Authentication Required 41 | Via: SIP/2.0/UDP x.x.x.x:5060;branch=z9hG4bK4d5f.11c7cfacce4d26c8fd1b01339c08b1dc.0 42 | From: "1001";tag=18aa565e 43 | To: ;tag=eX6m9Ktp48aaF 44 | Call-ID: ZwRgsMB3luEHyKaM2vL9eQ.. 45 | CSeq: 1 INVITE 46 | User-Agent: FreeSWITCH-mod_sofia/1.9.0-742-8f1b7e0~64bit 47 | Accept: application/sdp 48 | Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY 49 | Supported: timer, path, replaces 50 | Allow-Events: talk, hold, conference, refer 51 | Proxy-Authenticate: Digest realm="x.x.x.x", nonce="e797bde2-c7b5-47a7-ae95-931af57c9774", algorithm=MD5, qop="auth" 52 | Content-Length: 0 53 | ``` 54 | 55 | It is not upto the UA to, reconstruct another INVITE ( with CSeq-2) with proxy Authoroxation header containing digest , username , realm, nonce etc to resent to freeswitch server to autheticate and proceed with call 56 | ``` 57 | Proxy-Authorization: Digest username="aaa", realm="x.x.x.x", nonce="e797bde2-c7b5-47a7-ae95-931af57c9774", uri="sip:200@x.x.x.x5:5080;pstn_inbound=;ignore_userinfo=", qop=auth, nc=00000001, cnonce="4060286812", response="cae451f24bbbcefeb7d01c13b070026a", algorithm=MD5 58 | ``` 59 | 60 | ## Debugging 61 | 62 | **Issue 1** auth request for relam missing 63 | [DEBUG] switch_core_state_machine.c:662 (sofia/external/123@x.x.x.x:5080) State CONSUME_MEDIA going to sleep 64 | [ERR] sofia_reg.c:2625 Cannot locate any authentication credentials to complete an authentication request for realm '"x.x.x.x"' 65 | [NOTICE] sofia_reg.c:2648 Hangup sofia/external/123@x.x.x.x:5080 [CS_CONSUME_MEDIA] [MANDATORY_IE_MISSING] 66 | **Solution** when u make a call either form sipp or softphone or even orignate cooamdn such as below 67 | ``` 68 | originate {origination_caller_id_number=9999999999}sofia/external/123@3.222.205.112:5080 9999999999 XML default 69 | ``` 70 | needs to be associated with auth creds since auth_calls options is true on that profile 71 | ``` 72 | originate {sip_auth_username=2222222222,sip_auth_password=123456,origination_caller_id_number=9999999999}sofia/external/987654321@10.130.74.15:5080 9999999999 XML default 73 | ``` 74 | 75 | -------------------------------------------------------------------------------- /Auth/directory/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Auth/sip_profiles/external.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Auth/sip_profiles/internal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /Lua/README.md: -------------------------------------------------------------------------------- 1 | # Lua Scripts for Call routing in freeswitch 2 | 3 | Lua not only helps write modular call scripts but also is lightweight and embeddbale 4 | suited to make dialplans for complex applications as well as high-cps call dispatching 5 | mod_lua lets us bind lua script to XML requests and serve your configuration. The Lua scrit returns the XML string. 6 | 7 | default lua config 8 | ```xml 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | ``` 42 | 43 | fetching a Dialplan from Lua script. 44 | ```xml 45 | 46 | 47 | 48 | 49 | 50 | 51 | ``` 52 | 53 | ## Installation on ubuntu 54 | Assuming freeswitch is already installed , install lus 55 | ``` 56 | apt-get install lua5.2 57 | ``` 58 | version in used Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio 59 | 60 | ## Runing Lua 61 | usage: lua [options] [script [args]] 62 | Available options are: 63 | -e stat execute string 'stat' 64 | -i enter interactive mode after executing 'script' 65 | -l name require library 'name' 66 | -v show version information 67 | -E ignore environment variables 68 | -- stop handling options 69 | - stop handling options and execute stdin 70 | 71 | ### Ruuning simple call program 72 | 73 | make a file called callscript.lua 74 | ```c 75 | new_leg = freeswitch.Session("user/altanai") 76 | ``` 77 | 78 | Runing this with lua from fs_cli 79 | ``` 80 | fs_cli> lua callscript.lua 81 | ``` 82 | will output in a call from freeswitch to user altanai , like 83 | ``` 84 | Output 85 | 86 | [NOTICE] switch_channel.c:1104 New Channel sofia/internal/altanai@x.x.x.x:50037 [310277e3-4e42-41d0-8906-dba93e35c5d6] 87 | INVITE sip:altanai@x.x.x.x:50037;rinstance=c14e4a9ba6020f9b SIP/2.0 88 | Via: SIP/2.0/UDP x.x.x.x;rport;branch=z9hG4bK31Z086ce8UtXK 89 | Max-Forwards: 70 90 | From: "" ;tag=3SvHQr98DK0vN 91 | To: 92 | Call-ID: 281334aa-5a0b-1238-d29d-02a933b32da0 93 | CSeq: 10144944 INVITE 94 | Contact: 95 | User-Agent: FreeSWITCH-mod_sofia/1.9.0-742-8f1b7e0~64bit 96 | Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE 97 | Supported: timer, path, replaces 98 | Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer 99 | Content-Type: application/sdp 100 | Content-Disposition: session 101 | Content-Length: 1210 102 | X-FS-Support: update_display,send_info 103 | Remote-Party-ID: ;party=calling;screen=yes;privacy=off 104 | ``` 105 | Before runing above script make sure to register an internal user altanai in directory with domain such as below 106 | ``` 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | ``` 118 | PS : we can use luarun for non blocking operation 119 | ``` 120 | fs_cli -x "lua calls.lua" 121 | ``` 122 | 123 | When the Lua script is called from FreeSWITCH, we get the 'freeswitch' object which can be used to access session , logs , parms or do operatiosn like bridge , msleep etc 124 | ```c 125 | freeswitch.consoleLog("INFO","This is a log linen") 126 | freeswitch.bridge(session1, session2) 127 | ``` 128 | If script is executed from dialplan , then we get a 'session' object which represents the call leg and we can access answer, play media, get DTMFs, hangup, etc funcality 129 | ```c 130 | session:answer() 131 | session:hangup() 132 | ``` 133 | 134 | 135 | ### Other auto-load configs 136 | 137 | /etc/freeswitch/autoload_configs# ls 138 | abstraction.conf.xml 139 | cdr_pg_csv.conf.xml 140 | distributor.conf.xml 141 | hiredis.conf.xml 142 | modules.conf.xml 143 | post_load_modules.conf.xml 144 | sofia.conf.xml 145 | voicemail.conf.xml 146 | acl.conf.xml 147 | cdr_sqlite.conf.xml 148 | easyroute.conf.xml 149 | httapi.conf.xml 150 | mongo.conf.xml 151 | presence_map.conf.xml 152 | spandsp.conf.xml 153 | voicemail_ivr.conf.xml 154 | alsa.conf.xml 155 | cepstral.conf.xml 156 | enum.conf.xml 157 | http_cache.conf.xml 158 | msrp.conf.xml 159 | python.conf.xml 160 | switch.conf.xml 161 | xml_cdr.conf.xml 162 | amqp.conf.xml 163 | cidlookup.conf.xml 164 | erlang_event.conf.xml 165 | ivr.conf.xml 166 | nibblebill.conf.xml 167 | redis.conf.xml 168 | syslog.conf.xml 169 | xml_curl.conf.xml 170 | amr.conf.xml 171 | conference.conf.xml 172 | event_multicast.conf.xml 173 | java.conf.xml 174 | opal.conf.xml 175 | rss.conf.xml 176 | timezones.conf.xml 177 | xml_rpc.conf.xml 178 | amrwb.conf.xml 179 | conference_layouts.conf.xml 180 | event_socket.conf.xml 181 | kazoo.conf.xml 182 | opus.conf.xml 183 | rtmp.conf.xml 184 | translate.conf.xml 185 | xml_scgi.conf.xml 186 | avmd.conf.xml 187 | console.conf.xml 188 | fax.conf.xml 189 | lcr.conf.xml 190 | oreka.conf.xml 191 | sangoma_codec.conf.xml 192 | tts_commandline.conf.xml 193 | zeroconf.conf.xml 194 | blacklist.conf.xml 195 | db.conf.xml 196 | fifo.conf.xml 197 | local_stream.conf.xml osp.conf.xml 198 | shout.conf.xml 199 | unicall.conf.xml 200 | callcenter.conf.xml 201 | dialplan_directory.conf.xml 202 | format_cdr.conf.xml 203 | logfile.conf.xml 204 | perl.conf.xml 205 | skinny.conf.xml 206 | unimrcp.conf.xml 207 | cdr_csv.conf.xml 208 | dingaling.conf.xml 209 | graylog2.conf.xml 210 | lua.conf.xml 211 | pocketsphinx.conf.xml 212 | smpp.conf.xml 213 | v8.conf.xml 214 | cdr_mongodb.conf.xml 215 | directory.conf.xml 216 | hash.conf.xml 217 | memcache.conf.xml 218 | portaudio.conf.xml 219 | sms_flowroute.conf.xml 220 | verto.conf.xml 221 | 222 | 223 | ## Debug 224 | 225 | **Issue1** 2019-09-23 12:13:19.026927 [ERR] mod_lua.cpp:203 cannot open /dp.lua: No such file or directory 226 | 2019-09-23 12:13:19.026927 [ERR] mod_lua.cpp:271 LUA script parse/execute error! 227 | **Solution** add file with correct path 228 | ```xml 229 | 230 | 231 | 232 | 233 | 234 | 235 | ``` 236 | 237 | **Issue2**[ERR] mod_dptools.c:4297 control the behavior of the call when a user is dialed. 238 | [NOTICE] switch_ivr_originate.c:2868 Cannot create outgoing channel of type [user] cause: [MANDATORY_IE_MISSING] 239 | **solution** The dial-string parameter is used by the user/ endpoint. ample given for directory/default.xml 240 | ```xml 241 | 242 | ``` -------------------------------------------------------------------------------- /Lua/lua_autoload/arguments_pass.lua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/lua 2 | freeswitch.consoleLog("info","------------------------------------------- arguments_pass sample -------------------------------") 3 | var1 = argv[1] -- First argument 4 | var2 = argv[2] -- Second argumenti 5 | freeswitch.consoleLog("info", tostring(var1) .. "\n") 6 | freeswitch.consoleLog("info", tostring(var2) .. "\n") 7 | 8 | --[[ 9 | output 10 | switch_cpp.cpp:1376 ------------------------------------------- arguments_pass sample ------------------------------- 11 | [INFO] switch_cpp.cpp:1376 altanai 12 | [INFO] switch_cpp.cpp:1376 bisht 13 | ]] -------------------------------------------------------------------------------- /Lua/lua_autoload/autoload_configs/lua.conf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | --> 17 | 18 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Lua/lua_autoload/helloworld.lua: -------------------------------------------------------------------------------- 1 | 2 | --single line comment 3 | --[[ 4 | multi 5 | line 6 | comment 7 | ]] 8 | freeswitch.consoleLog("info","------------------------------------------- hello world -------------------------------") 9 | freeswitch.consoleLog("notice", "SECTION " .. XML_REQUEST["section"] .. "\n") 10 | freeswitch.consoleLog("info",params:serialize()) 11 | 12 | --[[ multi line comment 13 | 14 | output of above : 15 | 16 | [INFO] switch_cpp.cpp:1376 ------------------------------------------- hello world -------------------------------2019-09-24 11:30:51.267996 [NOTICE] switch_cpp.cpp:1376 SECTION dialplan 17 | [INFO] switch_cpp.cpp:1376 Event-Name: REQUEST_PARAMS 18 | Core-UUID: 7f7bf79b-6f9b-40bb-865a-df0ec9a1637a 19 | FreeSWITCH-Hostname: ip-x-x-x-x 20 | FreeSWITCH-Switchname: ip-x-x-x-x 21 | FreeSWITCH-IPv4: x.x.x.x 22 | FreeSWITCH-IPv6: fe80%3A%3Aa9%3A33ff%3Afeb3%3A2da0 23 | Event-Date-Local: 2019-09-24%2011%3A30%3A51 24 | Event-Date-GMT: Tue,%2024%20Sep%202019%2011%3A30%3A51%20GMT 25 | Event-Date-Timestamp: 1569324651267996 26 | Event-Calling-File: mod_dialplan_xml.c 27 | Event-Calling-Function: dialplan_xml_locate 28 | Event-Calling-Line-Number: 608 29 | Event-Sequence: 536 30 | Channel-State: CS_ROUTING 31 | Channel-Call-State: RINGING 32 | Channel-State-Number: 2 33 | Channel-Name: sofia/internal/2222222222%40x.x.x.x 34 | Unique-ID: b3fe45ad-78ad-4d33-b70e-644e48969805 35 | Call-Direction: inbound 36 | Presence-Call-Direction: inbound 37 | Channel-HIT-Dialplan: true 38 | Channel-Presence-ID: 2222222222%40x.x.x.x 39 | Channel-Call-UUID: b3fe45ad-78ad-4d33-b70e-644e48969805 40 | Answer-State: ringing 41 | Caller-Direction: inbound 42 | Caller-Logical-Direction: inbound 43 | Caller-Username: 2222222222 44 | Caller-Dialplan: XML 45 | Caller-Caller-ID-Name: 2222222222 46 | Caller-Caller-ID-Number: 2222222222 47 | Caller-Orig-Caller-ID-Name: 2222222222 48 | Caller-Orig-Caller-ID-Number: 2222222222 49 | Caller-Network-Addr: x.x.x.x 50 | Caller-ANI: 2222222222 51 | Caller-Destination-Number: 9999999999 52 | Caller-Unique-ID: b3fe45ad-78ad-4d33-b70e-644e48969805 53 | Caller-Source: mod_sofia 54 | Caller-Context: public 55 | Caller-Channel-Name: sofia/internal/2222222222%40x.x.x.x 56 | Caller-Profile-Index: 1 57 | Caller-Profile-Created-Time: 1569324651267996 58 | Caller-Channel-Created-Time: 1569324651267996 59 | Caller-Channel-Answered-Time: 0 60 | Caller-Channel-Progress-Time: 0 61 | Caller-Channel-Progress-Media-Time: 0 62 | Caller-Channel-Hangup-Time: 0 63 | Caller-Channel-Transfer-Time: 0 64 | Caller-Channel-Resurrect-Time: 0 65 | Caller-Channel-Bridged-Time: 0 66 | Caller-Channel-Last-Hold: 0 67 | Caller-Channel-Hold-Accum: 0 68 | Caller-Screen-Bit: true 69 | Caller-Privacy-Hide-Name: false 70 | Caller-Privacy-Hide-Number: false 71 | variable_direction: inbound 72 | variable_uuid: b3fe45ad-78ad-4d33-b70e-644e48969805 73 | variable_session_id: 1 74 | variable_sip_from_user: 2222222222 75 | variable_sip_from_uri: 2222222222%40x.x.x.x 76 | variable_sip_from_host: x.x.x.x 77 | variable_video_media_flow: disabled 78 | variable_audio_media_flow: disabled 79 | variable_text_media_flow: disabled 80 | variable_channel_name: sofia/internal/2222222222%40x.x.x.x 81 | variable_sip_call_id: 99140ZjE1YWVmZjQ3MWJhMGFlMGVjMDUwOTdmY2MzYzFiMTQ 82 | variable_sip_local_network_addr: x.x.x.x 83 | variable_sip_network_ip: x.x.x.x 84 | variable_sip_network_port: 20729 85 | variable_sip_invite_stamp: 1569324651267996 86 | variable_sip_received_ip: x.x.x.x 87 | variable_sip_received_port: 20729 88 | variable_sip_via_protocol: udp 89 | variable_sip_authorized: true 90 | variable_sip_acl_authed_by: test2 91 | variable_sip_from_user_stripped: 2222222222 92 | variable_sip_from_tag: 4268b509 93 | variable_sofia_profile_name: internal 94 | variable_sofia_profile_url: sip%3Amod_sofia%40x.x.x.x%3A5060 95 | variable_recovery_profile_name: internal 96 | variable_sip_full_via: SIP/2.0/UDP%20x.x.x.x%3A5067%3Bbranch%3Dz9hG4bK-524287-1---3e4ff717c1d11449%3Brport%3D20729%3Breceived%3Dx.x.x.x 97 | variable_sip_full_from: %3Csip%3A2222222222%40x.x.x.x%3E%3Btag%3D4268b509 98 | variable_sip_full_to: %3Csip%3A9999999999%40x.x.x.x%3E 99 | variable_sip_allow: OPTIONS,%20SUBSCRIBE,%20NOTIFY,%20INVITE,%20ACK,%20CANCEL,%20BYE,%20REFER,%20INFO 100 | variable_sip_req_user: 9999999999 101 | variable_sip_req_uri: 9999999999%40x.x.x.x 102 | variable_sip_req_host: x.x.x.x 103 | variable_sip_to_user: 9999999999 104 | variable_sip_to_uri: 9999999999%40x.x.x.x 105 | variable_sip_to_host: x.x.x.x 106 | variable_sip_contact_user: 2222222222 107 | variable_sip_contact_port: 5067 108 | variable_sip_contact_uri: 2222222222%40x.x.x.x%3A5067 109 | variable_sip_contact_host: x.x.x.x 110 | variable_rtp_use_codec_string: PCMU,PCMA 111 | variable_sip_user_agent: X-Lite%20release%205.6.1%20stamp%2099140 112 | variable_sip_via_host: x.x.x.x 113 | variable_sip_via_port: 5067 114 | variable_sip_via_rport: 20729 115 | variable_max_forwards: 70 116 | variable_presence_id: 2222222222%40x.x.x.x 117 | variable_sip_nat_detected: true 118 | variable_switch_r_sdp: v%3D0%0D%0Ao%3D-%201569324651642456%201%20IN%20IP4%20x.x.x.x%0D%0As%3DX-Lite%20release%205.6.1%20stamp%2099140%0D%0Ac%3DIN%20IP4%20x.x.x.x%0D%0At%3D0%200%0D%0Am%3Daudio%2059190%20RTP/AVP%209%0D%0A 119 | variable_endpoint_disposition: DELAYED%20NEGOTIATION 120 | variable_call_uuid: b3fe45ad-78ad-4d33-b70e-644e48969805 121 | Hunt-Direction: inbound 122 | Hunt-Logical-Direction: inbound 123 | Hunt-Username: 2222222222 124 | Hunt-Dialplan: XML 125 | Hunt-Caller-ID-Name: 2222222222 126 | Hunt-Caller-ID-Number: 2222222222 127 | Hunt-Orig-Caller-ID-Name: 2222222222 128 | Hunt-Orig-Caller-ID-Number: 2222222222 129 | Hunt-Network-Addr: x.x.x.x 130 | Hunt-ANI: 2222222222 131 | Hunt-Destination-Number: 9999999999 132 | Hunt-Unique-ID: b3fe45ad-78ad-4d33-b70e-644e48969805 133 | Hunt-Source: mod_sofia 134 | Hunt-Context: public 135 | Hunt-Channel-Name: sofia/internal/2222222222%40x.x.x.x 136 | Hunt-Profile-Index: 1 137 | Hunt-Profile-Created-Time: 1569324651267996 138 | Hunt-Channel-Created-Time: 1569324651267996 139 | Hunt-Channel-Answered-Time: 0 140 | Hunt-Channel-Progress-Time: 0 141 | Hunt-Channel-Progress-Media-Time: 0 142 | Hunt-Channel-Hangup-Time: 0 143 | Hunt-Channel-Transfer-Time: 0 144 | Hunt-Channel-Resurrect-Time: 0 145 | Hunt-Channel-Bridged-Time: 0 146 | Hunt-Channel-Last-Hold: 0 147 | Hunt-Channel-Hold-Accum: 0 148 | Hunt-Screen-Bit: true 149 | Hunt-Privacy-Hide-Name: false 150 | Hunt-Privacy-Hide-Number: false 151 | ]] -------------------------------------------------------------------------------- /Lua/lua_dialplan/dialplan/lua_session_answer_prompt_hangup.lua: -------------------------------------------------------------------------------- 1 | -- Answer call, play a prompt, hang up 2 | -- Set the path separator 3 | pathsep = '/' 4 | -- Windows users do this instead: 5 | -- pathsep = '' 6 | -- Answer the call 7 | freeswitch.consoleLog("WARNING","Not yet answered") 8 | session:answer() 9 | freeswitch.consoleLog("WARNING","Already answered") 10 | -- Create a string with path and filename of a sound file 11 | prompt ="ivr" ..pathsep .."ivr-welcome_to_freeswitch.wav" 12 | -- Play the prompt 13 | freeswitch.consoleLog("WARNING","About to play '" .. prompt .."'n") 14 | session:streamFile(prompt) 15 | freeswitch.consoleLog("WARNING","After playing '" .. prompt .."'n") 16 | -- Hangup 17 | session:hangup() 18 | freeswitch.consoleLog("WARNING","Afterhangupn") 19 | 20 | --[[ 21 | output : 22 | [INFO] mod_dialplan_xml.c:637 Processing altanai ->5000 in context public 23 | EXECUTE sofia/internal/altanai@x.x.x.x lua(/etc/freeswitch/dialplan/lua_session_answer_prompt_hangup.lua) 24 | [WARNING] switch_cpp.cpp:1376 Not yet answered 25 | ... 26 | [DEBUG] switch_channel.c:3781 (sofia/internal/altanai@x.x.x.x) Callstate Change EARLY -> ACTIVE 27 | [WARNING] switch_cpp.cpp:1376 Already answered 28 | [WARNING] switch_cpp.cpp:1376 About to play 'ivr/ivr-welcome_to_freeswitch.wav 29 | ... 30 | [DEBUG] switch_ivr_play_say.c:1942 done playing file /usr/share/freeswitch/sounds/en/us/callie/ivr/ivr-welcome_to_freeswitch.wav 31 | [WARNING] switch_cpp.cpp:1376 After playing 'ivr/ivr-welcome_to_freeswitch.wav'n [DEBUG] switch_cpp.cpp:731 CoreSession::hangup 32 | [NOTICE] switch_cpp.cpp:733 Hangup sofia/internal/altanai@x.x.x.x [CS_EXECUTE] [NORMAL_CLEARING] 33 | [WARNING] switch_cpp.cpp:1376 Afterhangup 34 | ]] -------------------------------------------------------------------------------- /Lua/lua_dialplan/dialplan/lua_session_leg_bridge.lua: -------------------------------------------------------------------------------- 1 | freeswitch.consoleLog("WARNING","-------- Before first call") 2 | 3 | first_session = freeswitch.Session("user/altanai") 4 | if (first_session:ready()) then 5 | freeswitch.consoleLog("WARNING","--------- first leg answered") 6 | 7 | second_session = freeswitch.Session("user/bob") 8 | if (second_session:ready()) then 9 | freeswitch.consoleLog("WARNING","------- second leg answered") 10 | 11 | freeswitch.bridge(first_session, second_session) 12 | freeswitch.consoleLog("WARNING","--------- After bridging") 13 | else 14 | freeswitch.consoleLog("WARNING","second leg failed") 15 | end 16 | else 17 | freeswitch.consoleLog("WARNING","first leg failed") 18 | end 19 | 20 | -- Script for sipp to start the first call to 5001 , after which FS dials out altanaia nd bob 21 | -- sipp -sn uac -s 5001 x.x.x.x:5060 -m 1 -d 20000 -mp 6001 -mi 127.0.0.1 22 | 23 | --[[ 24 | Output : 25 | Dialplan: sofia/internal/bob@x.x.x.x Action lua(/etc/freeswitch/dialplan/lua_session_leg_bridge.lua) 26 | EXECUTE sofia/internal/bob@x.x.x.x lua(/etc/freeswitch/dialplan/lua_session_leg_bridge.lua) 27 | 28 | ...Incoming call 29 | [NOTICE] switch_channel.c:1104 New Channel sofia/internal/altanai@x.x.x.x:7494 [a096c009-3045-4f03-a416-b652397a8b29] 30 | EXECUTE sofia/internal/sipp@fx.x.x.x:5060 lua(/etc/freeswitch/dialplan/lua_session_leg_bridge.lua) 31 | 32 | [WARNING] switch_cpp.cpp:1376 -------- Before first call 33 | .. Leg 1 34 | [NOTICE] switch_channel.c:1104 New Channel sofia/internal/altanai@x.x.x.x:5284 [ed7a825a-3e08-4372-82ca-428b1778a409] 35 | [NOTICE] sofia.c:8427 Channel [sofia/internal/altanai@x.x.x.x:5284] has been answered 36 | [WARNING] switch_cpp.cpp:1376 --------- first leg answered 37 | [DEBUG] switch_ivr_originate.c:2159 Parsing global variables 38 | .. Leg 2 39 | [NOTICE] switch_channel.c:1104 New Channel sofia/internal/bob@x.x.x.x:35733 [6f40d42a-fbca-4af3-a772-36c344b7d75c] 40 | [NOTICE] sofia.c:8427 Channel [sofia/internal/bob@x.x.x.x:35733] has been answered 41 | [WARNING] switch_cpp.cpp:1376 ------- second leg answered 42 | 43 | [DEBUG] switch_ivr_bridge.c:1639 (sofia/internal/bob@x.x.x.x:35733) State Change CS_SOFT_EXECUTE -> CS_CONSUME_MEDIA 44 | ]] -------------------------------------------------------------------------------- /Lua/lua_dialplan/dialplan/public.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Lua/lua_dialplan/lua_autoattendant.lua: -------------------------------------------------------------------------------- 1 | session:answer(); 2 | while (session:ready() == true) do 3 | session:setAutoHangup(false); 4 | session:set_tts_params("flite", "kal"); 5 | session:speak("Welcome. Welcome to the VoIp World!. this is a Blind Users Programing Community. powered by Freeswitch, the free / ultimate PBX. thank to toni!"); 6 | session:sleep(100); 7 | session:speak("please select an Action."); 8 | session:sleep(100); 9 | session:speak("to call the conference, press 1"); 10 | session:sleep(100); 11 | session:speak("to call Freeswitch IVR, press 2"); 12 | session:sleep(100); 13 | session:speak("to call Voice Mail, press 3"); 14 | session:sleep(100); 15 | session:speak("for Music on hold, press 4"); 16 | session:sleep(100); 17 | session:speak("to call me, press 0"); 18 | session:sleep(3000); 19 | digits = session:getDigits(1, "", 3000); 20 | if (digits == "1") then 21 | session:execute("transfer","9888"); 22 | end 23 | if (digits == "2") then 24 | session:execute("transfer","5000"); 25 | end 26 | if (digits == "3") then 27 | session:execute("transfer","4000"); 28 | end 29 | if (digits == "4") then 30 | session:execute("transfer","9999"); 31 | end 32 | if (digits == "0") then 33 | session:execute("transfer","voipaware@sip.voipuser.org"); 34 | end 35 | end -------------------------------------------------------------------------------- /Media_handling/README.md: -------------------------------------------------------------------------------- 1 | # Media Handling in Freeswitch sever 2 | 3 | FreeSWITCH can act as media Server or can completely bypassing the media altogether to save bandwidth and load on the server . 4 | It can also proxy media in cases where a particular codec is not supported , only Natig si required or no processing on media stream is required such as transcoding. 5 | Freeswitch can also make the media proxy via ana external media server 6 | 7 | ## RTP Related options in configuration file 8 | 9 | auto-jitterbuffer-msec - size of the jitterbuffer on all calls coming through this profile. 10 | 11 | 12 | rtp-timer-name 13 | 14 | 15 | rtp-rewrite-timestamps - regenerate and rewrite the timestamps in all the RTP streams 16 | 17 | 18 | rtp-timeout-sec - seconds of RTP inactivity (media silence) before FreeSWITCH considers the call disconnected, and hangs up. 19 | 20 | 21 | rtp-hold-timeout-sec - seconds of RTP inactivity (media silence) for a call placed on hold by an endpoint before FreeSWITCH considers the call disconnected, and hangs up. 22 | 23 | 24 | rtp-autoflush-during-bridge 25 | Controls what happens if FreeSWITCH detects that it's not keeping up with the RTP media (audio) stream on a bridged call. (This situation can happen if the FreeSWITCH server has insufficient CPU time available.) 26 | 27 | When set to "true" (the default), FreeSWITCH will notice when more than one RTP packet is waiting to be read in the incoming queue. If this condition persists for more than five seconds, RTP packets will be discarded to "catch up" with the audio stream. For example, if there are always five extra 20 ms packets in the queue, 100 ms of audio latency can be eliminated by discarding the packets. This will cause an audio glitch as some audio is discarded, but will improve the latency by 100 ms for the rest of the call. 28 | 29 | If rtp-autoflush-during-bridge is set to false, FreeSWITCH will instead preserve all RTP packets on bridged calls, even if it increases the latency or "lag" that callers hear. 30 | 31 | 32 | rtp-autoflush 33 | Has the same effect as "rtp-autoflush-during-bridge", but affects NON-bridged calls (such as faxes, IVRs and the echo test). 34 | 35 | Unlike "rtp-autoflush-during-bridge", the default is false, meaning that high-latency packets on non-bridged calls will not be discarded. This results in smoother audio at the possible expense of increasing audio latency (or "lag"). 36 | 37 | Setting "rtp-autoflush" to true will discard packets to minimize latency when possible. Doing so may cause errors in DTMF recognition, faxes, and other processes that rely on receiving all packets. 38 | 39 | 40 | 41 | 42 | ## Media related options 43 | 44 | 45 | resume-media-on-hold - When calls are in no media this will bring them back to media when you press the hold button. To return the calls to bypass-media after the call is unheld, enable bypass-media-after-hold. 46 | 47 | 48 | bypass-media-after-att-xfer - allow a call after an attended transfer go back to bypass media after an attended transfer. 49 | 50 | 51 | bypass-media-after-hold - allow a call to go back to bypass media after a hold. This option can be enabled only if resume-media-on-hold is set. Available from git rev 8fa385b. 52 | 53 | 54 | inbound-bypass-media - server only keeps the SIP messages state, but have the RTP steam go directly from end-point to end-point 55 | 56 | 57 | inbound-proxy-media - server keeps both the SIP and RTP traffic on the server but does not interact with the RTP stream. 58 | 59 | 60 | disable-rtp-auto-adjust 61 | 62 | 63 | ignore-183nosdp 64 | 65 | 66 | enable-soa 67 | 68 | Set the value to "false" to diable SIP SOA from sofia to tell sofia not to touch the exchange of SDP 69 | 70 | t38-passthru 71 | 72 | 'true' enables t38 passthru 73 | 'false' disables t38 passthru 74 | 'once' enables t38 passthru, but sends t.38 re-invite only once (available since commit 08b25a8 from Nov. 9, 2011) 75 | 76 | 77 | ##Codecs related options 78 | 79 | inbound-codec-prefs 80 | 81 | 82 | outbound-codec-prefs 83 | 84 | 85 | codec-prefs - change both inbound-codec-prefs and outbound-codec-prefs at the same time. 86 | 87 | 88 | inbound-codec-negotiation 89 | 90 | 'generous' permits the remote codec list have precedence and 'win' the codec negotiation and selection process 91 | 'greedy' forces a win by the local FreeSWITCH preference list 92 | 'scrooge' wins even when the far side lies about capabilities during the negotiation process 93 | sip_codec_negotiation is a channel variable version of this setting 94 | 95 | inbound-late-negotiation - Uncomment to let calls hit the dialplan *before* you decide if the codec is OK. 96 | 97 | 98 | bitpacking - AAL2 bitpacking on G.726. 99 | 100 | 101 | disable-transcoding - force the outbound leg of a bridge to only offer the codec that the originator is using 102 | 103 | 104 | renegotiate-codec-on-reinvite 105 | 106 | 107 | 108 | ## Bypass media 109 | 110 | 111 | 112 | ## codecs 113 | 114 | Compression / decompression 115 | for the multimedia data streams to be useful in stored or transmitted form, they must be encapsulated together in a container format. 116 | 117 | Lossy - eliminiates correspondingly larger data sets 118 | Lossless - preserves orignal quality of stream 119 | 120 | default codecs in vars.xml 121 | ``` 122 | 123 | 124 | ``` 125 | 126 | codec ettings in sofia.cofif.xml 127 | ``` 128 | 129 | 130 | 131 | 132 | ``` 133 | 134 | Two principal techniques are used in codecs, pulse-code modulation and delta modulation. 135 | 136 | ## Early Media 137 | 138 | Early media refers to media (e.g., audio and video) that is exchanged before a particular session is accepted by the called user. 139 | ie exchange of information before establishment of a connection 140 | 141 | Triggering early media 142 | On an inbound call you can execute pre_answer to trigger early media. After this you can do ringback, play a file or whatever. 143 | 144 | **ignoring early media** on dialplan 145 | 146 | -------------------------------------------------------------------------------- /Media_handling/audio_codecs.md: -------------------------------------------------------------------------------- 1 | ## Audio Codecs 2 | 3 | Transcodable Audio Codecs 4 | The following codecs can be used when setting codec_string and absolute_codec_string. 5 | 6 | OPUS 7 | opus@48000h@10i - Opus 48khz using 10 ms ptime (mono and stereo) 8 | opus@48000h@20i - Opus 48khz using 20 ms ptime (mono and stereo) 9 | opus@48000h@40i - Opus 48khz using 40 ms ptime 10 | opus@16000h@10i - Opus 16khz using 10 ms ptime (mono and stereo) 11 | opus@16000h@20i - Opus 16khz using 20 ms ptime (mono and stereo) 12 | opus@16000h@40i - Opus 16khz using 40 ms ptime 13 | opus@8000h@10i - Opus 8khz using 10 ms ptime (mono and stereo) 14 | opus@8000h@20i - Opus 8khz using 20 ms ptime (mono and stereo) 15 | opus@8000h@40i - Opus 8khz using 40 ms ptime 16 | opus@8000h@60i - Opus 8khz using 60 ms ptime 17 | opus@8000h@80i - Opus 8khz using 80 ms ptime 18 | opus@8000h@100i - Opus 8khz using 100 ms ptime 19 | opus@8000h@120i - Opus 8khz using 120 ms ptime 20 | provided by mod_opus 21 | 22 | iSAC (mod_isac) 23 | 24 | CODEC2 2550bps) 8000hz 20ms (mod_codec2) 25 | 26 | SILK Skype Audio codec (mod_silk) 27 | 28 | iLBC@30i - iLBC using mode=30 which will win in all cases (mod_ilbc) 29 | 30 | Speex (mod_speex) 31 | speex@8000h@20i - Speex 8kHz using 20ms ptime. 32 | speex@16000h@20i - Speex 16kHz using 20ms ptime. 33 | speex@32000h@20i - Speex 32kHz using 20ms ptime. 34 | 35 | 36 | BroadVoice (mod_bv) 37 | BV32 - BroadVoice 16kHz, 32kb/s wideband 38 | BV16 - BroadVoice 8kHz, 16kb/s narrowband 39 | 40 | Siren 41 | G7221@16000h - G722.1 16kHz (aka Siren 7) 42 | G7221@32000h - G722.1C 32kHz (aka Siren 14) 43 | Provided by mod_siren 44 | 45 | CELT wideband. 46 | CELT@32000h - CELT 32kHz, only 10ms supported 47 | CELT@48000h - CELT 48kHz, only 10ms supported 48 | Provided by mod_celt 49 | 50 | DVI 51 | DVI4@8000h@20i - IMA ADPCM 8kHz using 20ms ptime. (multiples of 10) 52 | DVI4@16000h@40i - IMA ADPCM 16kHz using 40ms ptime. (multiples of 10) 53 | 54 | GSM@40i - GSM 8kHz using 40ms ptime. (GSM is done in multiples of 20, Default is 20ms) 55 | 56 | G722 - G722 16kHz using default 20ms ptime. (multiples of 10) 57 | 58 | G.726 59 | G726-16 - G726 16kbit adpcm using default 20ms ptime. (multiples of 10) 60 | G726-24 - G726 24kbit adpcm using default 20ms ptime. (multiples of 10) 61 | G726-32 - G726 32kbit adpcm using default 20ms ptime. (multiples of 10) 62 | G726-40 - G726 40kbit adpcm using default 20ms ptime. (multiples of 10) 63 | AAL2-G726-16 - Same as G726-16 but using AAL2 packing. (multiples of 10) 64 | AAL2-G726-24 - Same as G726-24 but using AAL2 packing. (multiples of 10) 65 | AAL2-G726-32 - Same as G726-32 but using AAL2 packing. (multiples of 10) 66 | AAL2-G726-40 - Same as G726-40 but using AAL2 packing. (multiples of 10) 67 | 68 | LPC - LPC10 using 90ms ptime (only supports 90ms at this time in FreeSWITCH) 69 | Provided by mod_spandsp. 70 | 71 | G729 - G729 in transcoding mode 72 | provided by: mod_com_g729 73 | 74 | PCMU - G711 8kHz ulaw using default 20ms ptime. (multiples of 10) 75 | 76 | PCMA - G711 8kHz alaw using default 20ms ptime. (multiples of 10) 77 | 78 | L16 - L16 isn't recommended for VoIP but you can do it. L16 can exceed the MTU Rather quickly. 79 | Provided in core PCM module. 80 | 81 | Pass-through Audio Codecs 82 | 83 | G729 - G729 in passthru mode. (mod_g729 / mod_com_g729) 84 | Provided by mod_g729 for passthru mode and mod_com_g729 for commercial license (10USD per channel) 85 | 86 | G723 - G723.1 in passthru mode. (mod_g723_1) 87 | Provided in mod_g723.1. 88 | 89 | AMR - AMR in passthru mode. (mod_amr) 90 | 91 | AMR-WB (G.722.2) - AMR-WB in passthru mode. (mod_amr_wb) -------------------------------------------------------------------------------- /Media_handling/video_codecs.md: -------------------------------------------------------------------------------- 1 | # video_codecs 2 | 3 | Pass-through video codecs 4 | H261 - H.261 Video 5 | H263 - H.263 Video 6 | H263-1998 - H.263-1998 Video 7 | H263-2000 - H.263-2000 Video 8 | H264 - H.264 Video (mod_h26X) 9 | Theora passthrough (mod_theora) 10 | MP4 Video passthrough (mod_mp4v) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Freeswitch sample configuration for various usecases 2 | 3 | freeswitch internal architecture ![freeswitch_internal_archietture](https://altanaitelecom.files.wordpress.com/2012/05/freeswitch.png?w=500) 4 | 5 | Opensource SIP Application Server 6 | Mozilla Public License (MPL) 7 | 8 | ## Installation on debain / Ubuntu 9 | 10 | Update the Package Manager. 11 | ``` 12 | apt-get update && apt-get install -y gnupg2 wget 13 | ``` 14 | 15 | Add the Public Key of FreeSwitch package to local Package Manager. 16 | ``` 17 | wget -O - https://files.freeswitch.org/repo/deb/debian-release/fsstretch-archive-keyring.asc | apt-key add - 18 | ``` 19 | 20 | Add the FreeSwitch repository URL to the source list of local Package Manager. 21 | ``` 22 | echo "deb http://files.freeswitch.org/repo/deb/debian-release/ stretch main" > /etc/apt/sources.list.d/freeswitch.list 23 | echo "deb-src http://files.freeswitch.org/repo/deb/debian-release/ stretch main" >> /etc/apt/sources.list.d/freeswitch.list 24 | ``` 25 | 26 | Install the FreeSwitch package. 27 | ``` 28 | apt-get update && apt-get install -y freeswitch-meta-all 29 | ``` 30 | 31 | ## Installation on mac os 32 | 33 | make the folder structure 34 | ``` 35 | cd /usr/local 36 | sudo mkdir freeswitch src 37 | sudo chown -R `id -u`:`id -g` freeswitch src 38 | ``` 39 | use home brew to install dependencies 40 | ``` 41 | brew install autoconf automake curl ffmpeg jpeg ldns libpq libsndfile libtiff libtool lua openssl opus pcre pkg-config speex speexdsp sqlite yasm signalwire/homebrew-signalwire/flite signalwire/homebrew-signalwire/libks signalwire/homebrew-signalwire/signalwire-c 42 | ``` 43 | 44 | get the source code 45 | ``` 46 | /usr/local/src 47 | FSfile=$(curl -s https://files.freeswitch.org/freeswitch-releases/ | grep -oE "freeswitch-[0-9]*\.[0-9]*\.[0-9]*\.-release\.tar\.bz2" | tail -n 1) && echo Downloading $FSfile && curl https://files.freeswitch.org/freeswitch-releases/$FSfile | tar -xj && mv ${FSfile/.tar.bz2//} freeswitch 48 | git clone https://stash.freeswitch.org/scm/fs/freeswitch.git 49 | ``` 50 | 51 | run bootstrap 52 | ``` 53 | ./bootstrap.sh 54 | ``` 55 | bootrap screen for fresswitch ![bootrap_screen_for_fresswitch](screenshots/bootstarp_freeswitch.png) 56 | 57 | run configure 58 | ``` 59 | ./configure 60 | ``` 61 | configure screen for fresswitch ![configure_screen_for_fresswitch](screenshots/configure_freeswitch.png) 62 | 63 | make text to soeech 64 | ``` 65 | perl -pi -e 's{#asr_tts/mod_flite}{asr_tts/mod_flite}' /usr/local/src/freeswitch/modules.conf 66 | ``` 67 | 68 | compile 69 | ``` 70 | make 71 | ``` 72 | make screen for fresswitch ![make_screen_for_fresswitch](screenshots/make_freeswitch.png) 73 | 74 | install 75 | ``` 76 | make install 77 | ``` 78 | install screen for fresswitch ![install_screen_for_fresswitch](screenshots/make_install_freeswitch.png) 79 | 80 | download and install sounds 81 | ``` 82 | make cd-sounds-install cd-moh-install 83 | ``` 84 | 85 | remove tenporary files that are not required afetr make 86 | ``` 87 | make clean 88 | ``` 89 | 90 | start freeswitch 91 | ``` 92 | cd /usr/local/freeswitch/bin 93 | ./freeswitch 94 | ``` 95 | run screen for fresswitch ![run_screen_for_fresswitch](screenshots/run_freeswitch.png) 96 | 97 | 98 | ## Command Line cli - fs_cli 99 | 100 | Viewing preset freeswitch variables by fs_cli eval $${variable}. Can view value of 101 | hostname 102 | local_ip_v4 103 | local_mask_v4 104 | local_ip_v6 105 | switch_serial 106 | base_dir 107 | recordings_dir 108 | sound_prefix 109 | sounds_dir 110 | conf_dir 111 | log_dir 112 | run_dir 113 | db_dir 114 | mod_dir 115 | htdocs_dir 116 | script_dir 117 | temp_dir 118 | grammar_dir 119 | certs_dir 120 | storage_dir 121 | cache_dir 122 | core_uuid 123 | zrtp_enabled 124 | nat_public_addr 125 | nat_private_addr 126 | nat_type 127 | 128 | ## Sofia 129 | Sofia is a SIP stack used by FreeSWITCH. 130 | 131 | Reload all xml 132 | ```sh 133 | sofia profile external rescan reloadxml 134 | ``` 135 | 136 | recover calls that were up, after crashing (or other scenarios) 137 | ```sh 138 | sofia recover 139 | ``` 140 | 141 | sofis status 142 | ``` 143 | sofia status profile internal 144 | ================================================================================================= 145 | Name internal 146 | Domain Name N/A 147 | Auto-NAT false 148 | DBName sofia_reg_internal 149 | Pres Hosts x.x.x.x,x.x.x.x 150 | Dialplan XML 151 | Context public 152 | Challenge Realm auto_from 153 | RTP-IP x.x.x.x 154 | Ext-RTP-IP y.y.y.y 155 | SIP-IP x.x.x.x 156 | Ext-SIP-IP y.y.y.y 157 | URL sip:mod_sofia@y.y.y.y:5060 158 | BIND-URL sip:mod_sofia@y.y.y.y:5060;maddr=x.x.x.x;transport=udp,tcp 159 | WS-BIND-URL sip:mod_sofia@x.x.x.x:5066;transport=ws 160 | WSS-BIND-URL sips:mod_sofia@x.x.x.x:7443;transport=wss 161 | HOLD-MUSIC local_stream://moh 162 | OUTBOUND-PROXY N/A 163 | CODECS IN PCMU,PCMA 164 | CODECS OUT PCMU,PCMA 165 | TEL-EVENT 101 166 | DTMF-MODE rfc2833 167 | CNG 13 168 | SESSION-TO 0 169 | MAX-DIALOG 0 170 | NOMEDIA false 171 | LATE-NEG true 172 | PROXY-MEDIA false 173 | ZRTP-PASSTHRU true 174 | AGGRESSIVENAT false 175 | CALLS-IN 0 176 | FAILED-CALLS-IN 0 177 | CALLS-OUT 0 178 | FAILED-CALLS-OUT 0 179 | REGISTRATIONS 0 180 | ``` 181 | 182 | ## debuging in dev mode 183 | 184 | Turn sip trace on on selected profile or global 185 | ``` 186 | >sofia profile internal siptrace on 187 | Enabled sip debugging on internal 188 | ``` 189 | 190 | **tcpdump** 191 | 192 | taking traffic dumps using tcpdump 193 | 194 | 195 | > tcpdump -h 196 | 197 | tcpdump version 4.9.2 198 | libpcap version 1.5.3 199 | OpenSSL 1.0.1f 6 Jan 2014 200 | Usage: tcpdump [-aAbdDefhHIJKlLnNOpqStuUvxX#] 201 | [ -B size ] 202 | [ -c count ] 203 | [ -C file_size ] 204 | [ -E algo:secret ] 205 | [ -F file ] 206 | [ -G seconds ] 207 | [ -i interface ] 208 | [ -j tstamptype ] 209 | [ -M secret ] 210 | [ --number ] 211 | [ -Q in|out|inout ] 212 | [ -r file ] 213 | [ -s snaplen ] 214 | [ --time-stamp-precision precision ] 215 | [ --immediate-mode ] 216 | [ -T type ] 217 | [ --version ] 218 | [ -V file ] 219 | [ -w file ] 220 | [ -W filecount ] 221 | [ -y datalinktype ] 222 | [ -z postrotate-command ] 223 | [ -Z user ] 224 | [ expression ] 225 | 226 | 227 | usage 228 | 229 | 230 | tcpdump -s 0 udp port 5080 -w /home/ubuntu/fs_pbx1.pcap 231 | 232 | 233 | **ref** 234 | - https://freeswitch.org/confluence/display/FREESWITCH/macOS+Manual+Installation 235 | - https://freeswitch.org/confluence/display/FREESWITCH/macOS+Testing+and+Diagnostics 236 | -------------------------------------------------------------------------------- /codecs.txt: -------------------------------------------------------------------------------- 1 | 2 | codecname[@8000h|16000h|32000h[@XXi]] 3 | 4 | XX is the frame size must be multples allowed for the codec 5 | FreeSWITCH can support 10-120ms on some codecs. 6 | We do not support exceeding the MTU of the RTP packet. 7 | 8 | 9 | iLBC@30i - iLBC using mode=30 which will win in all cases. 10 | DVI4@8000h@20i - IMA ADPCM 8kHz using 20ms ptime. (multiples of 10) 11 | DVI4@16000h@40i - IMA ADPCM 16kHz using 40ms ptime. (multiples of 10) 12 | speex@8000h@20i - Speex 8kHz using 20ms ptime. 13 | speex@16000h@20i - Speex 16kHz using 20ms ptime. 14 | speex@32000h@20i - Speex 32kHz using 20ms ptime. 15 | BV16 - BroadVoice 16kb/s narrowband, 8kHz 16 | BV32 - BroadVoice 32kb/s wideband, 16kHz 17 | G7221@16000h - G722.1 16kHz (aka Siren 7) 18 | G7221@32000h - G722.1C 32kHz (aka Siren 14) 19 | CELT@32000h - CELT 32kHz, only 10ms supported 20 | CELT@48000h - CELT 48kHz, only 10ms supported 21 | GSM@40i - GSM 8kHz using 40ms ptime. (GSM is done in multiples of 20, Default is 20ms) 22 | G722 - G722 16kHz using default 20ms ptime. (multiples of 10) 23 | PCMU - G711 8kHz ulaw using default 20ms ptime. (multiples of 10) 24 | PCMA - G711 8kHz alaw using default 20ms ptime. (multiples of 10) 25 | G726-16 - G726 16kbit adpcm using default 20ms ptime. (multiples of 10) 26 | G726-24 - G726 24kbit adpcm using default 20ms ptime. (multiples of 10) 27 | G726-32 - G726 32kbit adpcm using default 20ms ptime. (multiples of 10) 28 | G726-40 - G726 40kbit adpcm using default 20ms ptime. (multiples of 10) 29 | AAL2-G726-16 - Same as G726-16 but using AAL2 packing. (multiples of 10) 30 | AAL2-G726-24 - Same as G726-24 but using AAL2 packing. (multiples of 10) 31 | AAL2-G726-32 - Same as G726-32 but using AAL2 packing. (multiples of 10) 32 | AAL2-G726-40 - Same as G726-40 but using AAL2 packing. (multiples of 10) 33 | LPC - LPC10 using 90ms ptime (only supports 90ms at this time in FreeSWITCH) 34 | L16 - L16 isn't recommended for VoIP but you can do it. L16 can exceed the MTU rather quickly. 35 | 36 | These are the passthru audio codecs: 37 | 38 | G729 - G729 in passthru mode. (mod_g729) 39 | G723 - G723.1 in passthru mode. (mod_g723_1) 40 | AMR - AMR in passthru mode. (mod_amr) 41 | 42 | These are the passthru video codecs: (mod_h26x) 43 | 44 | H261 - H.261 Video 45 | H263 - H.263 Video 46 | H263-1998 - H.263-1998 Video 47 | H263-2000 - H.263-2000 Video 48 | H264 - H.264 Video 49 | 50 | RTP Dynamic Payload Numbers currently used in FreeSWITCH and their purpose. 51 | 52 | 96 - AMR 53 | 97 - iLBC (30) 54 | 98 - iLBC (20) 55 | 99 - Speex 8kHz, 16kHz, 32kHz 56 | 100 - 57 | 101 - telephone-event 58 | 102 - 59 | 103 - 60 | 104 - 61 | 105 - 62 | 106 - BV16 63 | 107 - G722.1 (16kHz) 64 | 108 - 65 | 109 - 66 | 110 - 67 | 111 - 68 | 112 - 69 | 113 - 70 | 114 - CELT 32kHz, 48kHz 71 | 115 - G722.1C (32kHz) 72 | 116 - 73 | 117 - SILK 8kHz 74 | 118 - SILK 12kHz 75 | 119 - SILK 16kHz 76 | 120 - SILK 24kHz 77 | 121 - AAL2-G726-40 && G726-40 78 | 122 - AAL2-G726-32 && G726-32 79 | 123 - AAL2-G726-24 && G726-24 80 | 124 - AAL2-G726-16 && G726-16 81 | 125 - 82 | 126 - 83 | 127 - BV32 -------------------------------------------------------------------------------- /dialplan_authcheck.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_Securecall_musiconhold.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_bridge_or_voicemail.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_conf_with_user.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_debugcall.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_delay_echo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_earlymedia.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_eavesdrop.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_groupconf_bridge.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_groupdial.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_park_unpark.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_playback_music.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_postanswer_ringtone.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_redial.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_ringready_playback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_transfer_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_unloop.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_videoplayback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dialplan_common/dialplan_videorecord.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dialplan_common/readme.md: -------------------------------------------------------------------------------- 1 | # Freeswitch Dialplan actions 2 | 3 | These snippets and descriptions are learned from https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools. 4 | Below is my grouping of the dialplan actions and snippets based on usage and common cases. 5 | 6 | ## Call Management 7 | 8 | - pickup - Pickup a call. 9 | - hangup - Hang up the current channel. 10 | - hold - Send a hold message. 11 | - park - Park a call. 12 | - park_state - Park State. 13 | - deflect - Send a call deflect/refer. 14 | - early_hangup - Enable early hangup on a channel. 15 | - pre_answer - Answer a channel in early media mode. 16 | - redirect - Send a redirect message to a session. 17 | - respond - Send a respond message to a session. 18 | - transfer - Immediately transfer the calling channel to a new extension. 19 | - unhold - Send a un-hold message. 20 | 21 | ### Answer 22 | Answer the call for a channel. 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ## att_xfer Attended Transfer. 34 | 35 | - bgsystem — Execute an operating system command in the background. 36 | 37 | - bind_digit_action - Bind a key sequence or regex to an action. 38 | 39 | 40 | ## Break 41 | 42 | Cancel an application currently running on the channel. 43 | Dialplan execution proceeds to the next application. Optionally clears all unprocessed events (queued applications) on the channel. 44 | but can't break an endless_playback 45 | ```xml 46 | 47 | ``` 48 | 49 | check_acl - Check originating address against an Access Control List 50 | clear_digit_action - Clear all digit bindings 51 | clear_speech_cache - Clear speech handle cache. 52 | digit_action_set_realm - Change binding realm. 53 | displace_session - Displace audio on a channel. 54 | 55 | 56 | ## DTMF 57 | 58 | - send_dtmf - Send inband DTMF, 2833, or SIP Info digits from a session. 59 | - start_dtmf - Start inband DTMF detection. 60 | - stop_dtmf - Stop inband DTMF detection. 61 | - start_dtmf_generate - Start inband DTMF generation. 62 | - stop_dtmf_generate - Stop inband DTMF generation. 63 | - bind_meta_app - Respond to certain DTMF sequences on specified call leg(s) during a bridge and execute another dialplan application. 64 | - block_dtmf - Block DTMFs from being sent or received on the channel. 65 | - flush_dtmf - Flush any queued DTMF. 66 | - queue_dtmf - Send DTMF digits after a successful bridge. 67 | 68 | ## Echo 69 | Echo audio and video back to the originator, including voice, DTMF, etc. 70 | Places the calling channel in loopback mode. 71 | Mostly used to test delay in path 72 | ```xml 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | ``` 82 | 83 | Example to eavesdrop on extension 1001 , dial 881001 84 | ```xml 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | ``` 100 | 101 | - delay_echo - Echo audio at a specified delay. 102 | 103 | # API 104 | - httapi - Send call control to a Web server with the HTTAPI infrastructure 105 | 106 | # Playback 107 | 108 | - endless_playback - Continuously play file to caller.[old wiki] 109 | - page - Play an audio file as a page. 110 | - loop_playback - Playback a file to the channel looply for limted times 111 | - play_and_detect_speech - Play while doing speech recognition. 112 | - play_and_get_digits - Play and get Digits. 113 | - play_fsv - Play an FSV file. FSV - (FS Video File Format) additional description needed 114 | - playback - Play a sound file to the originator. 115 | - speak - Speaks a string or file of text to the channel using the defined TTS engine. 116 | 117 | ## Call Queue 118 | fifo - Send caller to a FIFO queue. 119 | fifo_track_call - Count a call as a FIFO call in the manual_calls queue. 120 | 121 | 122 | # Group 123 | 124 | group - Insert or delete members in a group. 125 | 126 | ### info 127 | Display Call Info. 128 | 129 | 130 | EXECUTE sofia/external/6666666666@6.6.6.6 info() 131 | 2019-09-05 10:26:54.718507 [INFO] mod_dptools.c:1806 CHANNEL_DATA: 132 | Channel-State: [CS_EXECUTE] 133 | Channel-Call-State: [RINGING] 134 | Channel-State-Number: [4] 135 | Channel-Name: [sofia/external/6666666666@6.6.6.6] 136 | Unique-ID: [4061d7a4-2a61-4ab2-a998-13d9425fe3c2] 137 | Call-Direction: [inbound] 138 | Presence-Call-Direction: [inbound] 139 | Channel-HIT-Dialplan: [true] 140 | Channel-Call-UUID: [4061d7a4-2a61-4ab2-a998-13d9425fe3c2] 141 | Answer-State: [ringing] 142 | Caller-Direction: [inbound] 143 | Caller-Logical-Direction: [inbound] 144 | Caller-Username: [6666666666] 145 | Caller-Dialplan: [XML] 146 | Caller-Caller-ID-Name: [6666666666] 147 | Caller-Caller-ID-Number: [6666666666] 148 | Caller-Orig-Caller-ID-Name: [6666666666] 149 | Caller-Orig-Caller-ID-Number: [6666666666] 150 | Caller-Network-Addr: [5.5.5.5] 151 | Caller-ANI: [6666666666] 152 | Caller-Destination-Number: [18552702852] 153 | Caller-Unique-ID: [4061d7a4-2a61-4ab2-a998-13d9425fe3c2] 154 | Caller-Source: [mod_sofia] 155 | Caller-Context: [public] 156 | Caller-Channel-Name: [sofia/external/6666666666@6.6.6.6] 157 | Caller-Profile-Index: [1] 158 | Caller-Profile-Created-Time: [1567679214718507] 159 | Caller-Channel-Created-Time: [1567679214718507] 160 | Caller-Channel-Answered-Time: [0] 161 | Caller-Channel-Progress-Time: [0] 162 | Caller-Channel-Progress-Media-Time: [0] 163 | Caller-Channel-Hangup-Time: [0] 164 | Caller-Channel-Transfer-Time: [0] 165 | Caller-Channel-Resurrect-Time: [0] 166 | Caller-Channel-Bridged-Time: [0] 167 | Caller-Channel-Last-Hold: [0] 168 | Caller-Channel-Hold-Accum: [0] 169 | Caller-Screen-Bit: [true] 170 | Caller-Privacy-Hide-Name: [false] 171 | Caller-Privacy-Hide-Number: [false] 172 | variable_direction: [inbound] 173 | variable_uuid: [4061d7a4-2a61-4ab2-a998-13d9425fe3c2] 174 | variable_session_id: [143] 175 | variable_sip_from_user: [6666666666] 176 | variable_sip_from_uri: [6666666666@6.6.6.6] 177 | variable_sip_from_host: [6.6.6.6] 178 | variable_video_media_flow: [disabled] 179 | variable_audio_media_flow: [disabled] 180 | variable_text_media_flow: [disabled] 181 | variable_channel_name: [sofia/external/6666666666@6.6.6.6] 182 | variable_sip_call_id: [99140NTQ4OWE1MGVlZjk0ZWU4YzI5NDAyMmIxYjdmNjdlOWQ] 183 | variable_sip_local_network_addr: [7.7.7.7] 184 | variable_sip_network_ip: [5.5.5.5] 185 | variable_sip_network_port: [5060] 186 | variable_sip_invite_stamp: [1567679214718507] 187 | variable_sip_received_ip: [5.5.5.5] 188 | variable_sip_received_port: [5060] 189 | variable_sip_via_protocol: [udp] 190 | variable_sip_authorized: [true] 191 | variable_Event-Name: [REQUEST_PARAMS] 192 | variable_Core-UUID: [11422524-b611-4ece-8042-c5716846e852] 193 | variable_FreeSWITCH-Hostname: [ip-10-130-74-15] 194 | variable_FreeSWITCH-Switchname: [ip-10-130-74-15] 195 | variable_FreeSWITCH-IPv4: [8.8.8.8] 196 | variable_FreeSWITCH-IPv6: [fe80::a9:33ff:feb3:2da0] 197 | variable_Event-Date-Local: [2019-09-05 10:26:54] 198 | variable_Event-Date-GMT: [Thu, 05 Sep 2019 10:26:54 GMT] 199 | variable_Event-Date-Timestamp: [1567679214718507] 200 | variable_Event-Calling-File: [sofia.c] 201 | variable_Event-Calling-Function: [sofia_handle_sip_i_invite] 202 | variable_Event-Calling-Line-Number: [10302] 203 | variable_Event-Sequence: [3174] 204 | variable_sip_number_alias: [2222222222] 205 | variable_sip_auth_username: [2222222222] 206 | variable_sip_auth_realm: [8.8.8.8] 207 | variable_number_alias: [2222222222] 208 | variable_requested_user_name: [2222222222] 209 | variable_requested_domain_name: [8.8.8.8] 210 | variable_user_name: [2222222222] 211 | variable_domain_name: [8.8.8.8] 212 | variable_sip_from_user_stripped: [6666666666] 213 | variable_sip_from_tag: [253cab72] 214 | variable_sofia_profile_name: [external] 215 | variable_sofia_profile_url: [sip:mod_sofia@7.7.7.7:5080] 216 | variable_recovery_profile_name: [external] 217 | variable_sip_full_via: [SIP/2.0/UDP 5.5.5.5:5060;branch=z9hG4bK6312.8f93f8fc5e3fcdcb1f3f52e73313710b.1.cs1] 218 | variable_sip_full_from: [;tag=253cab72] 219 | variable_sip_full_to: [] 220 | variable_sip_allow: [INVITE, ACK, CANCEL, BYE, UPDATE] 221 | variable_sip_req_user: [18552702852] 222 | variable_sip_req_port: [5080] 223 | variable_sip_req_uri: [18552702852@8.8.8.8:5080] 224 | variable_sip_req_host: [8.8.8.8] 225 | variable_sip_to_user: [18552702852] 226 | variable_sip_to_port: [5080] 227 | variable_sip_to_uri: [18552702852@8.8.8.8:5080] 228 | variable_sip_to_host: [8.8.8.8] 229 | variable_sip_contact_user: [abc] 230 | variable_sip_contact_uri: [abc@5.5.5.5] 231 | variable_sip_contact_host: [5.5.5.5] 232 | variable_rtp_use_codec_string: [PCMU,PCMA] 233 | variable_sip_user_agent: [trunk_privider1] 234 | variable_sip_via_host: [5.5.5.5] 235 | variable_sip_via_port: [5060] 236 | variable_max_forwards: [66] 237 | variable_switch_r_sdp: [v=0 238 | o=- 1567679214883751 1 IN IP4 3.92.94.37 239 | s=X-Lite release 5.6.1 stamp 99140 240 | c=IN IP4 3.92.94.37 241 | t=0 0 242 | m=audio 10026 RTP/AVP 0 243 | a=rtpmap:0 PCMU/8000 244 | ] 245 | variable_ep_codec_string: [CORE_PCM_MODULE.PCMU@8000h@20i@64000b] 246 | variable_endpoint_disposition: [DELAYED NEGOTIATION] 247 | variable_call_uuid: [4061d7a4-2a61-4ab2-a998-13d9425fe3c2] 248 | variable_current_application: [info] 249 | 250 | 251 | # IVR 252 | - ivr - Run an IVR menu. 253 | - phrase - Say a Phrase. 254 | 255 | # Rate Limiter and Thread management 256 | - mutex - Block on a call flow, allowing only one at a time 257 | - sleep - Pause a channel. 258 | - system - Execute an operating system command. 259 | - limit - Set a limit on number of calls to/from a resource 260 | - limit_execute - Set the limit on a specific application 261 | - limit_hash - Set a limit on number of calls to/from a resource 262 | - limit_hash_execute - Set the limit on a specific application 263 | 264 | # Programming suport 265 | - lua - Run a Lua script from the dialplan [API link] 266 | - javascript - Run a JavaScript script from the dialplan 267 | - erlang - Handle a call using Erlang. 268 | 269 | # Read 270 | Read Digits. 271 | > read 272 | 273 | min = Minimum number of digits to fetch. 274 | max = Maximum number of digits to fetch. 275 | sound file = Sound file to play before digits are fetched. 276 | variable name = Channel variable that digits should be placed in. 277 | timeout = Number of milliseconds to wait on each digit 278 | terminators = Digits used to end input if less than digits have been pressed. (Typically '#') 279 | ```xml 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | ``` 290 | 291 | 292 | # Record 293 | Record a file from the channel's input. 294 | 295 | - record,Record File, [] [] [] 296 | time_limit_secs - (optional) is the maximum duration of the recording in seconds. 297 | 298 | ```xml 299 | 300 | 301 | 302 | ``` 303 | 304 | - record_fsv - Record a FSV file. FSV - (FS Video File Format) additional description needed 305 | - record_session - Record Session. 306 | - stop_record_session - Stop Record Session. 307 | 308 | 309 | # ring_ready 310 | Indicate Ring_Ready on a channel by senidng an 180 Ringing to be sent to the originator. 311 | 312 | ### say 313 | Say time/date/ip_address/digits/etc. With pre-recorded prompts. 314 | can also spell out alpha-numeric text, including punctuation marks. 315 | - say [:] [gender] 316 | 317 | Say type is one of the following 318 | NUMBER 319 | ITEMS 320 | PERSONS 321 | MESSAGES 322 | CURRENCY 323 | TIME_MEASUREMENT 324 | CURRENT_DATE 325 | CURRENT_TIME 326 | CURRENT_DATE_TIME 327 | TELEPHONE_NUMBER 328 | TELEPHONE_EXTENSION 329 | URL 330 | IP_ADDRESS 331 | EMAIL_ADDRESS 332 | POSTAL_ADDRESS 333 | ACCOUNT_NUMBER 334 | NAME_SPELLED 335 | NAME_PHONETIC 336 | SHORT_DATE_TIME 337 | Say method is one of the following ( 338 | pronounced 339 | iterated 340 | counted 341 | Say gender 342 | FEMININE 343 | MASCULINE 344 | NEUTER 345 | Examples: 346 | ```xml 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | ``` 357 | 358 | A transcript of the pre-recorded files - https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse/docs/phrase/phrase_en.xml 359 | 360 | send_display - Sends an info packet with a sipfrag. 361 | 362 | send_info - Send info to the endpoint. 363 | 364 | # Channel Variables 365 | - set - Set a channel variable for the channel calling the application. 366 | - capture - Capture data into a channel variable. 367 | - multiset - Set multiple channel variables with a single action. 368 | - unset - Unset a variable. 369 | 370 | set_audio_level - Adjust the read or write audio levels for a channel. 371 | set_global - Set a global variable. 372 | set_name - Name the channel. 373 | set_profile_var - Set a caller profile variable. 374 | set_user - Set a user. 375 | set_zombie_exec - Sets the zombie execution flag on the current channel. 376 | 377 | socket - Establish an outbound socket connection. 378 | 379 | stop_displace_session - Stop displacement audio on a channel. 380 | 381 | 382 | three_way - Three way call with a UUID. 383 | 384 | translate - Number translation. 385 | 386 | unbind_meta_app - Unbind a key from an application. 387 | 388 | 389 | ## Bridge call 390 | Used for MCU ( mixer) in media plane 391 | 392 | - bridge - Bridge a new channel to the existing one. 393 | - bridge_export - Export a channel variable across any bridge. 394 | - export - Export a channel variable across a bridge = 395 | - soft_hold - Put a bridged channel on hold. 396 | - conference - Establish an inbound or outbound conference call 397 | 398 | ## Schedule Events 399 | 400 | sched_broadcast - Enable Scheduled Broadcast. 401 | sched_cancel - Cancel a scheduled future broadcast/transfer. 402 | sched_hangup - Enable Scheduled Hangup. 403 | sched_heartbeat - Enable Scheduled Heartbeat. Additional information needed 404 | sched_transfer - Enable Scheduled Transfer. 405 | 406 | ## Lawful Interception/ Call barge 407 | 408 | - intercept - Lets you pickup a call and take it over if you know the uuid. 409 | - privacy - Set caller privacy on calls. 410 | - userspy - Provides persistent eavesdrop on all channels bridged to a certain user using eavesdrop. 411 | 412 | ### eavesdrop 413 | Spy on a channel / barge 414 | ```xml 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | ``` 425 | 426 | ## Logs and Verbose Events 427 | - verbose_events - Make ALL Events verbose (Make all variables appear in every single event for this channel). 428 | - log - Logs a channel variable for the channel calling the application 429 | - session_loglevel - Override the system's loglevel for this channel. 430 | 431 | ## Error Resilience and Anlytics 432 | 433 | - cng_plc - Packet Loss Concealment on lost packets + comfort noise generation 434 | - sound_test - Analyze Audio. 435 | - jitterbuffer - Send a jitter buffer message to a session 436 | 437 | ## Wait 438 | 439 | - wait_for_silence - Pause processing while waiting for silence on the channel. 440 | 441 | 442 | wait_for_silence [] 443 | 444 | - wait_for_answer - Pause processing while waiting for the call to be answered. 445 | 446 | ## Tone Detect and Silence Detect 447 | 448 | - tone_detect - Detect the presence of a tone and execute a command if found. 449 | - detect_speech - Implements speech recognition. 450 | - stop_tone_detect - Stop detecting tones. 451 | - gentones - Generate TGML tones. 452 | - silence_thresh - (optional) is the energy level below which is considered silence. 453 | - silence_hits - (optional) is how many seconds of audio below silence_thresh will be tolerated before the recording stops. default is 3 seconds. 454 | 455 | ## Chat and Presence 456 | - chat - Send a text message to a IM client. 457 | - presence - Send Presence. 458 | 459 | ## Time 460 | - strftime - Returns formatted date and time. 461 | - strepoch - Returns the date/time as a UNIX epoch (seconds elapsed since midnight UTC, January 1, 1970). 462 | - strftime - Returns formatted date and time. 463 | - strftime_tz - Returns formatted date and time in the timezone specified. 464 | 465 | # Media management 466 | - media_reset - Reset all bypass/proxy media flags. 467 | - remove_bugs - Remove media bugs. 468 | - enable_heartbeat - Enable Media Heartbeat. 469 | 470 | Others 471 | - rxfax - Receive a fax as a tif file. 472 | - fax_detect - Detect FAX CNG - may be deprecated. 473 | - db - insert information into the database. 474 | - recovery_refresh - Send a recovery refresh. addition information needed 475 | - regex - Perform a regex. 476 | - rename - Rename file. 477 | - mkdir - Create a directory. 478 | - preprocess - description needed 479 | - eval - Evaluates a string. 480 | - event - Fire an event. 481 | - execute_extension - Execute an extension from within another extension and return. 482 | - enum - Perform E.164 lookup. 483 | - hash - Add a hash to the db. 484 | 485 | ## Debugging 486 | 487 | **Issue1** 404 not found on destination 488 | Dialplan: sofia/internal/2222222222@x.x.x.x parsing [public->universalinboundcalls] continue=false 489 | Dialplan: sofia/internal/2222222222@x.x.x.x Regex (FAIL) [universalinboundcalls] destination_number(987654321) =~ /^8888888888$/ break=on-false 490 | [INFO] switch_core_state_machine.c:311 No Route, Aborting 491 | [NOTICE] switch_core_state_machine.c:312 Hangup sofia/internal/2222222222@x.x.x.x [CS_ROUTING] [NO_ROUTE_DESTINATION] 492 | 493 | **Solution** Add visible on sample snippet the deatination is unmatched to any condition ind dialplan. To fix this wither add a wildcard or add a matching extension for same detsination number such as 494 | 495 | ```xml 496 | 497 | 498 | 499 | 500 | ... 501 | 502 | 503 | 504 | 505 | ``` -------------------------------------------------------------------------------- /dialplan_common/tone_detect.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dialplan_transfer_extension.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gateways/README.md: -------------------------------------------------------------------------------- 1 | # Gateways in freeswitch 2 | 3 | 4 | Gateways can be defined with inside profile or in directory 5 | 6 | Barebone outbound call gateway with no usrename / pasword 7 | ```xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | ``` 18 | 19 | Define a gateway 20 | ```xml 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | ``` 37 | 38 | ## gateway status 39 | 40 | sofia profile external gwlist up 41 | ```sh 42 | sipcall_41449999990 43 | ``` 44 | sofia profile external gwlist down 45 | ```sh 46 | x.x.x.x voxbeam_outbound 47 | ``` 48 | ## debugging 49 | 50 | **Isuee1** freeswitch hanging up, cause: INCOMPATIBLE_DESTINATION 51 | **Solution** most often the fault lies in codec list , check for matching codecs 52 | 53 | -------------------------------------------------------------------------------- /ivr/README.md: -------------------------------------------------------------------------------- 1 | # IVR - Interactive Voice Response 2 | 3 | FreeSWITCH IVRs can be written in any language that FreeSWITCH supports including JavaScript, Python, Perl, Lua and an XML macro format. 4 | IVR is more than an automatic attendant as it not only performs rudimentary call routing but also interacts with callers, gathers information and makes decision. 5 | 6 | include action plan 7 | ``` 8 | 9 | ``` 10 | 11 | Freeswitch includes many dialplans that we dont need for IVR, we can remove those before making new dial plan 12 | ``` 13 | $ rm -rf /etc/freeswitch/dialplan/default/ 14 | $ rm -rf /etc/freeswitch/dialplan/skinny-patterns* 15 | $ rm /etc/freeswitch/dialplan/features.xml 16 | ``` 17 | 18 | Logs Output 19 | ``` 20 | EXECUTE sofia/internal/2222222222@x.x.x.x ivr(demo_ivr) 21 | switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-exit' 22 | switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-sub' 23 | switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-exec-app' 24 | switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-play-sound' 25 | switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-back' 26 | switch_ivr_menu.c:743 switch_ivr_menu_stack_xml_add binding 'menu-top' 27 | switch_ivr_menu.c:880 building menu 'demo_ivr' 28 | switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '1' 29 | switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '2' 30 | switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '3' 31 | switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '4' 32 | switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '5' 33 | switch_ivr_menu.c:880 building menu 'demo_ivr_submenu' 34 | switch_ivr_menu.c:964 binding menu action 'menu-top' to '*' 35 | switch_ivr_menu.c:964 binding menu action 'menu-sub' to '6' 36 | switch_ivr_menu.c:964 binding menu action 'menu-exec-app' to '/^(10[01][0-9])$/' 37 | switch_ivr_menu.c:964 binding menu action 'menu-top' to '9' 38 | switch_ivr_menu.c:483 Executing IVR menu demo_ivr 39 | switch_ivr_play_say.c:70 No language specified - Using [en] 40 | switch_ivr_play_say.c:250 Handle play-file:[ivr/ivr-welcome_to_freeswitch.wav] (en:en) 41 | switch_ivr_play_say.c:1498 Codec Activated L16@8000hz 1 channels 20ms 42 | ``` -------------------------------------------------------------------------------- /ivr/demo_ivr.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 63 | -------------------------------------------------------------------------------- /ivr/dialplan_IVR.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /pbx_configurations/README.md: -------------------------------------------------------------------------------- 1 | #PBX freeswitch Configuration 2 | 3 | ## Preprocessor Variables in vars.xml 4 | 5 | These variables are important because configuration strings must be consistent across modules. 6 | 7 | 8 | The following variables are set dynamically - calculated if possible by freeswitch - and are available to the config as $${variable}. Can be checkd from fs_cli by cmd eval $${variable} 9 | 10 | hostname 11 | local_ip_v4 12 | local_mask_v4 13 | local_ip_v6 14 | switch_serial 15 | base_dir 16 | recordings_dir 17 | sound_prefix 18 | sounds_dir 19 | conf_dir 20 | log_dir 21 | run_dir 22 | db_dir 23 | mod_dir 24 | htdocs_dir 25 | script_dir 26 | temp_dir 27 | grammar_dir 28 | certs_dir 29 | storage_dir 30 | cache_dir 31 | core_uuid 32 | zrtp_enabled 33 | nat_public_addr 34 | nat_private_addr 35 | nat_type 36 | 37 | 38 | **bind_server_ip** 39 | 40 | only used for dialing. Can be an ip address, a dns name, or "auto". 41 | This determines an ip address available on this host to bind. 42 | If you are separating RTP and SIP traffic, you will want to have use different addresses where this variable appears. 43 | Used by: dingaling.conf.xml 44 | ```xml 45 | 46 | ``` 47 | 48 | **external_rtp_ip** 49 | Can be an one of: 50 | ip address: "12.34.56.78" 51 | a stun server lookup: "stun:stun.server.com" 52 | a DNS name: "host:host.server.com" 53 | where fs.mydomain.com is a DNS A record-useful when fs is on 54 | a dynamic IP address, and uses a dynamic DNS updater. 55 | If unspecified, the bind_server_ip value is used. 56 | Used by: sofia.conf.xml dingaling.conf.xml 57 | ```xml 58 | 59 | ``` 60 | 61 | **external_sip_ip** 62 | Used as the public IP address for SDP. 63 | Can be an one of: 64 | ip address: "12.34.56.78" 65 | a stun server lookup: "stun:stun.server.com" 66 | a DNS name: "host:host.server.com" 67 | where fs.mydomain.com is a DNS A record-useful when fs is on 68 | a dynamic IP address, and uses a dynamic DNS updater. 69 | If unspecified, the bind_server_ip value is used. 70 | Used by: sofia.conf.xml dingaling.conf.xml 71 | ``` 72 | 73 | ``` 74 | 75 | **SIP and TLS settings** 76 | TLS versions 77 | valid options: sslv2,sslv3,sslv23,tlsv1,tlsv1.1,tlsv1.2 78 | default: tlsv1,tlsv1.1,tlsv1.2 79 | ```xml 80 | 81 | ``` 82 | TLS cipher suite 83 | default ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH 84 | The actual ciphers supported will change per platform. 85 | openssl ciphers -v 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' 86 | Will show what is available in your verion of openssl. 87 | ```xml 88 | 89 | ``` 90 | 91 | **Internal SIP Profile variables** 92 | ```xml 93 | 94 | 95 | 96 | 97 | ``` 98 | 99 | **External SIP Profile varibles** 100 | ```xml 101 | 102 | 103 | 104 | 105 | ```` 106 | 107 | **Video Settings** 108 | Setting the max bandwdith 109 | ```xml 110 | 111 | 112 | ``` 113 | WebRTC Video 114 | Suppress CNG for WebRTC Audio 115 | ```xml 116 | 117 | ``` 118 | Enable liberal DTMF 119 | ```xml 120 | 121 | ``` 122 | Stock Video Avatars 123 | ```xml 124 | 125 | 126 | ``` 127 | 128 | outbound_caller_id and outbound_caller_name 129 | The caller ID telephone number we should use when calling out. 130 | Used by: conference.conf.xml and user directory for default 131 | ```xml 132 | 133 | 134 | ``` 135 | 136 | ## sip profile 137 | 138 | Inject delay between dtmf digits on send to help some slow interpreters (also per channel with rtp_digit_delay var 139 | ```xml 140 | 141 | ``` 142 | When calls are in no media this will bring them back to media when you press the hold button. 143 | ```xml 144 | 145 | ``` 146 | 147 | allow a call after an attended transfer go back to bypass media after an attended transfer. 148 | 149 | 150 | set to "_undef_" to remove the User-Agent header 151 | 152 | 153 | Too see avaiable codecs 154 | ```sh 155 | show codecs 156 | type,name,ikey 157 | codec,G.711 alaw,CORE_PCM_MODULE 158 | codec,G.711 ulaw,CORE_PCM_MODULE 159 | codec,PROXY PASS-THROUGH,CORE_PCM_MODULE 160 | codec,PROXY VIDEO PASS-THROUGH,CORE_PCM_MODULE 161 | codec,RAW Signed Linear (16 bit),CORE_PCM_MODULE 162 | codec,Speex,CORE_SPEEX_MODULE 163 | codec,VP8 Video,CORE_VPX_MODULE 164 | codec,VP9 Video,CORE_VPX_MODULE 165 | ``` 166 | 167 | ### watchdogs 168 | 169 | 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 crash immediately. 170 | ```xml 171 | 172 | 173 | 174 | ``` 175 | ### TLS 176 | 177 | TLS: disabled by default, set to "true" to enable 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | Location of the agent.pem and cafile.pem ssl certificates (needed for TLS server) --> 187 | 188 | 189 | 190 | 191 | 192 | TLS verify policy, when registering/inviting gateways with other servers (outbound) or handling inbound registration/invite requests how should we verify their certificate 193 | set to 'in' to only verify incoming connections, 'out' to only verify outgoing connections, 'all' to verify all connections, also 'subjects_in', 'subjects_out' and 'subjects_all' for subject validation. Multiple policies can be split with a '|' pipe 194 | 195 | 196 | Certificate max verify depth to use for validating peer TLS certificates when the verify policy is not none 197 | 198 | 199 | If the tls-verify-policy is set to subjects_all or subjects_in this sets which subjects are allowed, multiple subjects can be split with a pipe 200 | ```xml 201 | 202 | ``` 203 | TLS version default: tlsv1,tlsv1.1,tlsv1.2 204 | 205 | 206 | TLS ciphers default: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH 207 | 208 | 209 | ## directory.xml 210 | 211 | When freeswitch gets a register packet it looks for the user in the directory based on the from or to domain in the packet depending on how your sofia profile is configured. 212 | 213 | Out of the box the default domain will be the IP address of the machine running FreeSWITCH. This IP can be found by typing "sofia status" at the CLI. 214 | 215 | You will register your phones to the IP and not the hostname by default. 216 | If you wish to register using the domain please open vars.xml in the root conf directory and set the default domain to the hostname you desire. Then you would use the domain name in the client instead of the IP address to register with FreeSWITCH. 217 | 218 | See users registrations 219 | ```sh 220 | show registrations 221 | ``` 222 | 223 | ## debugging support 224 | -------------------------------------------------------------------------------- /pbx_configurations/dialplan/README.md: -------------------------------------------------------------------------------- 1 | # Dialplans 2 | 3 | When a call arrives at the FreeSWITCH™ PBX, Sofia is the first responder. She gathers information about the call, and decides which dialplan to invoke. 4 | 5 | Sofia passes information about the call to your dialplan inside "channel variables" ( like destination_number , caller-ID , source IP address etc) which dialplan accesses to make decisions about what to do with the call. 6 | 7 | The XML dialplan is organized as a series of extension definitions. FS passes each one looking for a mtaching one for a call using condition. 8 | 9 | When condition(s) for an extension are met, the extension's action definitions (called "actions") are executed. 10 | If the conditions for your extension are not met, there are optional action definitions (called "anti-actions") that can be executed. 11 | 12 | ## deafult dialplan 13 | 14 | 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. 15 | 16 | Authenticated users will use the user_context variable on the user to determine what context they can access. 17 | Add a user in the directory with the cidr= attribute acl.conf.xml will build the domains ACL using this value. 18 | 19 | -------------------------------------------------------------------------------- /pbx_configurations/dialplan/deafult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ... tbd 15 | 16 | -------------------------------------------------------------------------------- /pbx_configurations/dialplan/public.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /pbx_configurations/directory/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /pbx_configurations/freeswitch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 |
8 | 9 |
10 | 11 |
12 | 13 |
14 | 15 |
16 | 17 |
18 | 19 |
20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 | 35 | -------------------------------------------------------------------------------- /pbx_configurations/sip_profiles/README.md: -------------------------------------------------------------------------------- 1 | # Freeswitch SIP profiles 2 | 3 | Vanila ( default ) freeswitch cofiguration has 2 profile , internal for users connected via private ip and external for users connected via public ip network . 4 | 5 | ```sh 6 | > sofia profile internal 7 | 8 | [ register] [ unregister] [ register] [ unregister] 9 | [ killgw] [ startgw] [ siptrace] [ capture] 10 | [ watchdog] [ start] [ rescan] [ restart] 11 | [ check_sync] [ flush_inbound_reg] [ gwlist] [ killgw] 12 | [ startgw] [ stop] 13 | ``` 14 | After making any change in sofia profile 15 | ```sh 16 | fs_cli> sofia profile external restart 17 | ``` 18 | ## status commands 19 | 20 | ```sh 21 | sofia status 22 | Name Type Data State 23 | ================================================================================================= 24 | y.y.y.y alias internal ALIASED 25 | external profile sip:mod_sofia@x.x.x.x:5080 RUNNING (0) 26 | external profile sip:mod_sofia@x.x.x.x:5081 RUNNING (0) (TLS) 27 | external::altanai.com gateway sip:2222222222@altanai.com NOREG 28 | internal profile sip:mod_sofia@x.x.x.x:5060 RUNNING (0) 29 | ================================================================================================= 30 | 2 profiles 1 alias 31 | ``` 32 | 33 | ```sh 34 | sofia status profile internal 35 | ================================================================================================= 36 | Name internal 37 | Domain Name N/A 38 | Auto-NAT false 39 | DBName sofia_reg_internal 40 | Pres Hosts y.y.y.y,y.y.y.y 41 | Dialplan XML 42 | Context public 43 | Challenge Realm auto_from 44 | RTP-IP y.y.y.y 45 | Ext-RTP-IP x.x.x.x 46 | SIP-IP y.y.y.y 47 | Ext-SIP-IP x.x.x.x 48 | URL sip:mod_sofia@x.x.x.x:5060 49 | BIND-URL sip:mod_sofia@x.x.x.x:5060;maddr=y.y.y.y;transport=udp,tcp 50 | WS-BIND-URL sip:mod_sofia@y.y.y.y:5066;transport=ws 51 | WSS-BIND-URL sips:mod_sofia@y.y.y.y:7443;transport=wss 52 | HOLD-MUSIC local_stream://moh 53 | OUTBOUND-PROXY N/A 54 | CODECS IN PCMU,PCMA 55 | CODECS OUT PCMU,PCMA 56 | TEL-EVENT 101 57 | DTMF-MODE rfc2833 58 | CNG 13 59 | SESSION-TO 0 60 | MAX-DIALOG 0 61 | NOMEDIA false 62 | LATE-NEG true 63 | PROXY-MEDIA false 64 | ZRTP-PASSTHRU true 65 | AGGRESSIVENAT false 66 | CALLS-IN 0 67 | FAILED-CALLS-IN 0 68 | CALLS-OUT 0 69 | FAILED-CALLS-OUT 0 70 | REGISTRATIONS 0 71 | ``` 72 | 73 | ```sh 74 | sofia status profile external 75 | ================================================================================================= 76 | Name external 77 | Domain Name N/A 78 | Auto-NAT false 79 | DBName sofia_reg_external 80 | Pres Hosts 81 | Dialplan XML 82 | Context public 83 | Challenge Realm auto_to 84 | RTP-IP y.y.y.y 85 | Ext-RTP-IP x.x.x.x 86 | SIP-IP y.y.y.y 87 | Ext-SIP-IP x.x.x.x 88 | URL sip:mod_sofia@x.x.x.x:5080 89 | BIND-URL sip:mod_sofia@x.x.x.x:5080;maddr=y.y.y.y;transport=udp,tcp 90 | TLS-URL sip:mod_sofia@x.x.x.x:5081 91 | TLS-BIND-URL sips:mod_sofia@x.x.x.x:5081;maddr=y.y.y.y;transport=tls 92 | HOLD-MUSIC local_stream://moh 93 | OUTBOUND-PROXY N/A 94 | CODECS IN PCMU,PCMA 95 | CODECS OUT PCMU,PCMA 96 | TEL-EVENT 101 97 | DTMF-MODE rfc2833 98 | CNG 13 99 | SESSION-TO 0 100 | MAX-DIALOG 0 101 | NOMEDIA false 102 | LATE-NEG true 103 | PROXY-MEDIA false 104 | ZRTP-PASSTHRU true 105 | AGGRESSIVENAT false 106 | CALLS-IN 8 107 | FAILED-CALLS-IN 0 108 | CALLS-OUT 0 109 | FAILED-CALLS-OUT 0 110 | REGISTRATIONS 0 111 | ``` -------------------------------------------------------------------------------- /pbx_configurations/sip_profiles/external.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /pbx_configurations/sip_profiles/external/gw-prod.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /pbx_configurations/sip_profiles/internal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /pbx_configurations/vars.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /playback/README.md: -------------------------------------------------------------------------------- 1 | # Plyback/ Annoucemnt with pre-stored audio files on incoming call 2 | 3 | ## debugging help 4 | 5 | **Issue 1** : Sampling rate related issue such as 6 | [NOTICE] mod_dptools.c:1357 Channel [sofia/external/3333333333@x.x.x.x:5080] has been answered 7 | [DEBUG] switch_channel.c:3781 (sofia/external/3333333333@x.x.x.x:5080) Callstate Change EARLY -> ACTIVE 8 | EXECUTE sofia/external/3333333333@x.x.x.x:5080 playback(/home/ubuntu/PinkPanther30.wav) 9 | 2019-07-31 07:16:59.361747 [DEBUG] switch_core_file.c:358 File /home/ubuntu/PinkPanther30.wav sample rate 22050 doesn't match requested rate 16000 10 | 2019-07-31 07:16:59.361747 [DEBUG] switch_ivr_play_say.c:1498 Codec Activated L16@16000hz 1 channels 20ms 11 | 12 | **Solution** : find the sampling rate of the file u have 13 | file 14 | ``` 15 | file /home/ubuntu/PinkPanther30.wav 16 | /home/ubuntu/PinkPanther30.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 22050 Hz 17 | ``` 18 | or soxi 19 | ``` 20 | >soxi /home/ubuntu/PinkPanther30.wav 21 | 22 | Input File : '/home/ubuntu/PinkPanther30.wav' 23 | Channels : 1 24 | Sample Rate : 22050 25 | Precision : 16-bit 26 | Duration : 00:00:30.00 = 661500 samples ~ 2250 CDDA sectors 27 | File Size : 1.32M 28 | Bit Rate : 353k 29 | Sample Encoding: 16-bit Signed Integer PCM 30 | ``` 31 | 32 | Convert that to other sapling rates and store as same filename under same location , server will auto pick the one which meets the requirnments 33 | 34 | Sox 35 | ``` 36 | >sox -S /home/ubuntu/PinkPanther30.wav /home/ubuntu/PinkPanther30.wav rate -L -s 16000 37 | Input File : '/home/ubuntu/PinkPanther30.wav' 38 | Channels : 1 39 | Sample Rate : 22050 40 | Precision : 16-bit 41 | Duration : 00:00:30.00 = 661500 samples ~ 2250 CDDA sectors 42 | File Size : 0 43 | Bit Rate : 0 44 | Sample Encoding: 16-bit Signed Integer PCM 45 | 46 | In:0.00% 00:00:00.00 [00:00:30.00] Out:0 [ | ] Clip:0 sox WARN wav: Premature EOF on .wav input file 47 | In:0.00% 00:00:00.00 [00:00:30.00] Out:0 [ | ] Clip:0 48 | Done. 49 | 50 | ``` -------------------------------------------------------------------------------- /presence/README.md: -------------------------------------------------------------------------------- 1 | # PResenev handling on Freeswitch 2 | 3 | -- tbd 4 | 5 | ## sip_profiles/external.xml 6 | 7 | as this is outbound registrations to providers 8 | 9 | share presence info across sofia profiles 10 | manage-presence needs to be set to passive on this profile 11 | if you want it to behave as if it were the internal profile 12 | for presence. 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /quickstart/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altanai/freeswitchexamples/f877a239738e7c8704ef49caa946d0cbdf17a2a4/quickstart/README.md -------------------------------------------------------------------------------- /quickstart/freeswitch_simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 |
210 | 211 |
212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 |
225 |
226 | 227 | -------------------------------------------------------------------------------- /screenshots/bootstarp_freeswitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altanai/freeswitchexamples/f877a239738e7c8704ef49caa946d0cbdf17a2a4/screenshots/bootstarp_freeswitch.png -------------------------------------------------------------------------------- /screenshots/configure_freeswitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altanai/freeswitchexamples/f877a239738e7c8704ef49caa946d0cbdf17a2a4/screenshots/configure_freeswitch.png -------------------------------------------------------------------------------- /screenshots/make_freeswitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altanai/freeswitchexamples/f877a239738e7c8704ef49caa946d0cbdf17a2a4/screenshots/make_freeswitch.png -------------------------------------------------------------------------------- /screenshots/make_install_freeswitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altanai/freeswitchexamples/f877a239738e7c8704ef49caa946d0cbdf17a2a4/screenshots/make_install_freeswitch.png -------------------------------------------------------------------------------- /screenshots/run_freeswitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altanai/freeswitchexamples/f877a239738e7c8704ef49caa946d0cbdf17a2a4/screenshots/run_freeswitch.png -------------------------------------------------------------------------------- /secure_sip_tls_srtp/README.md: -------------------------------------------------------------------------------- 1 | # secure RTP / SRTP on TLS with Auth challenge 2 | 3 | ## 1. Gateway for Outbound calls 4 | 5 | create a gateway in external for outbound calls 6 | ```xml 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ``` 19 | Check gateway health after reload mod_sofia and reloadxml 20 | ```sh 21 | sofia status gateway 22 | Profile::Gateway-Name Data State Ping Time IB Calls(F/T) OB Calls(F/T) 23 | ================================================================================================= 24 | external::altanai.com sip:6666666666@altanai.com NOREG 0.00 0/0 0/0 25 | external::securecalls sip:altanai1001@127.0.0.1:5090 NOREG 0.00 0/0 0/0 26 | ================================================================================================= 27 | 2 gateways: Inbound(Failed/Total): 0/0,Outbound(Failed/Total):0/0 28 | ``` 29 | 30 | since we are using th following UAS server at the same machine to receive the outgoing calls , ass the doamin with ip to proxy 31 | Also start sipp uas server on same machine 32 | ```sh 33 | sipp -sn uas -p 5090 34 | ``` 35 | 36 | ## 2. Dialplan specifying rtp secure media 37 | 38 | create dialplan for routig thorugh securecalls gateway 39 | ```xml 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | ``` 56 | ## 3. Generating SSL Certificate 57 | 58 | To use TLS/SSL we need a root (CA) certificate and a certificate for every server. 59 | 60 | 1. Generate the CA (Root) Certificate 61 | 62 | Use script gentls_cert ( /usr/bin/gentls_cert part of source tarball ) 63 | assuming that the DNS name of our FreeSWITCH PBX is pbx.securecompany.com (we can use ip too, just ensure -cn and -alt is same) 64 | ```sh 65 | $gentls_cert setup -cn pbx.securecompany.com -alt DNS:pbx.securecompany.com -org securecompany.com 66 | 67 | Creating new CA... 68 | Generating a 2048 bit RSA private key 69 | .......................+++ 70 | ......................+++ 71 | writing new private key to '/etc/freeswitch/tls/CA/cakey.pem' 72 | ----- 73 | DONE 74 | ``` 75 | 76 | 2. Generate the Server Certificate 77 | 78 | ```sh 79 | $gentls_cert create_server -cn pbx.securecompany.com -alt DNS:pbx.securecompany.com -org securecompany.com 80 | 81 | Generating new certificate... 82 | -------------------------------------------------------- 83 | CN: "pbx.securecompany.com" 84 | ORG_NAME: "securecompany.com" 85 | ALT_NAME: "DNS:pbx.securecompany.com" 86 | 87 | Certificate filename "agent.pem" 88 | 89 | [Is this OK? (y/N)] 90 | y 91 | Generating a 2048 bit RSA private key 92 | ....................................................................+++ 93 | ........+++ 94 | writing new private key to '/tmp/fs-ca-2753-20190924065450.key' 95 | ----- 96 | Signature ok 97 | subject=/CN=pbx.securecompany.com/O=securecompany.com 98 | Getting CA Private Key 99 | DONE 100 | ``` 101 | This server certificate at /etc/freeswitch/tls/agent.pem, contains both the certificate and the private key. 102 | 103 | 3. Verifying cerrtificate 104 | ```sh 105 | openssl x509 -noout -inform pem -text -in /etc/freeswitch/tls/agent.pem 106 | ``` 107 | 108 | 4. File permission 109 | ```sh 110 | cd /etc/freeswitch/tls 111 | chmod 640 agent.pem cafile.pem 112 | ``` 113 | -rw-r----- 1 root root 3091 Jan 24 06:55 agent.pem 114 | drwxr-x--- 2 root root 4096 Jan 24 06:54 CA 115 | -rw-r----- 1 root root 1172 Jan 24 06:52 cafile.pem 116 | 117 | 118 | ## 4. Enable TLS 119 | 120 | In /etc/freeswitch/vars.xml : 121 | ```xml 122 | 123 | 124 | 125 | ``` 126 | In /etc/freeswitch/sip_profiles/external.xml : 127 | ```xml 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | ``` 140 | 141 | ## 5. Make call and check traces and logs 142 | 143 | orignate a call with syntax 144 | originate |&() [] [] [] [] [] 145 | such as 146 | ```sh 147 | originate sofia/123456789 148 | ``` 149 | 150 | ``` 151 | [INFO] mod_dptools.c:1787 Processing for Secure destination 123456789 152 | EXECUTE sofia/internal/altanai@x.x.x.x bridge(sofia/gateway/securecalls/123456789) 153 | [DEBUG] switch_channel.c:1250 sofia/internal/altanai@x.x.x.x EXPORTING[export_vars] [rtp_secure_media]=[true:AES_CM_128_HMAC_SHA1_80] to event 154 | [DEBUG] switch_ivr_originate.c:2159 Parsing global variables 155 | [NOTICE] switch_channel.c:1104 New Channel sofia/external/123456789 [4ce057ed-9800-444b-ac80-c5a50c205333] 156 | [DEBUG] mod_sofia.c:5026 (sofia/external/123456789) State Change CS_NEW -> CS_INIT 157 | [DEBUG] switch_core_state_machine.c:584 (sofia/external/123456789) Running State Change CS_INIT (Cur 2 Tot 33) 158 | [DEBUG] switch_core_state_machine.c:627 (sofia/external/123456789) State INIT 159 | [DEBUG] mod_sofia.c:93 sofia/external/123456789 SOFIA INIT 160 | [DEBUG] switch_core_media.c:1204 Set Local audio crypto Key [5 AES_CM_128_HMAC_SHA1_80 inline:wTBULfstsF7LBv3aTuxW7KxdTw3s/ONfjgEf6LOd] 161 | [DEBUG] switch_core_media.c:1204 Set Local video crypto Key [5 AES_CM_128_HMAC_SHA1_80 inline:cVyBFw0BFJEG8oRHuTixA74aktsYyoxgo6GipBVg] 162 | [DEBUG] switch_core_media.c:1204 Set Local text crypto Key [5 AES_CM_128_HMAC_SHA1_80 inline:b5jcDAtloDW7afqHBvqOUqGnNqtDp9zu2wQi3Knc] 163 | [DEBUG] sofia_glue.c:1299 sofia/external/123456789 sending invite version: 1.9.0 -742-8f1b7e0 64bit 164 | Local SDP: 165 | v=0 166 | o=FreeSWITCH 1569384062 1569384063 IN IP4 x.x.x.x 167 | s=FreeSWITCH 168 | c=IN IP4 x.x.x.x 169 | t=0 0 170 | m=audio 22178 RTP/SAVP 8 0 101 171 | a=rtpmap:8 PCMA/8000 172 | a=rtpmap:0 PCMU/8000 173 | a=rtpmap:101 telephone-event/8000 174 | a=fmtp:101 0-16 175 | a=crypto:5 AES_CM_128_HMAC_SHA1_80 inline:wTBULfstsF7LBv3aTuxW7KxdTw3s/ONfjgEf6LOd 176 | a=ptime:20 177 | a=sendrecv 178 | ``` 179 | 180 | ## SRTP Crypto suites 181 | 182 | When using SRTP it's critical that you do not offer or accept variable bit rate codecs, doing so would leak information and possibly 183 | compromise your SRTP stream. (FS-6404) 184 | 185 | Supported SRTP Crypto Suites: 186 | 187 | AEAD_AES_256_GCM_8 188 | ____________________________________________________________________________ 189 | This algorithm is identical to AEAD_AES_256_GCM (see Section 5.2 of 190 | [RFC5116]), except that the tag length, t, is 8, and an 191 | authentication tag with a length of 8 octets (64 bits) is used. 192 | An AEAD_AES_256_GCM_8 ciphertext is exactly 8 octets longer than its 193 | corresponding plaintext. 194 | 195 | 196 | AEAD_AES_128_GCM_8 197 | ____________________________________________________________________________ 198 | This algorithm is identical to AEAD_AES_128_GCM (see Section 5.1 of 199 | [RFC5116]), except that the tag length, t, is 8, and an 200 | authentication tag with a length of 8 octets (64 bits) is used. 201 | An AEAD_AES_128_GCM_8 ciphertext is exactly 8 octets longer than its 202 | corresponding plaintext. 203 | 204 | 205 | AES_CM_256_HMAC_SHA1_80 | AES_CM_192_HMAC_SHA1_80 | AES_CM_128_HMAC_SHA1_80 206 | ____________________________________________________________________________ 207 | AES_CM_128_HMAC_SHA1_80 is the SRTP default AES Counter Mode cipher 208 | and HMAC-SHA1 message authentication with an 80-bit authentication 209 | tag. The master-key length is 128 bits and has a default lifetime of 210 | a maximum of 2^48 SRTP packets or 2^31 SRTCP packets, whichever comes 211 | first. 212 | 213 | 214 | AES_CM_256_HMAC_SHA1_32 | AES_CM_192_HMAC_SHA1_32 | AES_CM_128_HMAC_SHA1_32 215 | ____________________________________________________________________________ 216 | This crypto-suite is identical to AES_CM_128_HMAC_SHA1_80 except that 217 | the authentication tag is 32 bits. The length of the base64-decoded key and 218 | salt value for this crypto-suite MUST be 30 octets i.e., 240 bits; otherwise, 219 | the crypto attribute is considered invalid. 220 | 221 | 222 | AES_CM_128_NULL_AUTH 223 | ____________________________________________________________________________ 224 | The SRTP default cipher (AES-128 Counter Mode), but to use no authentication 225 | method. This policy is NOT RECOMMENDED unless it is unavoidable; see 226 | Section 7.5 of [RFC3711]. 227 | 228 | 229 | SRTP variables that modify behaviors based on direction/leg: 230 | 231 | rtp_secure_media 232 | ____________________________________________________________________________ 233 | possible values: 234 | mandatory - Accept/Offer SAVP negotiation ONLY 235 | optional - Accept/Offer SAVP/AVP with SAVP preferred 236 | forbidden - More useful for inbound to deny SAVP negotiation 237 | false - implies forbidden 238 | true - implies mandatory 239 | 240 | default if not set is accept SAVP inbound if offered. 241 | 242 | 243 | rtp_secure_media_inbound | rtp_secure_media_outbound 244 | ____________________________________________________________________________ 245 | This is the same as rtp_secure_media, but would apply to either inbound 246 | or outbound offers specifically. 247 | 248 | How to specify crypto suites: 249 | ____________________________________________________________________________ 250 | By default without specifying any crypto suites FreeSWITCH will offer 251 | crypto suites from strongest to weakest accepting the strongest each 252 | endpoint has in common. If you wish to force specific crypto suites you 253 | can do so by appending the suites in a comma separated list in the order 254 | that you wish to offer them in. 255 | 256 | Examples: 257 | 258 | rtp_secure_media=mandatory:AES_CM_256_HMAC_SHA1_80,AES_CM_256_HMAC_SHA1_32 259 | rtp_secure_media=true:AES_CM_256_HMAC_SHA1_80,AES_CM_256_HMAC_SHA1_32 260 | rtp_secure_media=optional:AES_CM_256_HMAC_SHA1_80 261 | rtp_secure_media=true:AES_CM_256_HMAC_SHA1_80 262 | 263 | Additionally you can narrow this down on either inbound or outbound by 264 | specifying as so: 265 | 266 | rtp_secure_media_inbound=true:AEAD_AES_256_GCM_8 267 | rtp_secure_media_inbound=mandatory:AEAD_AES_256_GCM_8 268 | rtp_secure_media_outbound=true:AEAD_AES_128_GCM_8 269 | rtp_secure_media_outbound=optional:AEAD_AES_128_GCM_8 270 | 271 | 272 | rtp_secure_media_suites 273 | ____________________________________________________________________________ 274 | Optionaly you can use rtp_secure_media_suites to dictate the suite list 275 | and only use rtp_secure_media=[optional|mandatory|false|true] without having 276 | to dictate the suite list with the rtp_secure_media* variables. 277 | 278 | ## Rescan and restart profile if changes are made to config xmls without restarting server 279 | ``` 280 | >sofia profile internal restart rescan 281 | Reload XML [Success] 282 | restarting: internal 283 | mod_enum.c:879 ENUM Reloaded 284 | switch_time.c:1423 Timezone reloaded 1750 definitions 285 | sofia.c:3424 Waiting for worker thread 286 | switch_core_sqldb.c:1720 sofia:internal Destroying SQL queue. 287 | switch_core_sqldb.c:1678 sofia:internal Stopping SQL thread. 288 | sofia.c:3479 Write lock internal 289 | sofia.c:3492 Write unlock internal 290 | debug [0] 291 | sip-trace [yes] 292 | sip-capture [yes] 293 | watchdog-enabled [no] 294 | watchdog-step-timeout [30000] 295 | watchdog-event-timeout [30000] 296 | log-auth-failures [false] 297 | forward-unsolicited-mwi-notify [false] 298 | context [public] 299 | rfc2833-pt [101] 300 | sip-port [5060] 301 | dialplan [XML] 302 | dtmf-duration [2000] 303 | inbound-codec-prefs [PCMU,PCMA] 304 | outbound-codec-prefs [PCMU,PCMA] 305 | rtp-timer-name [soft] 306 | rtp-ip [x.x.x.x] 307 | sip-ip [x.x.x.x] 308 | hold-music [local_stream://moh] 309 | apply-nat-acl [nat.auto] 310 | apply-inbound-acl [test2] 311 | local-network-acl [localnet.auto] 312 | record-path [/var/lib/freeswitch/recordings] 313 | record-template [${caller_id_number}.${target_domain}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav] 314 | manage-presence [true] 315 | presence-hosts [x.x.x.x,x.x.x.x] 316 | presence-privacy [false] 317 | inbound-codec-negotiation [generous] 318 | tls [false] 319 | tls-only [false] 320 | tls-bind-params [transport=tls] 321 | tls-sip-port [5061] 322 | tls-passphrase [] 323 | tls-verify-date [true] 324 | tls-verify-policy [none] 325 | tls-verify-depth [2] 326 | tls-verify-in-subjects [] 327 | tls-version [tlsv1,tlsv1.1,tlsv1.2] 328 | tls-ciphers [ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH] 329 | inbound-late-negotiation [true] 330 | inbound-zrtp-passthru [true] 331 | nonce-ttl [60] 332 | auth-calls [true] 333 | inbound-reg-force-matching-username [true] 334 | auth-all-packets [false] 335 | ext-rtp-ip [x.x.x.x] 336 | ext-sip-ip [x.x.x.x] 337 | rtp-timeout-sec [300] 338 | rtp-hold-timeout-sec [1800] 339 | force-register-domain [x.x.x.x] 340 | force-subscription-domain [x.x.x.x] 341 | force-register-db-domain [x.x.x.x] 342 | ws-binding [:5066] 343 | wss-binding [:7443] 344 | challenge-realm [auto_from] 345 | sofia.c:5987 Setting MAX Auth Validity to 0 Attempts 346 | sofia.c:6154 Started Profile internal [sofia_reg_internal] 347 | sofia.c:3127 Creating agent for internal 348 | sofia.c:3246 Created agent for internal 349 | sofia.c:3295 Set params for internal 350 | sofia.c:3342 Activated db for internal 351 | switch_core_sqldb.c:1693 sofia:internal Starting SQL thread. 352 | sofia.c:3380 Starting thread for internal 353 | sofia.c:3027 Launching worker thread for internal 354 | sofia.c:4172 Adding Alias [x.x.x.x] for profile [internal] 355 | ``` 356 | Reloading gateways 357 | ``` 358 | >sofia profile external rescan reloadxml 359 | Reload XML [Success] 360 | +OK scan complete 361 | 362 | [INFO] mod_enum.c:879 ENUM Reloaded 363 | [INFO] switch_time.c:1423 Timezone reloaded 1750 definitions 364 | debug [1] 365 | sip-trace [yes] 366 | sip-capture [yes] 367 | rfc2833-pt [101] 368 | sip-port [5080] 369 | dialplan [XML] 370 | context [public] 371 | dtmf-duration [2000] 372 | inbound-codec-prefs [PCMU,PCMA] 373 | outbound-codec-prefs [PCMU,PCMA] 374 | hold-music [local_stream://moh] 375 | rtp-timer-name [soft] 376 | local-network-acl [localnet.auto] 377 | manage-presence [false] 378 | inbound-codec-negotiation [generous] 379 | nonce-ttl [60] 380 | auth-calls [true] 381 | inbound-late-negotiation [true] 382 | inbound-zrtp-passthru [true] 383 | rtp-ip [x.x.x.x] 384 | sip-ip [x.x.x.x] 385 | ext-rtp-ip [x.x.x.x] 386 | ext-sip-ip [x.x.x.x] 387 | rtp-timeout-sec [5000] 388 | rtp-hold-timeout-sec [1800] 389 | tls [true] 390 | tls-only [false] 391 | tls-bind-params [transport=tls] 392 | tls-sip-port [5081] 393 | tls-passphrase [] 394 | tls-verify-date [true] 395 | tls-verify-policy [none] 396 | tls-verify-depth [2] 397 | tls-verify-in-subjects [] 398 | tls-version [tlsv1,tlsv1.1,tlsv1.2] 399 | Setting MAX Auth Validity to 0 Attempts 400 | ``` 401 | 402 | ## Ref : 403 | Freeswitch SIP TLS https://freeswitch.org/confluence/display/FREESWITCH/SIP+TLS -------------------------------------------------------------------------------- /secure_sip_tls_srtp/dialplan/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /secure_sip_tls_srtp/directory/deafult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /secure_sip_tls_srtp/directory/default/7777777777.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /secure_sip_tls_srtp/directory/default/altanai.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /secure_sip_tls_srtp/sip_profiles/external.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /secure_sip_tls_srtp/sip_profiles/internal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /secure_sip_tls_srtp/vars.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /video_mcu_conference/README.md: -------------------------------------------------------------------------------- 1 | # Video Conference 2 | 3 | Video MCU stereo 4 | ```bash 5 | 6 | 7 | 8 | 9 | ... 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | ``` 20 | 21 | video-mcu-stereo-720 22 | ```bash 23 | 24 | 25 | 26 | 27 | ... 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | ``` 38 | 39 | video-mcu-stereo-480 40 | ```bash 41 | 42 | 43 | 44 | 45 | ... 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | ``` 56 | 57 | video-mcu-stereo-320 58 | ```bash 59 | 60 | 61 | 62 | 63 | ... 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | ``` 74 | 75 | 76 | ## video-mcu-stereo mapped to Number 3500 77 | 78 | dialplan 79 | ```xml 80 | 81 | 82 | 83 | 84 | 85 | 86 | ``` 87 | 3 party conferencing on RTP/AVP 88 | 89 | Match with available extensions 90 | ``` 91 | Dialplan: sofia/internal/1000@192.168.1.109 Regex (PASS) [cdquality_conferences] destination_number(3500) =~ /^(35\d{2})$/ break=on-false 92 | Dialplan: sofia/internal/1000@192.168.1.109 Action answer() 93 | Dialplan: sofia/internal/1000@192.168.1.109 Action conference(3500@video-mcu-stereo) 94 | ``` 95 | 96 | ## debugging help 97 | 98 | **Issue 1** receives "SIP/2.0 422 Session Interval Too Small" 99 | 100 | **solution** increase the default session rxpires in jssip-3.0.1.3.js 101 | 102 | 103 | // SESSION_EXPIRES: 90, 104 | SESSION_EXPIRES: 3600, 105 | 106 | 107 | **Issue 2** receives "Q.850;cause=88;text="INCOMPATIBLE_DESTINATION" 108 | 109 | **oslution** An access control list (ACL) is a list of permissions (or rules) associated with an object where the list defines what network entities are allowed to access the object. ICE candidates for RTP transport are checked against this list. It defaults to wan.auto if unset, which excludes the LAN. 110 | 111 | Add the mkissing acl in acl.conf.xml 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /video_mcu_conference/autoload_configs/conference.conf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /video_mcu_conference/dialplan/public.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /video_mcu_conference/session_interval_too_small.txt: -------------------------------------------------------------------------------- 1 | recv 6287 bytes from wss/[10.176.2.43]:56358 at 17:50:29.730311: 2 | ------------------------------------------------------------------------ 3 | INVITE sip:350000-screen@10.176.2.43 SIP/2.0 4 | Via: SIP/2.0/WSS 10.176.2.43;branch=z9hG4bK7743587 5 | Max-Forwards: 69 6 | To: 7 | From: ;tag=dtgpvj7l4l 8 | Call-ID: fariffj0i3o6117h3a4q 9 | CSeq: 6453 INVITE 10 | Contact: 11 | Content-Type: application/sdp 12 | Session-Expires: 90 13 | Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO 14 | Supported: timer,ice,replaces,outbound 15 | User-Agent: JsSIP 3.0.13 16 | Content-Length: 5791 17 | 18 | v=0 19 | o=- 6435719935912651566 2 IN IP4 127.0.0.1 20 | s=- 21 | t=0 0 22 | a=group:BUNDLE 0 1 23 | a=extmap-allow-mixed 24 | a=msid-semantic: WMS VZ5uJtG0oFXTjero0z2TGooyowR3nAy8AcIE 25 | m=audio 44101 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 106 105 13 110 112 113 126 26 | c=IN IP4 10.176.2.43 27 | a=rtcp:9 IN IP4 0.0.0.0 28 | a=candidate:1427356461 1 udp 2122260223 10.176.2.43 44101 typ host generation 0 network-id 1 network-cost 10 29 | a=candidate:462440413 1 tcp 1518280447 10.176.2.43 9 typ host tcptype active generation 0 network-id 1 network-cost 10 30 | a=ice-ufrag:+xSw 31 | a=ice-pwd:wY8yKGdsWXoch2fgK3wY/pCD 32 | a=ice-options:trickle 33 | a=fingerprint:sha-256 50:7E:A4:96:28:3E:12:D3:AB:04:D9:5E:62:2E:63:97:7C:98:62:97:FB:55:64:2F:A4:C9:02:D7:D4:65:C3:FF 34 | a=setup:actpass 35 | a=mid:0 36 | a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level 37 | a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time 38 | a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 39 | a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid 40 | a=sendrecv 41 | a=msid:VZ5uJtG0oFXTjero0z2TGooyowR3nAy8AcIE 2bc2bf59-6052-4c4d-aa59-2a6c982cb0b1 42 | a=rtcp-mux 43 | a=rtpmap:111 opus/48000/2 44 | a=rtcp-fb:111 transport-cc 45 | a=fmtp:111 minptime=10;useinbandfec=1 46 | a=rtpmap:63 red/48000/2 47 | a=fmtp:63 111/111 48 | a=rtpmap:103 ISAC/16000 49 | a=rtpmap:104 ISAC/32000 50 | a=rtpmap:9 G722/8000 51 | a=rtpmap:0 PCMU/8000 52 | a=rtpmap:8 PCMA/8000 53 | a=rtpmap:106 CN/32000 54 | a=rtpmap:105 CN/16000 55 | a=rtpmap:13 CN/8000 56 | a=rtpmap:110 telephone-event/48000 57 | a=rtpmap:112 telephone-event/32000 58 | a=rtpmap:113 telephone-event/16000 59 | a=rtpmap:126 telephone-event/8000 60 | a=ssrc:3028612396 cname:bJB37TyQ7QfGYIxp 61 | a=ssrc:3028612396 msid:VZ5uJtG0oFXTjero0z2TGooyowR3nAy8AcIE 2bc2bf59-6052-4c4d-aa59-2a6c982cb0b1 62 | a=ssrc:3028612396 mslabel:VZ5uJtG0oFXTjero0z2TGooyowR3nAy8AcIE 63 | a=ssrc:3028612396 label:2bc2bf59-6052-4c4d-aa59-2a6c982cb0b1 64 | m=video 36723 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 122 127 121 125 107 108 109 35 36 120 119 124 65 | c=IN IP4 10.176.2.43 66 | a=rtcp:9 IN IP4 0.0.0.0 67 | a=candidate:1427356461 1 udp 2122260223 10.176.2.43 36723 typ host generation 0 network-id 1 network-cost 10 68 | a=candidate:462440413 1 tcp 1518280447 10.176.2.43 9 typ host tcptype active generation 0 network-id 1 network-cost 10 69 | a=ice-ufrag:+xSw 70 | a=ice-pwd:wY8yKGdsWXoch2fgK3wY/pCD 71 | a=ice-options:trickle 72 | a=fingerprint:sha-256 50:7E:A4:96:28:3E:12:D3:AB:04:D9:5E:62:2E:63:97:7C:98:62:97:FB:55:64:2F:A4:C9:02:D7:D4:65:C3:FF 73 | a=setup:actpass 74 | a=mid:1 75 | a=extmap:14 urn:ietf:params:rtp-hdrext:toffset 76 | a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time 77 | a=extmap:13 urn:3gpp:video-orientation 78 | a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 79 | a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay 80 | a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type 81 | a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing 82 | a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space 83 | a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid 84 | a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id 85 | a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id 86 | a=sendrecv 87 | a=msid:VZ5uJtG0oFXTjero0z2TGooyowR3nAy8AcIE 09a1ef2a-abd5-4c2a-b43b-9c49cc1492a8 88 | a=rtcp-mux 89 | a=rtcp-rsize 90 | a=rtpmap:96 VP8/90000 91 | a=rtcp-fb:96 goog-remb 92 | a=rtcp-fb:96 transport-cc 93 | a=rtcp-fb:96 ccm fir 94 | a=rtcp-fb:96 nack 95 | a=rtcp-fb:96 nack pli 96 | a=rtpmap:97 rtx/90000 97 | a=fmtp:97 apt=96 98 | a=rtpmap:98 VP9/90000 99 | a=rtcp-fb:98 goog-remb 100 | a=rtcp-fb:98 transport-cc 101 | a=rtcp-fb:98 ccm fir 102 | a=rtcp-fb:98 nack 103 | a=rtcp-fb:98 nack pli 104 | a=fmtp:98 profile-id=0 105 | a=rtpmap:99 rtx/90000 106 | a=fmtp:99 apt=98 107 | a=rtpmap:100 VP9/90000 108 | a=rtcp-fb:100 goog-remb 109 | a=rtcp-fb:100 transport-cc 110 | a=rtcp-fb:100 ccm fir 111 | a=rtcp-fb:100 nack 112 | a=rtcp-fb:100 nack pli 113 | a=fmtp:100 profile-id=2 114 | a=rtpmap:101 rtx/90000 115 | a=fmtp:101 apt=100 116 | a=rtpmap:102 H264/90000 117 | a=rtcp-fb:102 goog-remb 118 | a=rtcp-fb:102 transport-cc 119 | a=rtcp-fb:102 ccm fir 120 | a=rtcp-fb:102 nack 121 | a=rtcp-fb:102 nack pli 122 | a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f 123 | a=rtpmap:122 rtx/90000 124 | a=fmtp:122 apt=102 125 | a=rtpmap:127 H264/90000 126 | a=rtcp-fb:127 goog-remb 127 | a=rtcp-fb:127 transport-cc 128 | a=rtcp-fb:127 ccm fir 129 | a=rtcp-fb:127 nack 130 | a=rtcp-fb:127 nack pli 131 | a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f 132 | a=rtpmap:121 rtx/90000 133 | a=fmtp:121 apt=127 134 | a=rtpmap:125 H264/90000 135 | a=rtcp-fb:125 goog-remb 136 | a=rtcp-fb:125 transport-cc 137 | a=rtcp-fb:125 ccm fir 138 | a=rtcp-fb:125 nack 139 | a=rtcp-fb:125 nack pli 140 | a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f 141 | a=rtpmap:107 rtx/90000 142 | a=fmtp:107 apt=125 143 | a=rtpmap:108 H264/90000 144 | a=rtcp-fb:108 goog-remb 145 | a=rtcp-fb:108 transport-cc 146 | a=rtcp-fb:108 ccm fir 147 | a=rtcp-fb:108 nack 148 | a=rtcp-fb:108 nack pli 149 | a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f 150 | a=rtpmap:109 rtx/90000 151 | a=fmtp:109 apt=108 152 | a=rtpmap:35 AV1/90000 153 | a=rtcp-fb:35 goog-remb 154 | a=rtcp-fb:35 transport-cc 155 | a=rtcp-fb:35 ccm fir 156 | a=rtcp-fb:35 nack 157 | a=rtcp-fb:35 nack pli 158 | a=rtpmap:36 rtx/90000 159 | a=fmtp:36 apt=35 160 | a=rtpmap:120 red/90000 161 | a=rtpmap:119 rtx/90000 162 | a=fmtp:119 apt=120 163 | a=rtpmap:124 ulpfec/90000 164 | a=ssrc-group:FID 1837826458 874607148 165 | a=ssrc:1837826458 cname:bJB37TyQ7QfGYIxp 166 | a=ssrc:1837826458 msid:VZ5uJtG0oFXTjero0z2TGooyowR3nAy8AcIE 09a1ef2a-abd5-4c2a-b43b-9c49cc1492a8 167 | a=ssrc:1837826458 mslabel:VZ5uJtG0oFXTjero0z2TGooyowR3nAy8AcIE 168 | a=ssrc:1837826458 label:09a1ef2a-abd5-4c2a-b43b-9c49cc1492a8 169 | a=ssrc:874607148 cname:bJB37TyQ7QfGYIxp 170 | a=ssrc:874607148 msid:VZ5uJtG0oFXTjero0z2TGooyowR3nAy8AcIE 09a1ef2a-abd5-4c2a-b43b-9c49cc1492a8 171 | a=ssrc:874607148 mslabel:VZ5uJtG0oFXTjero0z2TGooyowR3nAy8AcIE 172 | a=ssrc:874607148 label:09a1ef2a-abd5-4c2a-b43b-9c49cc1492a8 173 | send 714 bytes to wss/[10.176.2.43]:56358 at 17:50:29.730970: 174 | ------------------------------------------------------------------------ 175 | SIP/2.0 422 Session Interval Too Small 176 | Via: SIP/2.0/WSS 10.176.2.43;branch=z9hG4bK7743587;rport=56358 177 | From: ;tag=dtgpvj7l4l 178 | To: ;tag=e3HNS0Xe9tvQe 179 | Call-ID: fariffj0i3o6117h3a4q 180 | CSeq: 6453 INVITE 181 | User-Agent: FreeSWITCH-mod_sofia/1.10.4-dev+git~20200518T172205Z~91f54340ed~64bit 182 | Accept: application/sdp 183 | Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE 184 | Supported: timer, path, replaces 185 | Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer 186 | Min-SE: 120 187 | Content-Length: 0 188 | 189 | recv 266 bytes from wss/[10.176.2.43]:56358 at 17:50:29.736868: 190 | ------------------------------------------------------------------------ 191 | ACK sip:350000-screen@10.176.2.43 SIP/2.0 192 | Via: SIP/2.0/WSS 10.176.2.43;branch=z9hG4bK7743587 193 | To: ;tag=e3HNS0Xe9tvQe 194 | From: ;tag=dtgpvj7l4l 195 | Call-ID: fariffj0i3o6117h3a4q 196 | CSeq: 6453 ACK 197 | Content-Length: 0 198 | -------------------------------------------------------------------------------- /voip_appserver/README.md: -------------------------------------------------------------------------------- 1 | # Freeswitch as Main App Server in a aVOIP platform 2 | 3 | ## Debugging help 4 | 5 | **Issue 1** [WARNING] mod_sofia.c:4859 Cannot locate registered user 2222222222@ 6 | **Solution** Add correct user in dialplan and also register the user in a sip phone 7 | 8 | 9 | 10 | 11 | 12 | 13 | --> 14 | 15 | 16 | 17 | 18 | --------------------------------------------------------------------------------