Re: PJSIP call, play music and hangup in python

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

 



Have not tried python but something like this works perfectly fine in C.


static pjsua_player_id player_id;
int call_playback_file(pjsua_call_id call_id, char* path, int no_loop)
{
    pj_status_t status =PJ_SUCCESS;
    if (call_id != PJSUA_INVALID_ID) {
        pj_str_t path_as_pjstr = pj_str(path);
        pjsua_player_id player_id;
        status = pjsua_player_create(&path_as_pjstr, no_loop, &player_id);
        if (status == PJ_SUCCESS) {
            status = pjsua_conf_connect( pjsua_player_get_conf_port(player_id),
                                         pjsua_call_get_conf_port(call_id));
            if (status != PJ_SUCCESS) {
                PJ_LOG(1,(THIS_FILE,"Error: Failed to connect file player to bridge with error %d", status));
            }
        } else {
            PJ_LOG(1,(THIS_FILE,"Failed to create WAV player));
        }
    } else {
        PU_LOG(1,(THIS_FILE,"No active call found"));
    }
    return status;
}



Este mensaje y sus adjuntos se dirigen exclusivamente a su destinatario, puede contener información privilegiada o confidencial y es para uso exclusivo de la persona o entidad de destino. Si no es usted. el destinatario indicado, queda notificado de que la lectura, utilización, divulgación y/o copia sin autorización puede estar prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.

The information contained in this transmission is privileged and confidential information intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this transmission in error, do not read it. Please immediately reply to the sender that you have received this communication in error and then delete it.

Esta mensagem e seus anexos se dirigem exclusivamente ao seu destinatário, pode conter informação privilegiada ou confidencial e é para uso exclusivo da pessoa ou entidade de destino. Se não é vossa senhoria o destinatário indicado, fica notificado de que a leitura, utilização, divulgação e/ou cópia sem autorização pode estar proibida em virtude da legislação vigente. Se recebeu esta mensagem por erro, rogamos-lhe que nos o comunique imediatamente por esta mesma via e proceda a sua destruição
_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[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