How can I quit pjsua app, when I press 'h'?

RB
Rachel Baskaran
Mon, Sep 28, 2009 4:30 PM

Hey,

Can anyone tell me, how to quit pjsua once I hangup. I meant I waan replace
the quit option with hang-up.

/* Console option for hangup and quit */
char option[10];

puts("Press h to hangup all calls, 'q' to quit");
if(fgets(option, sizeof(option), stdin) == NULL){
puts("EOF while reading stdin, will quit now...");
break;
}

if(option[0] == 'q')
break;

if(option[0] == 'h')
pjsua_call_hangup_all();
}

/* Destroy PJSUA on quit */
pjsua_destroy();
return 0;
}

This part of code hangs-up once 'h' is pressed and quits once 'q' is
pressed. I want to do the job of quit once 'h' is pressed.
Any help!

Hey, Can anyone tell me, how to quit pjsua once I hangup. I meant I waan replace the quit option with hang-up. /* Console option for hangup and quit */ char option[10]; puts("Press h to hangup all calls, 'q' to quit"); if(fgets(option, sizeof(option), stdin) == NULL){ puts("EOF while reading stdin, will quit now..."); break; } if(option[0] == 'q') break; if(option[0] == 'h') pjsua_call_hangup_all(); } /* Destroy PJSUA on quit */ pjsua_destroy(); return 0; } This part of code hangs-up once 'h' is pressed and quits once 'q' is pressed. I want to do the job of quit once 'h' is pressed. Any help!
SI
Saúl Ibarra
Mon, Sep 28, 2009 6:41 PM

Well, adn how do you pretend to hangup the calls? You'll have to decide...

On Mon, Sep 28, 2009 at 6:30 PM, Rachel Baskaran
rachelbaskaran@gmail.com wrote:

Hey,

Can anyone tell me, how to quit pjsua once I hangup. I meant I waan replace
the quit option with hang-up.

/* Console option for hangup and quit */
char option[10];

puts("Press h to hangup all calls, 'q' to quit");
if(fgets(option, sizeof(option), stdin) == NULL){
puts("EOF while reading stdin, will quit now...");
break;
}

if(option[0] == 'q')
break;

if(option[0] == 'h')
pjsua_call_hangup_all();
}

/* Destroy PJSUA on quit */
pjsua_destroy();
return 0;
}

This part of code hangs-up once 'h' is pressed and quits once 'q' is
pressed. I want to do the job of quit once 'h' is pressed.
Any help!


Visit our blog: http://blog.pjsip.org

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

Well, adn how do you pretend to hangup the calls? You'll have to decide... On Mon, Sep 28, 2009 at 6:30 PM, Rachel Baskaran <rachelbaskaran@gmail.com> wrote: > Hey, > > Can anyone tell me, how to quit pjsua once I hangup. I meant I waan replace > the quit option with hang-up. > > /* Console option for hangup and quit */ > char option[10]; > > puts("Press h to hangup all calls, 'q' to quit"); > if(fgets(option, sizeof(option), stdin) == NULL){ > puts("EOF while reading stdin, will quit now..."); > break; > } > > if(option[0] == 'q') > break; > > if(option[0] == 'h') > pjsua_call_hangup_all(); > } > > /* Destroy PJSUA on quit */ > pjsua_destroy(); > return 0; > } > > This part of code hangs-up once 'h' is pressed and quits once 'q' is > pressed. I want to do the job of quit once 'h' is pressed. > Any help! > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -- /Saúl http://www.saghul.net | http://www.sipdoc.net
RB
Rachel Baskaran
Mon, Sep 28, 2009 6:49 PM

Lets say I call a specified uri.
pjsua(exe) sip:user@sipprovider.com sip%3Auser@sipprovider.com

Once I decide to hang-up by pressing 'h and hit enter, I want the call to
not only hang-up the call but also quit pjsua at same time.

Rachel

On Mon, Sep 28, 2009 at 2:41 PM, Saúl Ibarra saghul@gmail.com wrote:

Well, adn how do you pretend to hangup the calls? You'll have to decide...

On Mon, Sep 28, 2009 at 6:30 PM, Rachel Baskaran
rachelbaskaran@gmail.com wrote:

Hey,

Can anyone tell me, how to quit pjsua once I hangup. I meant I waan

replace

the quit option with hang-up.

/* Console option for hangup and quit */
char option[10];

puts("Press h to hangup all calls, 'q' to quit");
if(fgets(option, sizeof(option), stdin) == NULL){
puts("EOF while reading stdin, will quit now...");
break;
}

if(option[0] == 'q')
break;

if(option[0] == 'h')
pjsua_call_hangup_all();
}

/* Destroy PJSUA on quit */
pjsua_destroy();
return 0;
}

This part of code hangs-up once 'h' is pressed and quits once 'q' is
pressed. I want to do the job of quit once 'h' is pressed.
Any help!


Visit our blog: http://blog.pjsip.org

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

