Stefan Märkle
2004-Sep-28 23:18 UTC
[Asterisk-Users] GSM phones, bluetooth and general hapiness
Hi Stefan,> At the moment I'm into the Bleuz mailing list for getting the SCO > feature to work, starting with my laptops BT and my dads Nokia. > > I have now a basic understanding from the RFCOMM layer which delivers > the AT commands, AT works. If I get the basic SCO functions > working with > the test tools, to get the headsetfunction itself into the > pc. The Nokia > doesn't mind it seems to transfer SCO data according to > hciconfig, but I > can't verify it yet.Are you aware of the snd-bt-sco - Driver for the alsa sound system. They already have found means to send and receive audio with sco, impementing the other end of the bluetooth headset profile. http://www.dcs.gla.ac.uk/~jp/snd-bt-sco/ But codec and signalling looks quite symetric on a first glance, so the actual handling of the channel's audio data should be similar to the above project. Stefan M?rkle
Stefan de Konink
2004-Sep-29 04:58 UTC
[Asterisk-Users] GSM phones, bluetooth and general hapiness
Stefan M?rkle wrote:> Are you aware of the snd-bt-sco - Driver for the alsa sound system. They already have found means to send and receive audio with sco, impementing the other end of the bluetooth headset profile.I saw this version and its update too. Only for a permanent solution its not that ideal 1) It is not developed anymore 2) The Bluez-guys aren't very happy about this implementation style 3) You need chan_alsa. The point is I do not hear any mp3 while calling to the phone by trying to use the Bluez headset utilities to make my laptop act as headset. This driver is also for a headset to a pc, not a pc to a phone. Stefan de Konink
Eric Bart
2004-Oct-05 15:31 UTC
[Asterisk-Users] new version of axra, includes multi-threading and a talking caller id in english and french
axra is a framework for processing an agi while using the * manager api. it should help in developping outside apps. the talking caller id app use a tts engine, either festival for english, either mbrola/lliaphon for french. there's also a "Say" app for french tts. download : http://byortek.com/asterisk/download/ Regards Eric Below is the copy of the REAME file : axra is an interface program that dialogs with asterisk through agi calls and through the manager api. it proccesses phone calls through agis and concurently through the manager api. it provides a framework for managing complex telephony functions. axra receives agi commands from the dial plan. the agi program is 'axraagi'. it is copied in /var/lib/asterisk/agi-bin. 'axraagi' is just forwarding (back and forth) the datas to axra. there may be several concurent agis. axra reads the asterisk state through the manager api messages. it stores and maintains its own description of the asterisk state. when needed axra sends commands to asterisk either through agis or through the manager api. axra is multi-threaded. once in a thread, axra apps may register events and wait for events to occur. there are manager api events, agi events and timer events. events can only occur during a CheckGroup() command. Normally you wait for a single event, if another event occur, an exception is thrown. Here's an excerpt from app-test.c : /* Test app This app will create the sound prompt : "please press a key for hangup" on first run, it will play beeps while computing the audio, next times the prompt will be played immediatly. the user will hear the key he pressed and the call will hangup. after 20 seconds of inactivity the call will automatically hangup. To use it, add the following in your dialplan : exten => xxx,1,AGI(axraagi|Test) run axra and dial the xxx extension. */ void * test(void * ptr) { // as is the agi instance created in the dialplan BKagiSession * as = reinterpret_cast<BKagiSession *>(ptr); // instance creation of the events (with a debugging string) BKastRegEv REvAsChanHangup("Manager api hangup event"); // for hangup detection BKagiRegEv REvAgi("Agi Event"); // for waiting for agi commands BKtimerRegEv REvTimeout("Timeout"); // timeout event BKregEv REvNull("Null event"); // null event, never up try { // exceptions may occur in this block, like "throw (BKregEv *)REvTimeout;" // register exceptions events. events can only occur after their registration REvAsChanHangup.Register(Hangup, as->agi_channel); // will detect hangup of as agi channel REvTimeout.Register(20); // Event will be up in 20 seconds as->SendStringToAgi("answer"); // answer the channel as->SendStringToAgi("exec SetLanguage en"); // choose english language // create the custom prompt sound file "please press a key for hangup". the file will be // stored in the axra asterisk sound directory. the asterik and unix filemames are filled in. string ttsfilenameAst; string ttsfilenameUnix; getTtsAudio("please press a key for hangup", "axra", "en", "", ttsfilenameAst, ttsfilenameUnix); // play beep each 2 seconds while the tts is being computed // the while condition is always true but exception events may occur during the 2 seconds waiting time do if (access(ttsfilenameUnix.c_str(), F_OK) == 0) // test existence of the audio file break; // skips immediatly if the file already exists else as->SendStringToAgi("exec playback beep"); while (BKregEv::CheckGroup(&REvNull, 2) < 1); // check and wait 2 seconds // play the prompt in loop and wait for a pressed key or an exception while (BKregEv::CheckGroup(&REvNull) < 1) { // always true but exception events may occur as->SendStringToAgi("get data " + ttsfilenameAst + " 1500 1"); // play the tts audio // wait for asterisk response to the "get data" command and store it in resp REvAgi.Register(as,""); // will wait for all queued agi commands to be responded while (BKregEv::CheckGroup(&REvAgi) < 1); // wait here string resp = REvAgi.GetResponse(); // get the response to the last agi command // see if the user pressed a key if(resp.find("200 result=")==0) { if(resp.length()==12) { // the user pressed a key char key = resp[11]; // key is the key ast_log(LOG_DEBUG,"the user pressed the key %c", key); BKregEv::CheckGroup(&REvNull, 0.5); // wait 0.5 seconds string command = "exec SayDigits "; command += key; as->SendStringToAgi(command); // say the key break; // the end } } } } catch(BKregEv * up) { // we jump here either by timeout or by user hangup ast_log(LOG_DEBUG,"BKregEv exception catched: %s", up->DebugName.c_str()); } as->AgiExit(1); // hangup and close the agi as->AuthorizeDeletion(); // allow the cleaner to clean the 'as' instance }