answer call before entering chat
This commit is contained in:
parent
025d7c827c
commit
0c80e2361f
|
@ -275,7 +275,7 @@ static const char * capi_command_to_string(unsigned short wCmd)
|
|||
/*
|
||||
* wait for B3 up
|
||||
*/
|
||||
static void capi_wait_for_b3_up(struct capi_pvt *i)
|
||||
void capi_wait_for_b3_up(struct capi_pvt *i)
|
||||
{
|
||||
struct timespec abstime;
|
||||
|
||||
|
@ -300,7 +300,7 @@ static void capi_wait_for_b3_up(struct capi_pvt *i)
|
|||
/*
|
||||
* wait for finishing answering state
|
||||
*/
|
||||
static void capi_wait_for_answered(struct capi_pvt *i)
|
||||
void capi_wait_for_answered(struct capi_pvt *i)
|
||||
{
|
||||
struct timespec abstime;
|
||||
|
||||
|
|
|
@ -569,5 +569,7 @@ extern void cc_start_b3(struct capi_pvt *i);
|
|||
extern void queue_cause_control(struct capi_pvt *i, int control);
|
||||
extern void capidev_handle_connection_conf(struct capi_pvt **i, unsigned int PLCI,
|
||||
unsigned short wInfo, unsigned short wMsgNum);
|
||||
extern void capi_wait_for_answered(struct capi_pvt *i);
|
||||
extern void capi_wait_for_b3_up(struct capi_pvt *i);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -207,6 +207,14 @@ int pbx_capi_chat(struct ast_channel *c, char *param)
|
|||
cc_verbose(3, 1, VERBOSE_PREFIX_3 "capi chat: %s: roomname=%s options=%s\n",
|
||||
c->name, roomname, options);
|
||||
|
||||
if (c->_state != AST_STATE_UP)
|
||||
ast_answer(c);
|
||||
|
||||
if (i) {
|
||||
capi_wait_for_answered(i);
|
||||
capi_wait_for_b3_up(i);
|
||||
}
|
||||
|
||||
room = add_chat_member(roomname, c, i);
|
||||
if (!room) {
|
||||
cc_log(LOG_WARNING, "Unable to open capi chat room.\n");
|
||||
|
|
Loading…
Reference in New Issue