Lets say I call a specified uri. pjsua(exe) sip:user@sipprovider.com <sip%3Auser@sipprovider.com> Once I decide to hang-up by pressing 'h and hit enter, I want the call to not only hang-up the call but also quit pjsua at same time. Rachel On Mon, Sep 28, 2009 at 2:41 PM, Saúl Ibarra <saghul@gmail.com> wrote: > Well, adn how do you pretend to hangup the calls? You'll have to decide... > > On Mon, Sep 28, 2009 at 6:30 PM, Rachel Baskaran > <rachelbaskaran@gmail.com> wrote: > > Hey, > > > > Can anyone tell me, how to quit pjsua once I hangup. I meant I waan > replace > > the quit option with hang-up. > > > > /* Console option for hangup and quit */ > > char option[10]; > > > > puts("Press h to hangup all calls, 'q' to quit"); > > if(fgets(option, sizeof(option), stdin) == NULL){ > > puts("EOF while reading stdin, will quit now..."); > > break; > > } > > > > if(option[0] == 'q') > > break; > > > > if(option[0] == 'h') > > pjsua_call_hangup_all(); > > } > > > > /* Destroy PJSUA on quit */ > > pjsua_destroy(); > > return 0; > > } > > > > This part of code hangs-up once 'h' is pressed and quits once 'q' is > > pressed. I want to do the job of quit once 'h' is pressed. > > Any help! > > > > _______________________________________________ > > Visit our blog: http://blog.pjsip.org > > > > pjsip mailing list > > pjsip@lists.pjsip.org > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > > > -- > /Saúl > http://www.saghul.net | http://www.sipdoc.net > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >
SI
Saúl Ibarra
Mon, Sep 28, 2009 6:53 PM

You can join the two if statements:

if(option[0] == 'h')
pjsua_call_hangup_all();
break;
}

That may work ;)

On Mon, Sep 28, 2009 at 8:49 PM, Rachel Baskaran
rachelbaskaran@gmail.com wrote:

Lets say I call a specified uri.
pjsua(exe) sip:user@sipprovider.com

Once I decide to hang-up by pressing 'h and hit enter, I want the call to
not only hang-up the call but also quit pjsua at same time.

Rachel

On Mon, Sep 28, 2009 at 2:41 PM, Saúl Ibarra saghul@gmail.com wrote:

Well, adn how do you pretend to hangup the calls? You'll have to decide...

On Mon, Sep 28, 2009 at 6:30 PM, Rachel Baskaran
rachelbaskaran@gmail.com wrote:

Hey,

Can anyone tell me, how to quit pjsua once I hangup. I meant I waan
replace
the quit option with hang-up.

/* Console option for hangup and quit */
char option[10];

puts("Press h to hangup all calls, 'q' to quit");
if(fgets(option, sizeof(option), stdin) == NULL){
puts("EOF while reading stdin, will quit now...");
break;
}

if(option[0] == 'q')
break;

if(option[0] == 'h')
pjsua_call_hangup_all();
}

/* Destroy PJSUA on quit */
pjsua_destroy();
return 0;
}

This part of code hangs-up once 'h' is pressed and quits once 'q' is
pressed. I want to do the job of quit once 'h' is pressed.
Any help!


Visit our blog: http://blog.pjsip.org

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

You can join the two if statements: if(option[0] == 'h') pjsua_call_hangup_all(); break; } That may work ;) On Mon, Sep 28, 2009 at 8:49 PM, Rachel Baskaran <rachelbaskaran@gmail.com> wrote: > Lets say I call a specified uri. > pjsua(exe) sip:user@sipprovider.com > > Once I decide to hang-up by pressing 'h and hit enter, I want the call to > not only hang-up the call but also quit pjsua at same time. > > Rachel > > On Mon, Sep 28, 2009 at 2:41 PM, Saúl Ibarra <saghul@gmail.com> wrote: >> >> Well, adn how do you pretend to hangup the calls? You'll have to decide... >> >> On Mon, Sep 28, 2009 at 6:30 PM, Rachel Baskaran >> <rachelbaskaran@gmail.com> wrote: >> > Hey, >> > >> > Can anyone tell me, how to quit pjsua once I hangup. I meant I waan >> > replace >> > the quit option with hang-up. >> > >> > /* Console option for hangup and quit */ >> > char option[10]; >> > >> > puts("Press h to hangup all calls, 'q' to quit"); >> > if(fgets(option, sizeof(option), stdin) == NULL){ >> > puts("EOF while reading stdin, will quit now..."); >> > break; >> > } >> > >> > if(option[0] == 'q') >> > break; >> > >> > if(option[0] == 'h') >> > pjsua_call_hangup_all(); >> > } >> > >> > /* Destroy PJSUA on quit */ >> > pjsua_destroy(); >> > return 0; >> > } >> > >> > This part of code hangs-up once 'h' is pressed and quits once 'q' is >> > pressed. I want to do the job of quit once 'h' is pressed. >> > Any help! >> > >> > _______________________________________________ >> > Visit our blog: http://blog.pjsip.org >> > >> > pjsip mailing list >> > pjsip@lists.pjsip.org >> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> > >> > >> >> >> >> -- >> /Saúl >> http://www.saghul.net | http://www.sipdoc.net >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -- /Saúl http://www.saghul.net | http://www.sipdoc.net
RB
Rachel Baskaran
Mon, Sep 28, 2009 6:57 PM

