playing wav in-call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> Play a wav file in-call. Shouldn't this just work?
>>
>> ? ?const pj_str_t *filenameP = &filename;
>>
>> ? ?pjsua_player_id player_id;
>>
>> ? ?pj_status_t status = pjsua_player_create(filenameP, 0, &player_id);
>> ? ?if (status != PJ_SUCCESS) {
>> ? ? ? ?return;
>> ? ?}
>>
>> ? ?status = pjsua_conf_connect(
>> ? ? ? ?pjsua_player_get_conf_port(player_id),
>> ? ? ? ?pjsua_call_get_conf_port(call_id));
>>
>> ? ?if (status != PJ_SUCCESS) {
>> ? ? ? ?return;
>> ? ?}
>>
>> But instead I get
>>
>> ?Assertion failed: (conf && src_slot<conf->max_ports &&
>> sink_slot<conf->max_ports), function pjmedia_conf_connect_port, file
>> ../src/pjmedia/conference.c, line 952.
>>
>> in the conf_connect call. I thought pjsua takes care of creating the
>> ports. No? I must be missing something.
>>
>> Any pointers what? (I am using 1.5.x)
>>
>
> The pjsua_call_get_conf_port() probably returned bad value, probably
> -1, probably because call media is not ready yet.

Well, the call is still in PJSIP_INV_STATE_CALLING and I want to play
the ringback.
Thanks to your suggestion I added a check like this:

    pjsua_player_id player_id;

    pj_status_t status = pjsua_player_create(filenameP, 0, &player_id);
    if (status != PJ_SUCCESS) {
        NSLog(@"Failed to create player");
        return;
    }

    pjsua_conf_port_id src = pjsua_player_get_conf_port(player_id);

    if (src != PJSUA_INVALID_ID) {
        NSLog(@"src port invalid");
        return;
    }

    pjsua_conf_port_id dst = pjsua_call_get_conf_port(call_id);

    if (dst != PJSUA_INVALID_ID) {
        NSLog(@"dst port invalid");
        return;
    }

...and it turns out the src port (pjsua_player_get_conf_port) is invalid.
I just created that one?!
Any further pointers?

cheers
--
Torsten



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux