Console app to hang-up a number, if not picking

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

 



I even tried as below, but no luck.

static void on_call_media_state(pjsua_call_id call_id)
 {
     pjsua_call_info ci;


     pjsua_call_get_info(call_id, &ci);

     if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) {
         // When media is active, connect call to sound device.
         pjsua_conf_connect(ci.conf_slot, 0);
         pjsua_conf_connect(0, ci.conf_slot);
     }
     if(ci.media_status == PJSUA_CALL_MEDIA_ERROR){
     PJ_LOG(3,(THIS_FILE,"Media has reported error, disconnecting call"));
     pj_str_t reason = pj_str("Takes too long to respond");

 pjsua_call_hangup(call_id,PJSIP_SC_TEMPORARILY_UNAVAILABLE,&reason,NULL);
     }
     if(ci.media_status == PJSUA_CALL_MEDIA_NONE){
     PJ_LOG(3,(THIS_FILE, "Media for call %d is inactive", call_id));
     }
 }

I'm not sure what am I missing here?

Rachel

On Tue, Sep 29, 2009 at 10:38 AM, Rachel Baskaran
<rachelbaskaran at gmail.com>wrote:

> Hey Saul,
>
> I tried as below, it works but it only rings for 4 times and then takes me
> to the person's message box. I already have a callback for media and
> on_call_state.
>
> if(argc < 1)
> {
> pjsua_call_hangup(call_id, PJSIP_SC_TEMPORARILY_UNAVAILABLE, NULL, NULL);
> }
>
> Is there a way to increase the number of rings, 4 is too short I guess?
>
> If this works, I need to try the transfer thing.
>
> Rachel
>
>
> On Mon, Sep 28, 2009 at 6:14 PM, Sa?l Ibarra <saghul at gmail.com> wrote:
>
>> Read the documentation on the callbacks. There is a callback which is
>> called when the media state is changed. You should implement that in
>> the callback. A timer is definitely NOT a clean solution.
>>
>>
>>
>> --
>> /Sa?l
>> http://www.saghul.net | http://www.sipdoc.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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090929/2144aa22/attachment.html>


[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