[Asterisk-Dev] channel module ast_rtp questions

Alper Akçan distch at hotmail.com
Mon Mar 14 04:28:11 MST 2005


hi,

I am a bit confused with ast_rtp functions, I am trying to build a channel 
module for asterisk. I have a ip telephone, an asterisk box, and a 
development device that is capable of handling rtp packets. i can connect 
the ip telephone, and the device over asterisk, but what i am doing is;
when asterisk is talking with the phone, I get that artp struct and tell the 
device "from now on talk with this ip", bypassing the asterisk. so 
module_read, and moudle_write functions are never called.

it works, and seems ok. but I want to do this via module_read, and 
module_write functions. So I decided to do something like this,
1. create a rtp for the device via ast_rtp_new() when astersik calls 
module_answer()
2. call ast_rtp_read() when module_read() function called. Get the rtp data 
from the device and give it to asterisk.
3. call ast_rtp_write() when module_write() function called. get the rtp 
data from asterisk and give it to the device.

it seems quite easy, but i have not able to manage it. i think i 
misundrstood the as_rtp_functions. how should i prepare the rtp struct? to 
make asterisk to talk with the device? I have no problems with the device, I 
say it talk to this ip on this port and it starts to talk.

ast_rtp_new(NULL, NULL, 0, 0);
ast_rtp_set_peer(..., ???? (asterisk`s ip? device`c ip?);

I have tried so many things, and really confused.

thanks for any help.

best regards.

alper.

_________________________________________________________________
En etkili ve güvenilir PC Korumayi tercih edin, rahat edin! 
http://www.msn.com.tr/security/




More information about the asterisk-dev mailing list