Thank you, exactly that's what I did and it works.

Rachel

On Mon, Sep 28, 2009 at 2:53 PM, Saúl Ibarra saghul@gmail.com wrote:

You can join the two if statements:

if(option[0] == 'h')
pjsua_call_hangup_all();
break;
}

That may work ;)

On Mon, Sep 28, 2009 at 8:49 PM, Rachel Baskaran
rachelbaskaran@gmail.com wrote:

Lets say I call a specified uri.
pjsua(exe) sip:user@sipprovider.com sip%3Auser@sipprovider.com

Once I decide to hang-up by pressing 'h and hit enter, I want the call to
not only hang-up the call but also quit pjsua at same time.

Rachel

On Mon, Sep 28, 2009 at 2:41 PM, Saúl Ibarra saghul@gmail.com wrote:

Well, adn how do you pretend to hangup the calls? You'll have to

decide...

On Mon, Sep 28, 2009 at 6:30 PM, Rachel Baskaran
rachelbaskaran@gmail.com wrote:

Hey,

Can anyone tell me, how to quit pjsua once I hangup. I meant I waan
replace
the quit option with hang-up.

/* Console option for hangup and quit */
char option[10];

puts("Press h to hangup all calls, 'q' to quit");
if(fgets(option, sizeof(option), stdin) == NULL){
puts("EOF while reading stdin, will quit now...");
break;
}

if(option[0] == 'q')
break;

if(option[0] == 'h')
pjsua_call_hangup_all();
}

/* Destroy PJSUA on quit */
pjsua_destroy();
return 0;
}

This part of code hangs-up once 'h' is pressed and quits once 'q' is
pressed. I want to do the job of quit once 'h' is pressed.
Any help!


Visit our blog: http://blog.pjsip.org

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

Thank you, exactly that's what I did and it works. Rachel On Mon, Sep 28, 2009 at 2:53 PM, Saúl Ibarra <saghul@gmail.com> wrote: > You can join the two if statements: > > if(option[0] == 'h') > pjsua_call_hangup_all(); > break; > } > > That may work ;) > > > On Mon, Sep 28, 2009 at 8:49 PM, Rachel Baskaran > <rachelbaskaran@gmail.com> wrote: > > Lets say I call a specified uri. > > pjsua(exe) sip:user@sipprovider.com <sip%3Auser@sipprovider.com> > > > > Once I decide to hang-up by pressing 'h and hit enter, I want the call to > > not only hang-up the call but also quit pjsua at same time. > > > > Rachel > > > > On Mon, Sep 28, 2009 at 2:41 PM, Saúl Ibarra <saghul@gmail.com> wrote: > >> > >> Well, adn how do you pretend to hangup the calls? You'll have to > decide... > >> > >> On Mon, Sep 28, 2009 at 6:30 PM, Rachel Baskaran > >> <rachelbaskaran@gmail.com> wrote: > >> > Hey, > >> > > >> > Can anyone tell me, how to quit pjsua once I hangup. I meant I waan > >> > replace > >> > the quit option with hang-up. > >> > > >> > /* Console option for hangup and quit */ > >> > char option[10]; > >> > > >> > puts("Press h to hangup all calls, 'q' to quit"); > >> > if(fgets(option, sizeof(option), stdin) == NULL){ > >> > puts("EOF while reading stdin, will quit now..."); > >> > break; > >> > } > >> > > >> > if(option[0] == 'q') > >> > break; > >> > > >> > if(option[0] == 'h') > >> > pjsua_call_hangup_all(); > >> > } > >> > > >> > /* Destroy PJSUA on quit */ > >> > pjsua_destroy(); > >> > return 0; > >> > } > >> > > >> > This part of code hangs-up once 'h' is pressed and quits once 'q' is > >> > pressed. I want to do the job of quit once 'h' is pressed. > >> > Any help! > >> > > >> > _______________________________________________ > >> > Visit our blog: http://blog.pjsip.org > >> > > >> > pjsip mailing list > >> > pjsip@lists.pjsip.org > >> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >> > > >> > > >> > >> > >> > >> -- > >> /Saúl > >> http://www.saghul.net | http://www.sipdoc.net > >> > >> _______________________________________________ > >> Visit our blog: http://blog.pjsip.org > >> > >> pjsip mailing list > >> pjsip@lists.pjsip.org > >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > _______________________________________________ > > Visit our blog: http://blog.pjsip.org > > > > pjsip mailing list > > pjsip@lists.pjsip.org > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > > > -- > /Saúl > http://www.saghul.net | http://www.sipdoc.net > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >