Hi, Now I had it working. thanks for your help. When I had a call to on_call_media_state, I called pj_caching_pool_init pjmedia_endpt_create pj_pool_create pjsua_set_no_snd_dev pjmedia_snd_port_create_player pjmedia_snd_port_connect but not pjsua_conf_connect(ci.conf_slot, 0);//Rx, I thought the other calls replaced this call, but now I can se the logic. The other calls are also removed to the initialize part now. Best Regards Kresten -----Oprindelig meddelelse----- Fra: pjsip-bounces at lists.pjsip.org [mailto:pjsip-bounces at lists.pjsip.org]Pa vegne af Jens Jorgensen Sendt: 24. september 2009 11:17 Til: pjsip list Emne: Re: [pjsip] pjmedia_snd_no_snd_dev Ok, hmm. I'm actually using the python wrapper aroud pjsua. I call lib.set_null_snd_dev right after calling lib.init. So maybe you need to be calling pjsua_set_no_snd_dev before you end up in on_call_media_state, by that point it should've already initialized the sound device I'm thinking. The sound device port you are creating is bidirectional also, which seems odd to me. Sorry I don't have any other helpful hints. But in general it seems like you are doing something similar to me: I place a call, when the other end answers I play a .wav file to it, and when the .wav file is finished, I hang up. Mine is working beautifully but since I'm using the python layer it's hard to translate between your code and mine. Kresten Tolstrup wrote: > Ok, here is the mail: > > PC1 is making a SIP call to PC2. PC2 is playing a wav file, the wav file > should be heard on PC1. > This is working if I write: pjsua_conf_connect(ci.conf_slot, 0);//Rx, in the > callback function: on_call_media_state(pjsua_call_id call_id). > > If I instead of pjsua_conf_connect(ci.conf_slot, 0);//Rx, write: > > pj_caching_pool_init(&cp, &pj_pool_factory_default_policy, 0); > status = pjmedia_endpt_create(&cp.factory, NULL, 1, &med_endpt); > pool = pj_pool_create( &cp.factory,"app", 4000, 4000, NULL); > cont = pjsua_set_no_snd_dev(); > status = pjmedia_snd_port_create_player(pool, -1, conf->info.clock_rate, > conf->info.channel_count, > conf->info.channel_count*PTIME*conf->info.clock_rate / 1000, > conf->info.bits_per_sample, 0,&snd_port_play); > status = pjmedia_snd_port_connect(snd_port_play, conf); > > then it is not working, what is wrong with the code? > the returned status is PJ_SUCCESS each time. I want to do it in this way, > because the received audio, shall only be sent to the one loudspeaker, and > that part is working, it is not included here, the above code is just to > make it simple. > The function play_cb, in file sound_port.c, is called all the time, but the > frame.type is PJMEDIA_FRAME_TYPE_NONE. > > I have also tried to run "stereo_demo()" from file pjsua_app.c, but there is > neither any audio. > > -----Oprindelig meddelelse----- > Fra: pjsip-bounces at lists.pjsip.org > [mailto:pjsip-bounces at lists.pjsip.org]Pa vegne af Jens Jorgensen > Sendt: 24. september 2009 02:16 > Til: pjsip list > Emne: Re: [pjsip] pjmedia_snd_no_snd_dev > > > I'm using this too, and it seems to work fine for me! But I don't recall > your earlier mail. What was the problem? > > Kresten Tolstrup wrote: > >> Hi, >> >> Is there someone that can help me with the subject pjmedia_snd_no_snd_dev, >> > I > >> sent a mail tuesday this week, and I'm stalled. The subject name is a >> > little > >> misleading >> >> Thank you in advance >> >> Best Regards >> Kresten Tolstrup >> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip at lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > > -- > Jens B. Jorgensen > jbj1 at ultraemail.net > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > -- Jens B. Jorgensen jbj1 at ultraemail.net _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip at lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org