Asterisk Manager API - Extension -> ZAP Channel - api

Is there a way to retrieve the ZAP channel from an extension number through the Manager API?
For example, this is what I see when I run "zap show channels":
Chan Extension Context Language MOH Interpret
...
33 3594 from-zaptel en default
...
But Manager API only returns the following (without extension):
Event: ZapShowChannels
Channel: 33
Signalling: FXS Kewlstart
Context: from-zaptel
DND: Disabled
Alarm: No Alarm
ActionID: aci-1234

You did not mention which version of asterisk you are working with. I assume asterisk 1.2 because in newer versions "zaptel" has been renamed to "dahdi".
It's a bit of a work around, but you can request the missing information for each channel with the "GetVar" Action.
send:
Action: GetVar
Channel: Zap/33
Variable: EXTEN
receive:
Response: Success
EXTEN: 3594

Related

Send transaction on local avalanche node using geth

I've spun up a local avalanche network using the avalanche network runner and I've successfully connected to it using geth:
❮❮❮ geth attach ws://127.0.0.1:35260/ext/bc/C/ws
Welcome to the Geth JavaScript console!
instance: v0.8.4-rc.3
coinbase: 0x0100000000000000000000000000000000000000
at block: 0 (Wed Dec 31 1969 18:00:00 GMT-0600 (CST))
modules: eth:1.0 net:1.0 rpc:1.0 web3:1.0
To exit, press ctrl-d or type exit
I'm trying to send a transaction from one account to another. I've found that this avalanche network pre-seeds account 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC with some ETH based on this comment and confirmed it using geth:
> eth.getBalance("0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52Fc")
5e+25
However, when I try to send a transaction from this account, it fails:
> eth.getBalance("0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52Fc")
5e+25
> eth.sendTransaction({from:"0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC", to:"0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FD", value: web3.toWei(0.05, "ether")})
Error: unknown account
at web3.js:6365:37(47)
at send (web3.js:5099:62(35))
at <eval>:1:20(15)
I suspect it's because I don't have the account in the list of accounts:
> eth.accounts
[]
I've tried to import the account using geth account import <path to keyfile> but that did not result in eth.accounts having an entry.
I've also tried to use the personal.importRawKey function, but that doesn't work either:
> personal.importRawKey("56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027", "lol")
Error: the method personal_importRawKey does not exist/is not available
at web3.js:6365:37(47)
at send (web3.js:5099:62(35))
at <eval>:1:22(5)
> personal
{
listAccounts: undefined,
ecRecover: function(),
getListAccounts: function(callback),
importRawKey: function(),
lockAccount: function(),
newAccount: function github.com/ethereum/go-ethereum/internal/jsre.MakeCallback.func1(),
openWallet: function github.com/ethereum/go-ethereum/internal/jsre.MakeCallback.func1(),
sendTransaction: function(),
sign: function github.com/ethereum/go-ethereum/internal/jsre.MakeCallback.func1(),
unlockAccount: function github.com/ethereum/go-ethereum/internal/jsre.MakeCallback.func1()
}
Do I need to import this account? If so, how?
How do I send a transaction using geth on a local avalanche network using the default funded address by the avalanche network runner?
Turns out I was on the right track with importing the private key but I had to enable the personal namespace in the avalanche node.
The personal namespace can be enabled by adding internal-private-personal to the C Chain config being used by the node.
Once this namespace is enabled, you can connect to your node with geth and issue
> personal.importRawKey("56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027", "lol")
"0x8db97c7cece249c2b98bdc0226cc4c2a57bf52fc"
> personal.unlockAccount("0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC", "lol", 300)
which then enables the account for spending.

Presto cannot access the web page while using SSL

