How to call telephone number through asterisk trunk from external application talking through prophecy? - voip

Wow, that title was a mouthful...
I'm sure that sounds very confusing at first glance. This is the basis of what I've got going on:
I have:
-a server set up with Asterisk and Voxeo Prophecy running on it.
-Prophecy set up as extension for Asterisk.
-another server running an external application.
The external application generates some two XMLs: one ccxml and one vxml file, for Voxeo to read and execute, which then initiates a call to (up until today) an asterisk extension.
The project is moving along, though, and yesterday I got a SIP Trunk and a DID number in hopes to turn this application into something that can call real people.
The trunk is working on Asterisk, and I've been able to initiate calls through a softphone (X-lite) to my cell phone number. That works just fine.
However, when I try to initiate calls from the external application, it does not go through. I've tried numerous things to try to fix it but it's just not working.
Prior to the trunk/DID business, the working code to call an asterisk extension was as follows:
<createcall>dest="'sip:*Extension here*#*IP Address here*'"
connectionid="myOutBoundConnectionID" timeout="'45s'" callerid="'*Extension here*
#*IP Address here*'"</createcall>
My first thought was that I might need to have a trunk specified for Prophecy as well as for Asterisk, but I'm probably way off base.
The reformatted code that I thought would work was as follows:
<createcall>dest="'tel:*Phone Number here*'" connectionid=
"myOutBoundConnectionID" timeout="'45s'" callerid="'*Phone Number here*
'"</createcall>
...but this does not work at all.
The log files say things like this when I call from my softphone:
-- Executing [*My phone number*#from-internal:1] Macro("SIP/1001-0000007d", "user-
callerid,LIMIT,") in new stack
but when I call from the external application, things are a little different:
-- Executing [*My phone number*#from-sip-external:1] NoOp("SIP/*IP Address:5080-0000007c",
"Received incoming SIP connection from unknown peer to *phone number*") in new stack
Can anyone shed some light on what is happening here? Thanks in advance!

You should make your reformatted create call look something like this:
<createcall>dest="'tel:*Phone Number here*#*IP Address of Asterisk*'" connectionid= "myOutBoundConnectionID" timeout="'45s'" callerid= "'*Prophecy's Asterisk Extension'"</createcall>
Make sure your Asterisk server has an outbound rule to hit 10-digit phone number via your SIP trunk (I assume it does if your softphone calls work.
Depending on your SIP provider, this may result in your outbound calls appearing to come from the Extension number, not whatever external number you want to present. If you wish to present another number, you probably need to get prophecy to register the SIP station it uses, if you haven't already (in Prophecy's config.xml), in fact you may need/have to do this anyway before this will work.

Related

Creating a windows shortcut (.lnk) in Linux with spaces in the argument to a network share

I am needing to use Puppet to create windows shortcuts on hosts to be accessed via SAMBA. The Puppet side I'll be fine with, it's the script I've been having issues getting working.
I've tried to use:
mslink_v1.3.sh (http://www.mamachine.org/mslink/index.en.html)
pylnk3.py (https://pypi.org/project/pylnk3)
lnk.py (https://github.com/blacklanternsecurity/mklnk)
mslink_v3.sh on first look covers it all, with the exception of what I need to do. Similar with pylnk3.sh and lnk.sh working together, just a different reason for it not to work.
I am trying to create a windows shortcut to a network location with a argument with a space in it. Example below:
Path to exe = \\myhostname\program.exe
Argument = \\myhostname\program.ini loadabc
mslink_v3.sh will not let me surround the argument in single or double quotes, but works fine for network locations. pylnk3.sh/lnk.sh will not work for network locations, argument with spaces are ok via quotes. I did find in the end a code reference in pylink3.sh that network locations have not been implemented yet.
I've not found away to contact the developer of mslink_v3.sh to see about a tweak. I was going to comment on his post on this site, but I did not have enough points (hoping this post may give me enough).
Any suggestions at this point would be good.
Thanks
Matt
I contacted the developer of pylnk3.py via GitHub. He's added network support and also added all the cli support that lnk.py added.
Link below to the branch with all the development included:
https://github.com/strayge/pylnk/tree/cli_options

A phony target for sending a file via e-mail?

I would like to execute a command that takes a specific file in the project (building it as necessary) and sends it somewhere externally. For example, it may be a command that uploads a web page, or sends an e-mail. It may even write some additional files, such as a log, but that is not the point of calling it.
In other words, this action is evoked by naming its source, rather than the target — either because there is no tangible target, or it is insignificant and the action is primarily wanted for its side effect.
I see it that an extra command line argument will have to be provided, like this:
% BuildSystem send pizza.box
The command above should be equivalent to the following:
% BuildSystem pizza.box
% send pizza.box
Can (and "should") this be performed with the shake build system?
P.S. As Daniel suggests in an answer, I can extend shake's argument parser. But I am not sure if this is the best practice for a case like this. It seems a little at odds with the way shake behaves, treating every single command line argument as a self-contained goal. It is also a whole new logic for the operator to design, so much overhead for such a menial task.
It might be more intuitive to request a receipt file for each box that is sent. For instance:
% BuildSystem pizza.receipt
— would then be equivalent to:
% BuildSystem pizza.box
% send pizza.box >pizza.receipt
On the downside, as I understand from an official answer to a question nearby,we cannot have a pseudo-target like pizza.send that does not actually result in a file pizza.send being created. So I am not sure, again, if this is the right way.
P.S. 2 It would be even better if we could replace the default "file exists" success verifier with a custom code. For instance, instead of verifying that a file pizza.receipt (that we otherwise have no need for) was indeed created, we may telephone the customer and ask them if they enjoyed the lunch. If we can arrange that, we can then invoke the corresponding rule with a "pseudo-file" target pizza.send. In general, build artifacts need not reside on the local file system at all, insofar as the code that can verify and retrieve them is given.
The answer depends on whether you want to send the email once, or repeatedly, even if pizza.box doesn't change. In both cases let's imagine you want to write BuildSystem send.pizza.box to cause the email to be sent.
Send every time
If you want to send a copy of pizza.box every time you can use a phony rule:
phony "send.pizza.box" $ do
need ["pizza.box"]
cmd_ "send-email" "pizza.box"
If you want that to work for all files, you can generalise to:
phonys $ \s -> case stripPrefix "send." s of
Nothing -> Nothing
Just file -> Just $ do
need [file]
cmd_ "send-email" [file]
Send once
If you only want one copy of each changed pizza.box to be sent then you need to record evidence of that locally, to stop sending successive copies. The easiest way to do that is actually create a file send.pizza.box:
"send.*" %> \out -> do
let src = drop 5 out
need [src]
cmd_ "send-email" [src]
writeFile' out ""
If you strongly want to avoid writing the send.pizza.box file you can use the phony technique from above combined with addOracle (but it's unlikely to be worth the additional hassle).
Yes, shake supports this via phony.

Make one time only activation code to python code, and make updates available?

I'm coding a program to do some action with webdriver and Autoit in python, I want to do two things before I start selling my code:
Add onetime activation code to my software on one PC, like to make the program works only on one pc.
Make my program able to receive updates from the internet once I add to the code some more features or correct some others.
is it possible only with Python? or what is the method statement to do it?
On client side you need use hard-disk serial or/and uuid of partition or Operational System timestamp + something to generate serial code .
On server side , you need a API to store hard disk serial to validate if this is a computer valid . And you client on load check if activaction is valid .
The second question i can't answer .
Regarding the second part of your question:
Create a text file with the latest version of your application and put it on your webserver e.g. http://download.example.com/example-app-version.txt to get and read its value later.
On your python code download and read the text (for Python 3+ use 'import urllib.request' and urllib.request.urlretrieve) when your app runs and compare it against the installed version (if statement).
E.g.
if latestVer > installedVer:
#update
else:
#application continues

Auto-correlation callback function issue - loadrunner

I'm working in new application written in Siebel 8.1, issue appears when I'm trying to replay script and I can't handle that.
Replay Output:
Error -27086: Auto-correlation callback function
"flCorrelationCallbackParseWebPage" failed (rc=1) for parameter
"Siebel_Parse_Web_Page40"
web_reg_save_param("Siebel_Parse_Web_Page40",
"LB/IC=",
"RB/IC=",
"Ord=1",
"Search=Body",
"RelFrameId=1",
"AutoCorrelationFunction=flCorrelationCallbackParseWebPage",
"AutoCorrelationDll=LrwiSiebelCorrelationWrapper",
LAST);
I have done all steps for prepare record options from: http://software-qe.blogspot.se/2008/01/siebel-7x-record-and-replay-for.html
I'm using Loadrunner 11.52 (Siebel Web protocol), IE8.
We've been using the autocorrelation library for quite a few years on my team and we see this a lot. Unfortunately, it's not an easy problem to diagnose.
First I would check your test results and your VUser log to see if something happened before the autocorrelation failed. (Make sure your logging is set to parameter substitution in runtime settings).
Check your parameter files for extra spaces, commas, etc. Sometimes I've seen that error right after it rejects something about your parameter file.
Worst case scenario, your script is corrupted and you'll have to start over. We've gotten in the habit of making frequent backups of our scripts just because of this issue. Usually, we'll be able to start from our backup and continue or create a new script and paste the old code in. Autocorrelation error "magically" goes away with the same code in a new script.
If auto(magical)correlation does not work then use manual correlation.
Record twice with same data: Compare. You will find session, state and time data.
Change the credentials: Re-record. Compare. You will find credential related correlation
Change the business record but keep the same business process. Re-Record. You will find the business related correlation.
Do not expect autocorrelation to provide a magical working script. You have about a 0.0001% chance of that happening without LoadRunner script development intervenetion.

How to disable "header already sent" message on linux, cpanel?

I building my sites on the localhost (runs wamp on windows), and when I upload it to my server, I always get
"Cannot modify header information - headers already sent"
I understand that there shouldn't be any blank lines and everyhing, and usually this works out. but now I need to redirect someone after the header has been sent, how can I make my server act like my localhost ?
i'm using cpanel and WHM:
cPanel 11.25.0-R42399 - WHM 11.25.0 - X 3.9
CENTOS 5.4 x86_64 virtuozzo on vps
I will appreciate any help
In short, you need to prevent PHP from outputting anything to the browser before you get to the point where you want to use the header() function.
This should be done by careful programming practices, of which your 'no blank lines' is one, or by storing PHP's output in an output buffer, and only outputting when you're ready for it.
See the ob_start() and ob_flush() methods. You use ob_start() at the start of your application. This disables output and stores it into a buffer. When you're ready to start outputting, use ob_flush() and PHP will send the buffer's contents to the browser, including the headers that are set till that point. If you don't call ob_flush() then the buffer is output (flushed) at the end of the script.
The reason why it works on your WAMP development environment is most likely that output buffering is already enable by default in the php.ini. Quite often these all-in-one packages enable a default buffer for the first 4k bytes or so. However, it is generally better to explicitly start and flush the buffer in your code, since that forces better coding practices.
Well,
I guess by more thinking and better programing you can manage to keep all redirects before any HTML is written.
This problem solved by the old rules...
#user31279: The quickest and dirtiest way I know of is to use # to suppress the warning, so e.g.
#header('Location: some-other-page.php');

Resources