[asterisk-dev] Manipulating audio in asterisk

Klaus Darilion klaus.mailinglists at pernau.at
Wed Apr 21 03:40:03 CDT 2010


One way to implement it would be to write an application. The 
application will create a local channel (similar like 
Dial(Local/ext at context)).

E.g. application Stegano(e|d,ext at context[,data]). The first parameter 
tells the application if it should Encrypt oder Decrypt the data. The 
second parameter is the dialplan exteenstion and context were further 
diaplan handling will be done.

e.g. AST1
[fromSipPhone]
exten => _+43.,1,Stegano(e,${EXTEN}@toAst2,secretdata)

[toAst2]
exten => _+43.,1,Dial(SIP/${EXTEN}@AST2)


e.g. AST1
[fromAst1]
exten => _+43.,1,Stegano(d,${EXTEN}@toSipPhone,othersecretdata)

[toSipPhone]
exten => _+43.,1,Dial(SIP/phone1)

Stegano(e) will read the voice frames from the SIP channel 
(phone,incoming channel) add the stegano data, and write it to the local 
channel (outgoing channel). Further it will read voice frames from the 
local channel, remove the stegano data and write it to the channel of 
the SIP phone.
Stegano(d) will read the voice frames from Ast1 (incomig channel), 
remove the stegano data, and write it to the local channel (outgoing 
channel). Further it will read voice frames from the local channel, add 
the optional stegano data and write it to the SIP channel.

Of course you would also need to implement that the received data is 
somewhere stored, e.g. written to a file or a channel variable.

Drawback of this approach is, that Asterisk may do some transcoding in 
the path (e.g. after the local channel is created), which may destroy 
the stegano data.


Asterisk trunk has a new implementation of channel briges (search the 
mailing list archive, the were recently some threads about how it 
works). You could add a new bridge implementation which adds/remove the 
stegano data.

regards
klaus

Am 21.04.2010 09:17, schrieb Slawek Sloma:
> Hello All,
>
> i am a student and new to asterisk. What i am trying to do is to implement
> a steganographic method to hide data into the audio of a PSTN call.
> To do that, on one end of the call I am trying to modify the audio that
> is sent and on
> the other end of a call I am trying to retrieve that data.
>
> I have wrote a dialplan function (based on func_volume.c) that does this
> using audiohooks.
> Unfortunately i think that i don't understand how audiohooks work
> because I think I can't
> get only the audio from one end point of a call, modify it and send to
> another end point - I am
> modifying how I understand it the "audio in a channel" - that is mixed
> audio from both end
> points of a call. I hope you will understand me ;)
>
>
> Here is a diagram what I have at home:
>
> SIP-UA1 -> AST1 -> PSTN -> AST2 -> SIP-UA2
>
> The call is between sip-ua1 and sip-ua2 - I would like to inject
> information in
> one asterisk server and retrieve them in another
>
>
> Thanks,
> Sławomir Słoma
>



More information about the asterisk-dev mailing list