my presto version is 0.240
my operation: i want to use ssl for use https in presto
so i change my config refer only by this url: https://trino.io/docs/current/security/internal-communication.html
but i can't Access to the presto address https://192.168.100.142:9999/
I don't know which step I did wrong.
What should I do to implement HTTPS for Presto?
this is my config:
A cluster of two machines
node 1 142 hostname:sbider-dev-01
/opt/presto-server-0.240/etc/config.properties
coordinator=true
node-scheduler.include-coordinator=true
query.max-memory=7.5GB
query.max-memory-per-node=3.5GB
query.max-total-memory-per-node=3.5GB
experimental.reserved-pool-enabled=false
memory.heap-headroom-per-node=0.5GB
#experimental.spill-enabled=true
#experimental.max-spill-per-node=8GB
#experimental.query-max-spill-per-node=8GB
query.low-memory-killer.policy=total-reservation-on-blocked-nodes
#http-server.http.port=9999
#discovery-server.enabled=true
#discovery.uri=http://192.168.100.142:9999
internal-communication.shared-secret="8HRJWX41DwtuYZcNw8uMbshA8wDLoLS78tT3UVL+Z+m0xG7KCygGurE9SXEbGy2bLtPLza1MhAnWJp2mJp/S+j9EFWWuztXz7cHJhSz9QFiVxYCs1Wzn+IVKgHD5z+iGbdKjwRtgUjwNvS4MIfqwqwKlVZiEtGgEDv7j/kAgpOYPvFCRJfb/U/+b7qPpwPNDA6kXu3Dj5p1Q81+kmbFO59WSh6c4QwqdbFHAaY8XFWo8tIogxpmwQQqV3BvICmesxlIhBH/pOGgoyl86QQ/TaAMaWjaddNcgO5keTGhhOj/juGZ/gbOL/PHGNs1ENSPRnjvIGLHFQPDrm36YenhfTH5L7X0Q9HwwnEpEoYkDJsmMEV+elPZK767nZXHryuvDvHGs0PhYSRO8ekOgC3CaE1tfiGh5M9H5C2fnyeGRQ0iwtgXh83kRDuPzVrRx5yj2cHQJOZu+CcXCJ3aa1Tijxq56RfdcEz9Frr8n8aXaNMtRlchcXn3+B4biByS9duq28VHHBDlyYQQ6VSKbLDt1GBi5oOQICtrGuOY+/MD+rnV5uxPUQcSIh9KmA1WjahJEz0ItDKpB66JgVkTrVDWEJPeozKTvHRLG9sBudRhQ5abJGEAhx9b78dUbTcEkRlPuvUN1WjwVlUzjyUDKd14ocuhpoOBzjV9kFhTqQZ4zgNo="
http-server.http.enabled=false
#node.internal-address-source=FQDN
node.internal-address=sbider-dev-01,sbider-dev-02
http-server.https.enabled=true
http-server.https.port=9999
# jks文件全路径
http-server.https.keystore.path=/ceshi/keystore.jks
http-server.https.keystore.key=123456
discovery.uri=https://192.168.100.142:9999
internal-communication.https.required=true
internal-communication.https.keystore.path=/ceshi/keystore.jks
internal-communication.https.keystore.key=123456
node 2 143 hostname cat /opt/presto-server-0.240/etc/config.properties
coordinator=flase
query.max-memory=7.5GB
query.max-memory-per-node=3.5GB
query.max-total-memory-per-node=3.5GB
experimental.reserved-pool-enabled=false
memory.heap-headroom-per-node=0.5GB
#experimental.spill-enabled=true
#experimental.max-spill-per-node=8GB
#experimental.query-max-spill-per-node=8GB
query.low-memory-killer.policy=total-reservation-on-blocked-nodes
#discovery.uri=http://192.168.100.142:9999
internal-communication.shared-secret="8HRJWX41DwtuYZcNw8uMbshA8wDLoLS78tT3UVL+Z+m0xG7KCygGurE9SXEbGy2bLtPLza1MhAnWJp2mJp/S+j9EFWWuztXz7cHJhSz9QFiVxYCs1Wzn+IVKgHD5z+iGbdKjwRtgUjwNvS4MIfqwqwKlVZiEtGgEDv7j/kAgpOYPvFCRJfb/U/+b7qPpwPNDA6kXu3Dj5p1Q81+kmbFO59WSh6c4QwqdbFHAaY8XFWo8tIogxpmwQQqV3BvICmesxlIhBH/pOGgoyl86QQ/TaAMaWjaddNcgO5keTGhhOj/juGZ/gbOL/PHGNs1ENSPRnjvIGLHFQPDrm36YenhfTH5L7X0Q9HwwnEpEoYkDJsmMEV+elPZK767nZXHryuvDvHGs0PhYSRO8ekOgC3CaE1tfiGh5M9H5C2fnyeGRQ0iwtgXh83kRDuPzVrRx5yj2cHQJOZu+CcXCJ3aa1Tijxq56RfdcEz9Frr8n8aXaNMtRlchcXn3+B4biByS9duq28VHHBDlyYQQ6VSKbLDt1GBi5oOQICtrGuOY+/MD+rnV5uxPUQcSIh9KmA1WjahJEz0ItDKpB66JgVkTrVDWEJPeozKTvHRLG9sBudRhQ5abJGEAhx9b78dUbTcEkRlPuvUN1WjwVlUzjyUDKd14ocuhpoOBzjV9kFhTqQZ4zgNo="
http-server.http.enabled=false
#node.internal-address-source=FQDN
node.internal-address=sbider-dev-01,sbider-dev-02
http-server.https.enabled=true
http-server.https.port=9999
http-server.https.keystore.path=/ceshi/keystore.jks
http-server.https.keystore.key=123456
discovery.uri=https://192.168.100.142:9999
internal-communication.https.required=true
internal-communication.https.keystore.path=/ceshi/keystore.jks
internal-communication.https.keystore.key=123456
server log in sbider-dev-01: cat /opt/presto-server-0.240/var/log/server.log
Companion catalogs: catalog_name1=catalog_name2,catalog_name3=catalog_name4,...
2021-01-12T12:41:09.766+0800 INFO main Bootstrap transaction.idle-check-interval 1.00m 1.00m Time interval between idle transactions checks
2021-01-12T12:41:09.766+0800 INFO main Bootstrap transaction.idle-timeout 5.00m 5.00m Amount of time before an inactive transaction is considered expired
2021-01-12T12:41:09.767+0800 INFO main Bootstrap transaction.max-finishing-concurrency 1 1 Maximum parallelism for committing or aborting a transaction
2021-01-12T12:41:09.767+0800 WARN main Bootstrap UNUSED PROPERTIES
2021-01-12T12:41:09.767+0800 WARN main Bootstrap internal-communication.shared-secret
2021-01-12T12:41:09.767+0800 WARN main Bootstrap
2021-01-12T12:41:11.037+0800 ERROR main com.facebook.presto.server.PrestoServer Unable to create injector, see the following errors:
1) Configuration property 'internal-communication.shared-secret' was not used
at com.facebook.airlift.bootstrap.Bootstrap.lambda$initialize$2(Bootstrap.java:238)
1 error
com.google.inject.CreationException: Unable to create injector, see the following errors:
1) Configuration property 'internal-communication.shared-secret' was not used
at com.facebook.airlift.bootstrap.Bootstrap.lambda$initialize$2(Bootstrap.java:238)
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:543)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:159)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.facebook.airlift.bootstrap.Bootstrap.initialize(Bootstrap.java:245)
at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:131)
at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:77)
You're following Trino (fka Presto SQL) documentation for securing internal documentation, but got Presto binary from facebook's fork of the project (prestodb).
Go to https://trino.io/download.html to get latest Trino release.
The alternative solution (using prestodb's documentation and prestodb's binary) is NOT a safe, viable alternative, due to security issues known and not fixed in prestodb code base.

