Outbound calls using freeswitch - freeswitch

This is my external sip_profile:
<gateway name="outbound">
<param name="realm" value="10.0.1.5:5062"/>
<param name="username" value="1001"/>
<param name="password" value="1234"/>
<param name="dtmf-type" value="rfc2833"/>
<param name="expire-seconds" value="600"/>
<param name="register" value="false"/>
<param name="caller-id-in-from" value="false"/>
</gateway>
and my dialplan is as such:
<extension name="outbound_pstn">
<condition field="destination_number" expression="^(.*)$">
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
<action application="bridge" data="sofia/gateway/outbound/$1"/>
</condition>
</extension>
I am using the HT503 as my ATA. Freeswitch is running on the IP 10.0.1.5 and ATA is at 10.0.1.9
I can't seem to be able to make an outbound call. What am I doing wrong?

realm should be the address of the remote side, and in your example it's set to freeswitch'es local address

If you want to connect Freeswitch to another PBX/switch you should set:
<param name="register" value="true"/>
for PSTN registration is not required. Use something like this:
<include>
<gateway name="sipmarket">
<param name="username" value="user1"/>
<param name="realm" value="sipmarket.net"/>
<param name="from-user" value="user1"/>
<param name="from-domain" value="sipmarket.net"/>
<param name="password" value="strong_password"/>
<param name="expire-seconds" value="300"/>
<param name="register" value="true"/>
<param name="register-transport" value="udp"/>
</gateway>
</include>

You should check out http://wiki.freeswitch.org/wiki/Main_Page and look for the outbound gateway pages. You don't have to define realm, unless you want to.
You need to have the gateway actually register to a SIP provider to make calls as well.

If you digit
sofia status gateways
can you see your gateway "outbound"? Otherwise you have to digit:
sofia profile external rescan
if you put your gateways under external sip profile.

Related

How to work TightVNC in web browser

TightVNC has provides this file for embedding in web pages(Java Viewer):
https://www.tightvnc.com/download/2.8.3/tvnjviewer-2.8.3-bin-gnugpl.zip
viewer-applet-example.html in the file, provides a example:
the <applet> loading jar(tightvnc-jviewer.jar),object(com.glavsoft.viewer.Viewer)
the <param> set ip(localhost),port(5900)...
<html>
<head>
<title>TightVNC desktop</title>
</head>
<body>
<applet archive="tightvnc-jviewer.jar"
code="com.glavsoft.viewer.Viewer"
width="100" height="100">
<param name="Host" value="localhost"/>
<!-- Host to connect. Default: the host from which the applet was loaded. -->
<param name="Port" value="5900"/>
<!-- Port number to connect. Default: 5900 -->
<!--param name="Password" value="" /--> <!-- Password to the server (not recommended to use this parameter here) -->
<param name="OpenNewWindow" value="yes"/>
<!-- yes/true or no/false. Default: yes/true -->
<param name="ShowControls" value="yes"/>
<!-- yes/true or no/false. Default: yes/true -->
<param name="ViewOnly" value="no"/>
<!-- yes/true or no/false. Default: no/false -->
<param name="AllowClipboardTransfer" value="yes"/>
<!-- yes/true or no/false. Default: yes/true -->
<param name="RemoteCharset" value="standard"/>
<!-- Charset encoding is used on remote system. Use this option to specify character encoding will be used for encoding clipboard text content to. Default value (when parameter is empty): local system default character encoding. Set the value to 'standard' for using 'Latin-1' charset which is only specified by rfb standard for clipboard transfers. -->
<param name="ShareDesktop" value="yes"/>
<!-- yes/true or no/false. Default: yes/true -->
<param name="AllowCopyRect" value="yes"/>
<!-- yes/true or no/false. Default: yes/true -->
<param name="Encoding" value="Tight"/>
<!-- Possible values: "Tight", "Hextile", "ZRLE", and "Raw". Default: Tight -->
<param name="CompressionLevel" value=""/>
<!-- 1-9 or empty. Empty means server default -->
<param name="JpegImageQuality" value=""/>
<!-- 1-9, Lossless or empty. When param is set to "Lossless" no jpeg compression used. Empty means server default -->
<param name="LocalPointer" value="On"/>
<!-- Possible values: on/yes/true (draw pointer locally), off/no/false (let server draw pointer), hide). Default: "On"-->
<param name="ConvertToASCII" value="no"/>
<!-- Whether to convert keyboard input to ASCII ignoring locale. Possible values: yes/true, no/false). Default: "No"-->
<param name="Tunneling" value="auto"/>
<!-- Tunneling. Possible values:
auto - allow viewer to choose tunneling mode,
none/no - no tunneling use,
SSL - choose SSL tunneling when available.
Default: "auto" -->
<param name="colorDepth" value=""/>
<!-- Reserved for future. Possible values: 6, 8, 16, 24, 32 (equals to 24). Only 24/32 is supported now -->
<param name="ScalingFactor" value="100"/>
<!-- Scale local representation of the remote desktop on startup. Default is 100 means 100% -->
<!--param name="showConnectionDialog" value="yes" /-->
<!-- Set to "No" if you want not to show initial connection dialog. Default: "Yes". -->
<param name="AppletGoodbyeURL" value="about:blank"/>
<!-- URL to be redirected on applet stopping. When blank or absent stop applet and do nothing. -->
<!-- SSH tunneling options -->
<param name="sshHost" value=""/>
<!-- SSH host name. -->
<param name="sshUser" value=""/>
<!-- SSH port number. When empty, standard SSH port number (22) is used -->
<param name="sshPort" value=""/>
<!-- SSH user name. -->
</applet>
<br/>
TightVNC Web Site
</body>
</html>
I can't not work this web, the web page is blank, only show the TightVNC Web Site part.
Using Java Viewer, I don't need to install the server side(TightVNC for Windows (Version 2.8.11))? How do I set up server side?
Be sure to use a browser that supports java applets. Otherwise, the built-in TightVNC-Client will not work and you will only see the line "www.TightVNC.com"
Keep in mind that many browsers don't support java applets (NPAPI) anymore. Chrome stopped support with version 45 (September 2015), Firefox 52 (March 2017), Microsoft Edge doesn't support NPAPI at all.
Try Internet Explorer to check if you installation is correct. Consider a HTML5-based VNC-Client/Viewer.

