[asterisk-commits] dvossel: branch dvossel/gtalk_fixup r290610 - /team/dvossel/gtalk_fixup/chann...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Oct 6 11:11:00 CDT 2010
Author: dvossel
Date: Wed Oct 6 11:10:58 2010
New Revision: 290610
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=290610
Log:
Send telephony events as RTP type 101 not 106. otherwise we can not send DTMF correctly.
Modified:
team/dvossel/gtalk_fixup/channels/chan_gtalk.c
Modified: team/dvossel/gtalk_fixup/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/gtalk_fixup/channels/chan_gtalk.c?view=diff&rev=290610&r1=290609&r2=290610
==============================================================================
--- team/dvossel/gtalk_fixup/channels/chan_gtalk.c (original)
+++ team/dvossel/gtalk_fixup/channels/chan_gtalk.c Wed Oct 6 11:10:58 2010
@@ -173,7 +173,7 @@
/* Forward declarations */
static struct ast_channel *gtalk_request(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause);
-static int gtalk_digit(struct ast_channel *ast, char digit, unsigned int duration);
+/*static int gtalk_digit(struct ast_channel *ast, char digit, unsigned int duration);*/
static int gtalk_sendtext(struct ast_channel *ast, const char *text);
static int gtalk_digit_begin(struct ast_channel *ast, char digit);
static int gtalk_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
@@ -412,7 +412,7 @@
if (codecs_num) {
/* only propose DTMF within an audio session */
- iks_insert_attrib(payload_telephone, "id", "106");
+ iks_insert_attrib(payload_telephone, "id", "101");
iks_insert_attrib(payload_telephone, "name", "telephone-event");
iks_insert_attrib(payload_telephone, "clockrate", "8000");
}
@@ -997,6 +997,8 @@
return NULL;
}
ast_rtp_instance_set_prop(tmp->rtp, AST_RTP_PROPERTY_RTCP, 1);
+ ast_rtp_instance_set_prop(tmp->rtp, AST_RTP_PROPERTY_DTMF, 1);
+ ast_rtp_instance_dtmf_mode_set(tmp->rtp, AST_RTP_DTMF_MODE_RFC2833);
ast_rtp_codecs_payloads_clear(ast_rtp_instance_get_codecs(tmp->rtp), tmp->rtp);
/* add user configured codec capabilites */
@@ -1590,14 +1592,25 @@
static int gtalk_digit_begin(struct ast_channel *chan, char digit)
{
- return gtalk_digit(chan, digit, 0);
+ struct gtalk_pvt *p = chan->tech_pvt;
+ if (!p) {
+ return -1;
+ }
+
+ return ast_rtp_instance_dtmf_begin(p->rtp, digit);
}
static int gtalk_digit_end(struct ast_channel *chan, char digit, unsigned int duration)
{
- return gtalk_digit(chan, digit, duration);
-}
-
+ struct gtalk_pvt *p = chan->tech_pvt;
+ if (!p) {
+ return -1;
+ }
+ return ast_rtp_instance_dtmf_end(p->rtp, digit);
+}
+
+/* This is not being used at the moment, but I want this code to remain in the code base
+ * as a reference.
static int gtalk_digit(struct ast_channel *ast, char digit, unsigned int duration)
{
struct gtalk_pvt *p = ast->tech_pvt;
@@ -1623,8 +1636,8 @@
ast_aji_increment_mid(client->connection->mid);
iks_insert_attrib(gtalk, "xmlns", "http://jabber.org/protocol/gtalk");
iks_insert_attrib(gtalk, "action", "session-info");
- /* put the initiator attribute to lower case if we receive the call
- * otherwise GoogleTalk won't establish the session */
+ // put the initiator attribute to lower case if we receive the call
+ // otherwise GoogleTalk won't establish the session
if (!p->initiator) {
char c;
char *t = lowerthem = ast_strdupa(p->them);
@@ -1651,7 +1664,7 @@
ast_mutex_unlock(&p->lock);
return 0;
}
-
+*/
static int gtalk_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen)
{
ast_log(LOG_NOTICE, "XXX Implement gtalk sendhtml XXX\n");
More information about the asterisk-commits
mailing list