Unavailable Camera control API functions, Sony Development SDK, Camera WX500

I am trying to modify the CameraRemoteSampleApp provided by the Sony SDK to add full control over the aperture, iso, and shutter speed to the interface.
At this point however all the relevant functions are off limits.
The documentation defines these functions as "available if the latest version of the PlayMemories Smart Remote Control is installed and in use".
a) The smart remote control is installed and running, with the smartphone connected through it and wifi (Samsung Galaxy SIII).
b) I can take photos with the SDK Sample App.
c) Using the available API list shows that the functions exist but are not available.
d) Calling one of those functions directly returns "Not Available Now". This error code is not present in the documentation.
How can one get access to ISO/F-number/Shutter speed functions in this case?
JSON requests and responses:
Request Methods: {"id":1,"method":"getMethodTypes","version":"1.0","params":[""]}
Response: {"id":1,"results":[["actTakePicture",[],["string*"],"1.0"],["actZoom",["string","string"],["int"],"1.0"],["awaitTakePicture",[],["string*"],"1.0"],["cancelTouchAFPosition",[],[],"1.0"],["getApplicationInfo",[],["string","string"],"1.0"],["getAvailableApiList",[],["string*"],"1.0"],["getAvailableExposureCompensation",[],["int","int","int","int"],"1.0"],["getAvailableExposureMode",[],["string","string*"],"1.0"],["getAvailableFNumber",[],["string","string*"],"1.0"],["getAvailableFlashMode",[],["string","string*"],"1.0"],["getAvailableFocusMode",[],["string","string*"],"1.0"],["getAvailableIsoSpeedRate",[],["string","string*"],"1.0"],["getAvailableLiveviewSize",[],["string","string*"],"1.0"],["getAvailablePostviewImageSize",[],["string","string*"],"1.0"],["getAvailableSelfTimer",[],["int","int*"],"1.0"],["getAvailableShootMode",[],["string","string*"],"1.0"],["getAvailableShutterSpeed",[],["string","string*"],"1.0"],["getAvailableWhiteBalance",[],["{\"whiteBalanceMode\":\"string\", \"colorTemperature\":\"int\"}","{\"whiteBalanceMode\":\"string\", \"colorTemperatureRange\":\"int*\"}*"],"1.0"],["getEvent",["bool"],["{\"type\":\"string\", \"names\":\"string*\"}","{\"type\":\"string\", \"cameraStatus\":\"string\"}","{\"type\":\"string\", \"zoomPosition\":\"int\", \"zoomNumberBox\":\"int\", \"zoomIndexCurrentBox\":\"int\", \"zoomPositionCurrentBox\":\"int\"}","{\"type\":\"string\", \"liveviewStatus\":\"bool\"}","{\"type\":\"string\", \"liveviewOrientation\":\"string\"}","{\"type\":\"string\", \"takePictureUrl\":\"string*\"}*","{\"type\":\"string\", \"continuousError\":\"string\", \"isContinued\":\"bool\"}*","{\"type\":\"string\", \"triggeredError\":\"string*\"}","{\"type\":\"string\", \"sceneRecognition\":\"string\", \"steadyRecognition\":\"string\", \"motionRecognition\":\"string\"}","{\"type\":\"string\", \"formatResult\":\"string\"}","{\"type\":\"string\", \"storageID\":\"string\", \"recordTarget\":\"bool\", \"numberOfRecordableImages\":\"int\", \"recordableTime\":\"int\", \"storageDescription\":\"string\"}*","{\"type\":\"string\", \"currentBeepMode\":\"string\", \"beepModeCandidates\":\"string*\"}","{\"type\":\"string\", \"currentCameraFunction\":\"string\", \"cameraFunctionCandidates\":\"string*\"}","{\"type\":\"string\", \"currentMovieQuality\":\"string\", \"movieQualityCandidates\":\"string*\"}","{\"type\":\"string\", \"checkAvailability\":\"bool\", \"currentAspect\":\"string\", \"currentSize\":\"string\"}","{\"type\":\"string\", \"cameraFunctionResult\":\"string\"}","{\"type\":\"string\", \"currentSteadyMode\":\"string\", \"steadyModeCandidates\":\"string*\"}","{\"type\":\"string\", \"currentViewAngle\":\"int\", \"viewAngleCandidates\":\"int*\"}","{\"type\":\"string\", \"currentExposureMode\":\"string\", \"exposureModeCandidates\":\"string*\"}","{\"type\":\"string\", \"currentPostviewImageSize\":\"string\", \"postviewImageSizeCandidates\":\"string*\"}","{\"type\":\"string\", \"currentSelfTimer\":\"int\", \"selfTimerCandidates\":\"int*\"}","{\"type\":\"string\", \"currentShootMode\":\"string\", \"shootModeCandidates\":\"string*\"}","{\"type\":\"string\", \"currentAELock\":\"bool\", \"aeLockCandidates\":\"bool*\"}","{\"type\":\"string\", \"checkAvailability\":\"bool\", \"currentBracketShootMode\":\"string\", \"currentBracketShootModeOption\":\"string\"}","{\"type\":\"string\", \"checkAvailability\":\"bool\", \"currentCreativeStyle\":\"string\", \"currentCreativeStyleContrast\":\"int\", \"currentCreativeStyleSaturation\":\"int\", \"currentCreativeStyleSharpness\":\"int\"}","{\"type\":\"string\", \"currentExposureCompensation\":\"int\", \"maxExposureCompensation\":\"int\", \"minExposureCompensation\":\"int\", \"stepIndexOfExposureCompensation\":\"int\"}","{\"type\":\"string\", \"currentFlashMode\":\"string\", \"flashModeCandidates\":\"string*\"}","{\"type\":\"string\", \"currentFNumber\":\"string\", \"fNumberCandidates\":\"string*\"}","{\"type\":\"string\", \"currentFocusMode\":\"string\", \"focusModeCandidates\":\"string*\"}","{\"type\":\"string\", \"currentIsoSpeedRate\":\"str
Request Versions: {"id":2,"method":"getVersions","version":"1.0","params":[]}
Response: {"id":2,"result":[["1.0"]]}
Request API: {"id":3,"method":"getAvailableApiList","version":"1.0","params":[]}
Response: {"id":3,"result":[["getVersions","getMethodTypes","getApplicationInfo","getAvailableApiList","getEvent","actTakePicture","stopRecMode","startLiveview","stopLiveview","actZoom","setSelfTimer","getSelfTimer","getAvailableSelfTimer","getSupportedSelfTimer","setExposureCompensation","getExposureCompensation","getAvailableExposureCompensation","getSupportedExposureCompensation","setShootMode","getShootMode","getAvailableShootMode","getSupportedShootMode","getSupportedFlashMode"]]}
Request Flash: {"id":5,"method":"getSupportedFlashMode","version":"1.0","params":[]}
Response Flash: {"id":5,"result":[["off","auto","on","slowSync","rearSync"]]}
Request speed: {"id":5,"method":"getAvailableShutterSpeed","version":"1.0","params":[]}
Response speed: {"id":5,"error":[1,"Not Available Now"]}
There are a couple things that you can check first:
Do you have the latest version of Smart Remote Control installed?
Do you have the latest firmware update for your camera?

yowsup-cli: registration procedure failing, something unknown is "missing"

I am using yowsup-cli, and it prints the following when I run "yowsup-cli version" ...
yowsup-cli v2.0.13
Using yowsup v2.4
I am trying to perform the registration as specified in the yowsup documentation, as follows. However, it fails.
First, I entered this command, and I indeed got a code back via SMS ...
yowsup-cli registration --requestcode sms --phone 1XXXXXXXXXX --cc 1 --mcc 310 --mnc 260
I then entered this command using the code I got back (shown as "AAA-BBB"), but it failed ...
yowsup-cli registration --register AAA-BBB --phone 1XXXXXXXXXX --cc 1
This is the error message I received ...
status: fail
reason: missing
What I did above is exactly what is described in the yowsup documentation, here: https://github.com/tgalal/yowsup/wiki/yowsup-cli-2.0#yowsup-cli-registration%29 (see the commands listed under "Example:").
Note that I get the same failure when I add the MNC and MCC info to the "--register" command.
Does anyone know why this registration procedure is failing, and what might be "missing" in what I'm doing?
Note that the MCC and MNC I specified are what I found when looking up my cell provider (T-Mobile, USA).
Also, note that I am able to run WhatsApp with no problems from my mobile device, as well as via their web interface.
Thanks for any help and suggestions.
you do not have to put "-" in your otp/code. it will be a plain sms code
yowsup-cli registration --register AAABBB --phone 1XXXXXXXXXX --cc 1
i hope it works

Sending Mail in seaside+Gemstone " a Message: NotUnderstood occurred (error 2010), a UndefinedObject does not understand #'isEmpty' "

Tried with a similar question earlier, but could not I make headway. So I did new tests and here is the new question:
I did a brand new installation of PHARO 1.4 and GEMSTONE 3.0.1.2 on the same machine. (Linux CENTOS). Loaded seaside 3.0 in Pharo and version 3.0.7.1 in Gemstone using the latest version of Gemtools (1.0 beta 87) with the latest version of glass workspace (1.0 beta 8.7.4).
I opened the workspace and evaluated:
(WAEmailMessage
from: (WAEmailAddress address: 'xx#aa.com' username: 'fromMe')
to: (WAEmailAddress address: 'shyam#localhost' username: 'shyam')
subject: 'Email Test')
body: 'This is a Test Email sent';
send.
(BTW, As the default mail host in Gemstone is "mailhost", I added the following line to the /etc/hosts file127.0.0.1 localhost mailhost ).
On Pharo the message is sent and received correctly, while in Gemstone I get
a MessageNotUnderstood occurred (error 2010), a UndefinedObject does not understand #'isEmpty', in the method
readSmtpResult
| result firstChar |
[self readWillNotBlockWithin: 5000]
whileFalse: [GsFile stderr log: 'Waiting for server to write...'].
result := self readString: 500.
result isEmpty =========================> HERE result is "nil".
ifTrue:
[self log: 'Empty result'.
^false].
The reason being that result returns a nil.
I tried with similar results also on MAC OS X which instead went into a loop in the lines above.
Using tcpdump -X -i lo tcp port 25 and WireShark, I noticed that for GEMSTONE, I saw NO activity while the packets were correctly exchanged for PHARO.
Evidently, I am doing something terribly wrong to get it wrong on two different systems.
Any idea ?
Thanks
Shyam.
result is nil because #readString: returned nil.
It seems that the peer does not send any data. As you already traced that there is no activity on port 25 going on, are you sure that the SMTP parameters are correct?
Seaside-Email contains code that you can use to configure your SMTP-Server.
Given you have your Seaside application seasideApp, you can do the following:
seasideApp configuration
addParent: WAEmailConfiguration instance.
seasideApp
preferenceAt: #smtpServer put: 'your.smtp.host';
preferenceAt: #smtpPort put: 25;
preferenceAt: #smtpUsername put: 'your.smtp.username.or.nil.if.unecessary';
preferenceAt: #smtpUsername put: 'your.smtp.password.or.nil.if.unecessary';
yourself.
Note that #smtpServer and smtpPort must be configured the way described, as they are used in the GemStone version of GRPlatform>>#seasideDeliverEmailMessage:. I opted to deliberately not use the GemStone defaults.
Also, setting the SMTP parameters this way is ment to work cross-platform; if it does not, please contact me directly.