From ec857b2da63b3dedf6c5c99d1287d462f753c54d Mon Sep 17 00:00:00 2001 From: Giovanni Maruzzelli Date: Wed, 23 Jan 2013 13:37:02 +0100 Subject: [PATCH] FS-4916 added beep (eg: DTMF 1) at the end of remote skype voicemail greeting --- .../mod_skypopen/skypopen_protocol.c | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/mod/endpoints/mod_skypopen/skypopen_protocol.c b/src/mod/endpoints/mod_skypopen/skypopen_protocol.c index 1c86c378c6..e961549d7e 100644 --- a/src/mod/endpoints/mod_skypopen/skypopen_protocol.c +++ b/src/mod/endpoints/mod_skypopen/skypopen_protocol.c @@ -567,6 +567,34 @@ int skypopen_signaling_read(private_t *tech_pvt) } else if (!strcasecmp(prop, "TYPE") && !strcasecmp(value, "OUTGOING") ) { DEBUGA_SKYPE("VOICEMAIL OUTGOING id is %s\n", SKYPOPEN_P_LOG, id); sprintf(tech_pvt->skype_voicemail_id, "%s", id); + } else if (!strcasecmp(prop, "STATUS") && !strcasecmp(value, "PLAYED") ) { + switch_core_session_t *session = NULL; + + session = switch_core_session_locate(tech_pvt->session_uuid_str); + if (session) { + char digit_str[2]; + char *p = digit_str; + switch_channel_t *channel = switch_core_session_get_channel(session); + + digit_str[0]='1'; + digit_str[1]='\0'; + + if (channel) { + + while (p && *p) { + switch_dtmf_t dtmf = { 0 }; + dtmf.digit = *p; + dtmf.duration = SWITCH_DEFAULT_DTMF_DURATION; + switch_channel_queue_dtmf(channel, &dtmf); + p++; + } + } else { + WARNINGA("NO CHANNEL ?\n", SKYPOPEN_P_LOG); + } + switch_core_session_rwunlock(session); + } else { + WARNINGA("NO SESSION ?\n", SKYPOPEN_P_LOG); + } } } @@ -1893,6 +1921,7 @@ void *skypopen_do_skypeapi_thread_func(void *obj) switch_channel_hangup(channel, SWITCH_CAUSE_CRASH); } else { WARNINGA("NO CHANNEL ?\n", SKYPOPEN_P_LOG); + switch_core_session_rwunlock(session); } }