forked from Mirrors/freeswitch
skypiax: ringback is ok now, early media in early stage (eg: not yet early media :-) )
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12174 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
f125872c73
commit
68743f3042
|
@ -1880,40 +1880,31 @@ int new_inbound_channel(private_t * p)
|
|||
#endif
|
||||
return 0;
|
||||
}
|
||||
int remote_party_is_ringing(private_t * p)
|
||||
{
|
||||
if (p->owner) {
|
||||
ast_queue_control(p->owner, AST_CONTROL_RINGING);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
int remote_party_is_early_media(private_t * p)
|
||||
{
|
||||
if (p->owner) {
|
||||
ast_queue_control(p->owner, AST_CONTROL_RINGING);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int outbound_channel_answered(private_t * p)
|
||||
{
|
||||
#ifdef NOTDEF
|
||||
switch_core_session_t *session = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
if (strlen(tech_pvt->session_uuid_str)) {
|
||||
session = switch_core_session_locate(tech_pvt->session_uuid_str);
|
||||
} else {
|
||||
ERRORA("No session???\n", SKYPIAX_P_LOG);
|
||||
}
|
||||
if (session) {
|
||||
channel = switch_core_session_get_channel(session);
|
||||
} else {
|
||||
ERRORA("No session???\n", SKYPIAX_P_LOG);
|
||||
}
|
||||
if (channel) {
|
||||
switch_channel_mark_answered(channel);
|
||||
//DEBUGA_SKYPE("skype_call: %s, answered\n", SKYPIAX_P_LOG, id);
|
||||
} else {
|
||||
ERRORA("No channel???\n", SKYPIAX_P_LOG);
|
||||
}
|
||||
|
||||
switch_core_session_rwunlock(session);
|
||||
|
||||
#endif
|
||||
|
||||
if (p->owner) {
|
||||
ast_queue_control(p->owner, AST_CONTROL_ANSWER);
|
||||
}
|
||||
|
||||
NOTICA("HERE!\n", SKYPIAX_P_LOG);
|
||||
|
||||
return 0;
|
||||
}
|
||||
void *skypiax_do_tcp_srv_thread(void *obj)
|
||||
|
|
|
@ -414,6 +414,8 @@ int skypiax_pipe_write(int pipe, short *buf, int howmany);
|
|||
#endif /* WIN32 */
|
||||
int skypiax_close_socket(unsigned int fd);
|
||||
private_t *find_available_skypiax_interface(void);
|
||||
int remote_party_is_ringing(private_t * tech_pvt);
|
||||
int remote_party_is_early_media(private_t * tech_pvt);
|
||||
#define SKYPIAX_STATE_DOWN AST_STATE_DOWN
|
||||
#define SKYPIAX_STATE_RING AST_STATE_RING
|
||||
#define SKYPIAX_STATE_DIALING AST_STATE_DIALING
|
||||
|
|
|
@ -1169,6 +1169,62 @@ int new_inbound_channel(private_t * tech_pvt)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int remote_party_is_ringing(private_t * tech_pvt)
|
||||
{
|
||||
switch_core_session_t *session = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
if (strlen(tech_pvt->session_uuid_str)) {
|
||||
session = switch_core_session_locate(tech_pvt->session_uuid_str);
|
||||
} else {
|
||||
ERRORA("No session???\n", SKYPIAX_P_LOG);
|
||||
}
|
||||
if (session) {
|
||||
channel = switch_core_session_get_channel(session);
|
||||
} else {
|
||||
ERRORA("No session???\n", SKYPIAX_P_LOG);
|
||||
}
|
||||
if (channel) {
|
||||
switch_channel_mark_ring_ready(channel);
|
||||
DEBUGA_SKYPE("skype_call: REMOTE PARTY RINGING\n", SKYPIAX_P_LOG);
|
||||
} else {
|
||||
ERRORA("No channel???\n", SKYPIAX_P_LOG);
|
||||
}
|
||||
|
||||
switch_core_session_rwunlock(session);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int remote_party_is_early_media(private_t * tech_pvt)
|
||||
{
|
||||
switch_core_session_t *session = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
if (strlen(tech_pvt->session_uuid_str)) {
|
||||
session = switch_core_session_locate(tech_pvt->session_uuid_str);
|
||||
} else {
|
||||
ERRORA("No session???\n", SKYPIAX_P_LOG);
|
||||
}
|
||||
if (session) {
|
||||
channel = switch_core_session_get_channel(session);
|
||||
switch_core_session_add_stream(session, NULL);
|
||||
} else {
|
||||
ERRORA("No session???\n", SKYPIAX_P_LOG);
|
||||
}
|
||||
if (channel) {
|
||||
//switch_channel_mark_pre_answered(channel);
|
||||
NOTICA("skype_call: REMOTE PARTY EARLY MEDIA, we will pass you the audio, just the code is not yet written :-)\n", SKYPIAX_P_LOG);
|
||||
} else {
|
||||
ERRORA("No channel???\n", SKYPIAX_P_LOG);
|
||||
}
|
||||
|
||||
switch_core_session_rwunlock(session);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int outbound_channel_answered(private_t * tech_pvt)
|
||||
{
|
||||
switch_core_session_t *session = NULL;
|
||||
|
|
|
@ -268,3 +268,5 @@ int skypiax_pipe_write(int pipe, short *buf, int howmany);
|
|||
#endif /* WIN32 */
|
||||
int skypiax_close_socket(unsigned int fd);
|
||||
private_t *find_available_skypiax_interface(void);
|
||||
int remote_party_is_ringing(private_t * tech_pvt);
|
||||
int remote_party_is_early_media(private_t * tech_pvt);
|
||||
|
|
|
@ -267,12 +267,14 @@ int skypiax_signaling_read(private_t * tech_pvt)
|
|||
strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
|
||||
DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n",
|
||||
SKYPIAX_P_LOG, id);
|
||||
remote_party_is_ringing(tech_pvt);
|
||||
}
|
||||
} else if (!strcasecmp(value, "EARLYMEDIA")) {
|
||||
tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA;
|
||||
tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
|
||||
DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n",
|
||||
NOTICA("Our remote party in skype_call %s is EARLYMEDIA\n",
|
||||
SKYPIAX_P_LOG, id);
|
||||
remote_party_is_early_media(tech_pvt);
|
||||
} else if (!strcasecmp(value, "MISSED")) {
|
||||
DEBUGA_SKYPE("We missed skype_call %s\n", SKYPIAX_P_LOG, id);
|
||||
} else if (!strcasecmp(value, "FINISHED")) {
|
||||
|
|
Loading…
Reference in New Issue