Access gateway/profile params/variables in Freeswitch

To get variables from a user we call user_data(user var variable_name).
<include>
<user id="1000">
<variables>
<variable name="custom_variable" value="test"/>
</variables>
</user>
</include>
We call in a way like that:
<action application="set" data="variable_name=${user_data(${caller_id_number}#${domain_name} var custom_variable)}"/>
But how to do the same with a gateway?
<include>
<gateway name="custom_gateway">
<param name="custom_param" value="test"/>
</gateway>
</include>
I think it is not possible.
FS application set is 'Set a channel variable for the channel calling the application' while gateway data is somewhere in the sofia module. However, there is a way to list gateway data from console. Have a look at sofia_gateway_data_function in the source code, hope it sheds some light on what you need to do. Good luck!

Telerik AppBuilder Using Custom Plugin

I have recently started some app development with Telerik's AppBuilder and am running into one thing that I'm not certain of. I added a custom plugin to my project (Cordova Local Notifications Plugin) which seemed to work (it shows up in my solution now under a Plugins folder), but I have no idea how to reference the scripts and such from it. According to the Telerik documentation (Reference the Custom Plugin in index.html and config.xml), they say to add includes for anything with in the plugin.xml file, yet this plugin doesn't have that.
Any ideas on how I reference their script so I can start using it? Do I just reference Plugins/cordova-plugin-local-notifications-master/www/local-notification.js file direct or something else? Here is their plugin.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="de.appplant.cordova.plugin.local-notification"
version="0.8.0dev">
<name>LocalNotification</name>
<description>The purpose of the plugin is to create an platform independent javascript interface for Cordova based mobile applications to access the specific Notification API on each platform.</description>
<repo>https://github.com/katzer/cordova-plugin-local-notifications.git</repo>
<keywords>notification, local notification, alarm, scheduler, tile, live tiles, ios, android, windows phone 8, wp8</keywords>
<license>Apache 2.0</license>
<author>Sebastián Katzer</author>
<engines>
<engine name="cordova" version=">=3.0.0" />
</engines>
<dependency id="org.apache.cordova.device" url="https://github.com/apache/cordova-plugin-device" />
<js-module src="www/local-notification.js" name="LocalNotification">
<clobbers target="plugin.notification.local" />
</js-module>
<!-- ios -->
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="LocalNotification">
<param name="ios-package" value="APPLocalNotification" onload="true" />
<param name="onload" value="true" />
</feature>
</config-file>
<header-file src="src/ios/APPLocalNotification.h" />
<source-file src="src/ios/APPLocalNotification.m" />
</platform>
<!-- android -->
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="LocalNotification">
<param name="android-package" value="de.appplant.cordova.plugin.localnotification.LocalNotification"/>
</feature>
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<!--
* The alarm receiver is triggered when a scheduled alarm is fired. This class
* reads the information in the intent and displays this information in the
* Android notification bar. The notification uses the default notification
* sound and it vibrates the phone.
-->
<receiver android:name="de.appplant.cordova.plugin.localnotification.Receiver" />
<!--
* This class is triggered upon reboot of the device. It needs to re-register
* the alarms with the AlarmManager since these alarms are lost in case of
* reboot.
-->
<receiver android:name="de.appplant.cordova.plugin.localnotification.Restore" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!--
* The receiver activity is triggered when a notification is clicked by a user.
* The activity calls the background callback and brings the launch inten
* up to foreground.
-->
<activity android:name="de.appplant.cordova.plugin.localnotification.ReceiverActivity" android:launchMode="singleInstance" />
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</config-file>
<lib-file src="libs/android/android-support-v4.jar" />
<source-file src="src/android/LocalNotification.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
<source-file src="src/android/Receiver.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
<source-file src="src/android/Options.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
<source-file src="src/android/Restore.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
<source-file src="src/android/ReceiverActivity.java" target-dir="src/de/appplant/cordova/plugin/localnotification" />
</platform>
<!-- wp8 -->
<platform name="wp8">
<config-file target="config.xml" parent="/*">
<feature name="LocalNotification">
<param name="wp-package" value="LocalNotification"/>
</feature>
</config-file>
<source-file src="src/wp8/LocalNotification.cs" />
<source-file src="src/wp8/Options.cs" />
</platform>
</plugin>
Any JavaScript file references are automatically inserted into your app when AppBuilder creates a build, so there is really not much you have to do aside from including the plugin. BTW, you should look for custom plugins first on the Verified Plugins Marketplace - which includes instructions on including the plugin in your AppBuilder project.

