I'm trying to initiate calls using the ARI API, the process I followed was
POST /ari/channels to create channel 1 to the local extension
POST /ari/bridges to create a bridge
POST /ari/bridges/{bridge-id}/addChannel with channel 1
POST /ari/channels to create channel 2
POST /ari/bridges/{bridge-id}/addChannel with channel 2
I have a websocket connection waiting for the correct events (like channel status up) before calling the POSTs.
The problem I'm having is this works using internal extension numbers for channel 1 and channel 2, but when using an external number for channel 2 I get the error - "Allocation failed".
Any ideas where I'm going wrong...
Im creating my calls via ARI like this:
http://{ARIUser}:{ARIPass}#localhost:8088/ari/channels?endpoint=SIP/{exten to call from}&extension={number/exten to call}&context=from-internal&priority=1&callerId={callerID}
When you create channel with ARI to address "/ari/channels" you MUST define "extension" or "application" parameters (read more https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Channels+REST+API#Asterisk12ChannelsRESTAPI-originate).
Digitum make very unusable Python ari module and you may play with my module (now not implemented events) on https://github.com/vit1251/ari2.
Related
I have 2 independent python 2 applications running in the same linux (ubuntu) computer.
I want to send messages from one to another (bidirectional) and receives these messages inside a callback function.
Is it possible? Do you have any example as reference?
Thanks
There are different options available for communicating between python apps.
A simple one would be to use an API based on HTTP. Each application will expose an specific port and communication takes place by exchanging HTTP requests.
There are several frameworks that allow you to build it in few steps. For example, using Bottle:
In app1:
from bottle import route, run, request
#route('/action_1', method='POST')
def action_1_handler():
data = request.json
print(str(data))
# Do something with data
return {'success': True, 'data': {'some_data': 1}}
run(host='localhost', port=8080)
In app2:
import requests
r = requests.post("http://localhost:8080/action_1", json={'v1': 123, 'v2': 'foo'})
print r.status_code
# 200
data = r.json()
# {u'data': {u'some_data': 1}, u'success': True}
Note that if the action executed at app1 after receiving the HTTP request takes lot of time, this could result in a timeout error. In such a case, consider to run the action in another thread or use an alternative communication protocol (e.g. sockets, ZeroMQ Messaging Library).
Some related reads:
Basic Python client socket example
Communication between two python scripts
https://www.digitalocean.com/community/tutorials/how-to-work-with-the-zeromq-messaging-library
I've been using a sim900 module to replicate many of the functions found in a basic cellphones for an embedded project. I've been successful with most functions with the exception of entering options during a voice call. I am actually looking for a generic solution (e.g. GSM 07.07 etc.) although the GSM/GPRS Module I'm using is the sim900.
Scenario: I initiate a call using ATD<number>; ,then automated voice asks me to dial "1" for an option. How do I send the "1"?
I've search high and low for an answer. I've been through the AT command manual over and over again. Please help.
Very good start in using the official GSM specification, although I want to note that 07.07 has been superseded by 27.007 a very long time ago, and you should use that document (or 27.005 if relevant).
I initially expected there to be two ways of achieving this, dial string modifiers or DTMF command, but I looking up the dial string in the 27.007 specification I do not find the p (pause) modifier1 I was expecting, and nearest thing, the W (wait) modifier is ignored and only included for compatibility.
Sending 0 through 9, A through D, * and # during a call is done using DTMF, although in a GSM network this is signalled separately out of band rather than sending in-band analogue tones. There is a specific command for sending DTMF tones called AT+VTS (with a horrible syntax). So that command is the answer to you question. Invoke it either from online command mode or from another serial connection.
1 The reason I was expecting a p modifier to exist is that I am able to enter one in phone book entries, e.g. `"12345678p123" which will dial 12345678, wait for the connection to be established and then send 123 as DTMF tones. But this is then obviously something (only) the user interface voice call handler manages and not the AT command handler.
I'm currently trying to setup a web-socket server on an SAP application server as a proof of concept. The application which is connecting to the web-socket server is not going to be a UI5 or WebDynpro application but just a middle-ware program running on a headless computer.
Following a quick guide, I've setup the push channel and I have an object with the interface methods ON_START, ON_MESSAGE and etc. I'm currently testing the interface using wscat which you can get from npm.
When I tried connecting to my service for the first time using wscat I was receiving a HTTP 500 error.
I wasn't sure why I was getting the 500 error, so I tried to access the URL via http and a web browser to see what was happening.
500 SAP Internal Server Error
ERROR: Cross-Site Request Forgery (XSRF) check has failed ! (termination: ABORT_MESSAGE_STATE)
I had seen these tokens also in use by Gateway services, so I had created a quick gateway service and sent a GET request with X-CSRF-Token: Fetch except the token that I get from this doesn't work when I attempt to use uri parameter sap-XSRF.
Going forward, I started to debug CL_APC_MANAGER function HANDLE_REQUEST to see if my request comes in at all. I also wanted to trace where the origin of the 500 error comes from. I've managed to trace it back to CL_APC_MANAGER method CHECK_XSRF.
METHOD check_xsrf.
DATA: lv_xsrf_token TYPE string.
*
* validate XSRF token
*
lv_xsrf_token = i_server->request->get_form_field( name = if_http_form_fields_sap=>sap_xsrf ).
IF lv_xsrf_token IS INITIAL.
lv_xsrf_token = i_server->request->get_header_field( name = if_http_form_fields_sap=>sap_xsrf ).
ENDIF.
IF lv_xsrf_token IS INITIAL.
r_successful = abap_false.
ELSE.
CALL METHOD i_server->validate_xsrf_token
EXPORTING
token = lv_xsrf_token
IMPORTING
successful = r_successful
EXCEPTIONS
token_not_found = 1
cookie_not_found = 2
internal_error = 3
called_by_public_service = 4
OTHERS = 5.
IF sy-subrc <> 0 OR abap_false = r_successful.
r_successful = abap_false.
ELSE.
r_successful = abap_true.
ENDIF.
ENDIF.
ENDMETHOD.
If I skip this check manually with the debugger, than I'm able to connect to my web-socket server without a problem.
However I'm not sure at all how I'm actually supposed to get this token before attempting to connect. I noticed the XSRF Tokens are saved in database table SECURITY_CONTEXT. The only problem is an entry is created in this table with the key I need to have after I attempt to connect. I need it before and I'm not sure what the procedure is for retrieving a token properly.
Is there anybody with previous experience using these that can shed some light? Thanks in advance.
EDIT I'm using Version 740 with Service Pack 4.
The "correct" way to do have the header generated correctly is by maintaining table APC_CROSS_ORIGIN (transaction SAPC_CROSS_ORIGIN).
WebSockets functionality was only released for customer use in 7.40SP5, which probably explains why you don't have that table in your system. I'd recommend using your workaround for now, until your system has been patched.
I need tips to build an infrastructe to send 1000 simultaneous voice calls (automated IVR calls with voicexml). Up to now i used asterisk with voiceglue but now i have performance issues.
The infrasturcture was like this:
the asterisk pulls request from queue
the queue consumer create a call file
when the call ends, call file is read and status is sent to the application server
To be honest, i am asking for tips to implement an infrastructure like callfire[1] or voxeo[2]?
[1]https://www.callfire.com/
[2]http://voxeo.com/
you can go with voxeo prophecy (http://voxeo.com/prophecy/) one of the good server which have the capability of making simultaneous voice calls
Note: The requirement which your are expecting to do will not only possible with voxeo prophecy it should also depend the web server like Tomcat, IIS e.t.c in case if you dealing with databases like Sql , Oracle e.t.c
Please do refer to know the architecture
http://www.alpensoftware.com/define_VoiceOverview.html
CallFire's API has a CreateBroadcast method where you can throw up an IVR using their XML in seconds. You can read up on the documentation here:
https://www.callfire.com/api-documentation/rest/version/1.1#!/broadcast
CallFire also offers a PHP-SDK, hosted on Github, with examples of how to do this. The SDK is minimal setup and allows you to easily tap into the APIs robust functionality. Version 1.1 can be found here, with instructions on how to get started: https://github.com/CallFire/CallFire-PHP-SDK
The method call might look something like this. Note the required dependencies.
<?php
use CallFire\Api\Rest\Request;
use CallFire\Api\Rest\Response;
require 'vendor/autoload.php';
$dialplan = <<<DIALPLAN
<dialplan><play type="tts">Congratulations! You have successfully configured a CallFire I V R.</play></dialplan>
DIALPLAN;
$client = CallFire\Api\Client::Rest("<api-login>", "<api-password>", "Broadcast");
$request = new Request\CreateBroadcast;
$request->setName('My CallFire Broadcast');
$request->setType('IVR');
$request->setFrom('15551231234'); // A valid Caller ID number
$request->setDialplanXml($dialplan);
$response = $client->CreateBroadcast($request);
$result = $client::response($response);
if($result instanceof Response\ResourceReference) {
// Success
}
You can read this:
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
Main tip: you WILL have ALOT of issues. If you are not expert with at least 5 years development experience with asterisk, you have use already developed dialling cores or hire guru. There are no opensource core that can do more then 300 calls on single server.
You can't do 1000 calls on single asterisk in app developed by "just nice developer". It will just not work.
Task of create dialling core for 1000 calls is "rocket science" type task. It require very special dialling core, very special server/server tunning and very specialized dialler with pre-planning.
1000 calls will result 23Mbit to 80Mbit bandwidth usage with SMALL packets, even that single fact can result you be banned on your hosting and require linux network stack be tunned.
You can use ICTBroadcast REST API to integerate your application with reknown autodialer , please visit following link for more detail
http://www.ictbroadcast.com/news/using-rest-api-integerate-ictbroadcast--third-party-application-autodialer
ICTBroadcast is based on asterisk communication engine
I've already done this for phone validation and for phone message broadcasting using Asterisk and Freeswitch. I would go with Freeswitch and xmlrpc:
https://wiki.freeswitch.org/wiki/Freeswitch_XML-RPC
I am trying to issue a SSO ticket for a FTP send port. I have created affiliate application with a mapping that is working for a receive port.
For the send port I am using a pipeline component in encode stage with just standard code:
ISSOTicket ssoTicket = new ISSOTicket();
inmsg.Context.Promote("SSOTicket",
"http://schemas.microsoft.com/BizTalk/2003/system-properties", ssoTicket.IssueTicket(0));
return inmsg;
When I try to promote the result from IssueTicket(0) I get an error message saying that
The property "SSOTicket" has a value with length greater than 256 characters.
How is that even possible?
I solved it. The problem was that I tried to promote the SSOTicket property when I should have used inmsg.Context.Write.