[Asterisk]Attended transfer using hook flash on a SIP channel - hook

Within our organisation we use quite a few different models of telephone sets. The only thing they have in common, apart from the dialpad, is the ability to "send" hook flash. I prefer using this type of signaling for attended transfers above combinations of the usual dialpad keys to prevent the other end from receiving DTMF-tones (to prevent unwanted interactions with IVRs or bothering people on the other end).
2 questions:
How is a flash hook represented in features.conf? According to RFC2833 section 3.10 (DTMF Events) and this article (which is about a ZAP- instead of SIP-configuration, thus my doubt... see next question, also), it should be just "flash".
From my Google-quest I've learned that hook flash gets ignored by the PBX when using the SIP-protocol in Asterisk... I do get an error message when sending it: "WARNING[26159]: chan_sip.c:6487 sip_indicate: Don't know how to indicate condition 9". Is there a way to fix it/work around it?
Asterisk version: 1.8.3.2
Using "info" for dtmfmode
Tnx in advance!

In most cases you have in you adapter settings what to do with hook. IF you have, you can change that to transfer code.
Update: after code review i can say that DTMF 16 received ok and sended in 1.8.x. BUT features.c have no any action on flash(event 16)
So posible create audiohook application for asterisk to change that DTMF 16 to 2 DTMF values or invoke transfer. Will work for DTMF method SIPInfo, and such patch complexity is below-average(5-6 hours for expert)

Related

Symfony/Mailer 6.x with antiflood plugin?

In want replace deprecated SwiftMailer v6.2.5 with new Symfony/Mailer v6.x. SwiftMailer have a AntiFlood Plugin
$mailer = new Swift_Mailer($transport);
$mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100, 5));
I can't find this for Symfony/Mailer. Does this function(plugin) not yet exist or is this now solved in a completely different way?
Symfony Mailer 6.2 (current) has some parameters that might help to get similar approach as Swifmailer's AntiFlood plugin.
First, lets see how AntiFlood works. According to plugin's docs:
When Swift Mailer sends messages it will count the number of messages
that have been sent since the last re-connect. Once the number hits
your specified threshold it will disconnect and re-connect, optionally
pausing for a specified amount of time
// re-connect after 100 emails with 30 seconds pause in between
$mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100, 30));
If we see official documentation of Symfony Mailer component. We can see some parameters that do exactly the same thing:
restart_threshold (Introduced in Symfony 5.2)
The maximum number of messages to send before re-starting the transport.
restart_threshold_sleep (Introduced in Symfony 5.2)
The number of seconds to sleep between stopping and re-starting the transport.
Here is an example using both parameters together:
$dsn = 'smtps://smtp.example.com?restart_threshold=1000&restart_threshold_sleep=30'
There are two more options in case you don't want to restart the transport, but instead just limit the amount of emails sent per second. See the documentation linked above if that's the case.

Can MessageChannel overflow

I am working on an AS3 project in FDT6. I am using the lastest FLEX 4.6 and AIR 3.7.
I have a worker.swf file that is embedded into the main application to do threading work with.
I am using the MessageChannel class to pass information between the two.
In my main class I have defined
private var mainToWorker:MessageChannel;
private var workerToMain:MessageChannel;
mainToWorker = Worker.current.createMessageChannel(worker);
workerToMain = worker.createMessageChannel(Worker.current);
on the mainToWorker I only ever send messages. In these messages I send a byte array of information. The information is an object that contains a 'command' property and a 'props' property. Basically acting like a function call. The command is a function name and the props is an object that contains data for that function.
mainToWorkerMutex.lock();
mainToWorker.send(ByteArrayUtils.ObjectToByteArray({command:"DoSomething", props:{propA:1,propB:7}}));
mainToWorkerMutex.unlock();
The same occurs for the workerToMain var except I only send byte data that contains the 'message' and 'props' parameters.
workerToMainMutex.lock();
workerToMain.send(ByteArrayUtils.ObjectToByteArray({command:"complete", props:{return:"result"}}));
workerToMainMutex.unlock();
As a sanity check I make sure that the message channels are getting what they should.
It is working fine when I build it in FDT, however when it is built using an ANT script through flash builder I am sometimes getting the 'command' events coming back through in the workerToMain channel.
I am sending quite a lot of data through the message channel. Is it possible that I am overloading it and causing a buffer overflow into the other message channel somehow? How could that only be happening in FB?
I have checked my code many times and I am sure there is nothing in my own code that is sending that message back.
I had similar issue. When sending many bytearrays using channels sometimes things i received was not things i've actually sended. I had 4 channels (message channel to worker, message channel to main, data channel to worker, data channel to main).
I've noticed that data channel to main was affecting message channel to worker. When i turned off data channel to main - message channel to worker stared working just fine :D...
They have a big issue there with sending byte arrays it seems.
But what helped me was using shareable (at first it was not shareable) bytearray for communication via channels, but only for communication, as soon as i am receiving such bytearray i'm copying it to another byte array and parsing a copy.
This removed the problem (made quite hard stress tests there)...
Cheers
P.S. I'm also using static functions (like your ByteArrayUtils) to create bytearray's used for communication, but it seems fine, even made tests using non static functions.
So, it looks like I have found the issue. Looks like it's the ByteArray that is doing it.
ByteArray.toString() is basically sometimes mangles your data meaning you can't really trust it.
http://www.actionscript.org/forums/showthread.php3?t=155067
If you read the comment by "Jim Freer" he mentions how strings sometimes do this.
My solution was to switch to using a JSON encoded string instead of ByteArray data in the message channel. The reason I was using bytearray data to begin with is because I wanted to preserve class definition information, which JSON doesn't do.