Enable InAppBrowser in PhoneGap Windows Phone app for build in Visual Studio

I'm developing a PhoneGap app inside a WP7 project and strugging with the InAppBrowser: I saw that there's a file InAppBrowser.cs already included in my Project (Phonegap 2.9.1), and I even downloaded the InAppBrowser.js file from its git repo and included that in my page. But calling window.open('http://stackoverflow.com/, '_system'); still doesn't launch the system browser app.
My config.xml looks as follows:
<widget>
<access origin="*"/>
<features>
<feature name="Device">
<param name="wp-package" value="Device" onload="false"/>
</feature>
<feature name="Compass">
<param name="wp-package" value="Compass" />
</feature>
<feature name="Accelerometer">
<param name="wp-package" value="Accelerometer"/>
</feature>
<feature name="Camera">
<param name="wp-package" value="Camera"/>
</feature>
<feature name="NetworkStatus">
<param name="wp-package" value="NetworkStatus"/>
</feature>
<feature name="Contacts">
<param name="wp-package" value="Contacts"/>
</feature>
<feature name="File">
<param name="wp-package" value="File"/>
</feature>
<feature name="FileTransfer">
<param name="wp-package" value="FileTransfer"/>
</feature>
<feature name="Geolocation">
<param name="wp-package" value="Geolocation"/>
</feature>
<feature name="Media">
<param name="wp-package" value="Media"/>
</feature>
<feature name="Capture">
<param name="wp-package" value="Capture"/>
</feature>
<feature name="Battery">
<param name="wp-package" value="Battery"/>
</feature>
<feature name="Globalization">
<param name="wp-package" value="Globalization"/>
</feature>
<feature name="InAppBrowser">
<param name="wp-package" value="InAppBrowser"/>
</feature>
<feature name="Notification">
<param name="wp-package" value="Notification"/>
</feature>
</features>
What else is needed to make the InAppBrowser finally work?
Side note: Building the app in PhoneGap Build makes these links (and the InAppBrowser) work correctly, but has too many restrictions, so I'd like to build it locally.

Making a call on a registered sip profile with freeswitch

I have a sip profile set up with freeswitch as
<include>
<gateway name="[sipname]">
<param name="register" value="false"/>
<param name="username" value="not-used"/>
<param name="password" value="not-used"/>
<param name="realm" value="[ip address]"/>
<param name="proxy" value="[ip address]"/>
</gateway>
</include>
Am I right in thinking I should be able to make a call with:
originate sofia/external/[phonenumber]#[ip address] '&javascript(/root/voice.js 20)'
Because I keep getting RECOVERY_ON_TIMER_EXPIRE and before I investigate all the other problems it could be I wanted to check that I'm doing it right so far.
Dial out of a gateway
Basic form:
*sofia/gateway/<gateway>/<number_to_dial>*
Example 1:
*sofia/gateway/asterlink/18005551212*
http://wiki.freeswitch.org/wiki/Mod_sofia#Dial_out_of_a_gateway
originate sofia/gateway/[sipname]/[phonenumber] &javascript('/root/voice.js 20')
originate {ignore_early_media=true,bridge_early_media=false,originate_timeout=24,call_timeout=24,execute_on_answer='sched_hangup 10 alloted_timeout',origination_uuid=f7f927c5-n6wv-a55j-m5cr-37c9-f7f934d95e,origination_caller_id_number=+12121112222}sofia/gateway/asterisk/+14171111111 handle_calls
In this case asterisk is my profile under /sip_profiles/external/asterisk.xml
> sofia status gateway asterisk
=================================================================================================
Name asterisk
Profile external
Scheme Digest
Realm 192.241.203.11:5090
Username FreeSWITCH
Password no
From <sip:FreeSWITCH#192.241.203.21:5090>
Contact <sip:gw+asterisk#2.67.78.1:5090;transport=udp;gw=asterisk>
Exten FreeSWITCH
To sip:FreeSWITCH#192.241.203.11:5090
Proxy sip:192.241.203.11:5090
Context public
Expires 3600
Freq 3600
Ping 0
PingFreq 0
PingTime 0.00
PingState 0/0/0
State NOREG
Status UP
Uptime 290s
CallsIN 0
CallsOUT 2
FailedCallsIN 0
FailedCallsOUT 0
Talking about FreeSWITCH not Asterisk. The dial command is incorrect - through gateway it should be:
fs_cli> originate sofia/external/[phonenumber]#[gateway name] '&yourscript'
First run fs_cli and command "sofia status" to check gateway is UP

Resources