Netty: Pipe-ing output of one Channel to the input of an other

Netty-Gurus,
I've been wondering if there is a shortcut/Netty-Utility/smart-trick
for connecting the input of one Channel to the output of
an other channel. In more details consider the following:
Set-Up a Netty (http) server
For an incoming MessageEvent get its ChannelBuffer
and pipe its input to a NettyClient-ChannelBuffer
(which is to be set up along the lines of the NettyServer).
I'm interested in how to achieve bullet-point 3. since my first
thoughts along the lines
// mock messageReceived(ChannelHandlerContext ctx, MessageEvent e):
ChannelBuffer bufIn = (ChannelBuffer) e.getMessage();
ChannelBuffer bufOut = getClientChannelBuffer();// Set-up somewhere else
bufOut.write(bufIn);
seem to me awkward because
A. I have to determine for each and every messageReceived-Event
the target ChannelBuffer
B. To much Low-Level tinkering
My wish/vision would be to connect
--> the input of one Channel
--> to the output of an other channel
and let them do their I/O without any additional coding.
Many thanks in advance!,
Traude
P.S: Issue has arisen as I'm trying to dispatch the various HTTP-requests to the
server (one entry point) to several other servers, depending on
the input content (mapping based on the first HTTP request line).
Obviously, I also need to do the inverse trick -- pipeing back client
to server -- but I guess it'll be similar to the solution of
the question before.
Looks like you need to use a multiplexer in you business handler. The business handler could have a map. With key as "first http request line" and value as the output channel for the server. Once you do a lookup you just do a channel.write(channelBuffer);
Also take a look at bruno de carvalho's tcp tunnel, which may give you more ideas on how to deal with these kind of requirements.

calling a sip phone

im searching for a simple method to "ping" a sip:user#ip and get back a status like "available for call" , "busy" , "not connected" if the first two require to make his phone ring, thats ok
(optionally if necessary to call them to see the status then it was nice to include a senders number so that i can identify my server on the phone display when its checking the status or to play a short signal .wav in case someone takes up, so that they know what it was)
.....something like sipsak -x 1200 -C random#ownip -s sip:adressee#hisip -vvv...
gives me "406 Not Acceptable without Contact header"
i did not try anything else yet
i already wonder if the sending call still needs to be logged in at an isp then?
You're probably looking for the OPTIONS message. The reply to an OPTIONS does two things - first, it tells you the capabilities of the remote party and second, more importantly, the Status-Code returned is the Status-Code you would get if you'd sent an INVITE.
According to sipsak's documentation you're looking for this:
sipsak -vv -s sip:nobody#foo.bar
SIMPLE will work, but it may be overkill for what you want to do. See http://en.wikipedia.org/wiki/SIMPLE
Of course, not all SIP phones support SIMPLE.

Quicklfix related question(FIX::Application)

I am trying to use FIX::Application along with SessionSettings.
The Fix server I am trying to connect to does not see any incoming connection. From my side I see a Logon Message being formulated in toAdmin() callback(which I print out and add certain fields to.
The Question is
1. Do I need to call some form of sendTarget in toAdmin?(I tried that but get a Session not found error)
2. Is there anyway I can increase logging(start logging whats going on under the hood).
Thanks
Firstly the sendTOTarget need not be called in the toAdmin.
As far as logging goes, what i hear is passing th in FIX::LogFactory should be enough.

Resources