From: <sb...@us...> - 2007-10-30 17:36:28
|
Revision: 1238 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1238&view=rev Author: sbalea Date: 2007-10-30 10:36:30 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Incoming DTMF patch provided by Bertrand. Thanks. Modified Paths: -------------- trunk/lib/iaxclient.h trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient.h =================================================================== --- trunk/lib/iaxclient.h 2007-10-30 03:10:21 UTC (rev 1237) +++ trunk/lib/iaxclient.h 2007-10-30 17:36:30 UTC (rev 1238) @@ -533,6 +533,21 @@ }; /*! + A structure containing information about a DTMF event + */ +struct iaxc_ev_dtmf { + /*! + The call this DTMF event is for. + */ + int callNo; + + /*! + The digit represented by this DTMF tone + */ + char digit; +}; + +/*! A structure describing a single IAXClient event. */ typedef struct iaxc_event_struct { @@ -568,8 +583,10 @@ struct iaxc_ev_video video; /*! Contains audio data if type = IAXC_EVENT_AUDIO */ struct iaxc_ev_audio audio; - /*! Contains registration data if type = AXC_EVENT_REGISTRATION */ - struct iaxc_ev_registration reg; + /*! Contains registration data if type = IAXC_EVENT_REGISTRATION */ + struct iaxc_ev_registration reg; + /*! Contains DTMF data if type = IAXC_EVENT_DTMF */ + struct iaxc_ev_dtmf dtmf; } ev; } iaxc_event; Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-30 03:10:21 UTC (rev 1237) +++ trunk/lib/iaxclient_lib.c 2007-10-30 17:36:30 UTC (rev 1238) @@ -369,6 +369,15 @@ iaxci_post_event(e); } +void iaxci_do_dtmf_callback(int callNo, char digit) +{ + iaxc_event e; + e.type = IAXC_EVENT_DTMF; + e.ev.dtmf.callNo = callNo; + e.ev.dtmf.digit = digit; + iaxci_post_event(e); +} + static int iaxc_remove_registration_by_id(int id) { struct iaxc_registration *curr, *prev; @@ -1187,6 +1196,10 @@ iaxci_do_state_callback(callNo); iaxci_usermsg(IAXC_STATUS,"Call %d transfer released", callNo); break; + case IAX_EVENT_DTMF: + iaxci_do_dtmf_callback(callNo,e->subclass); + iaxci_usermsg(IAXC_STATUS, "DTMF digit %c received", e->subclass); + break; default: iaxci_usermsg(IAXC_STATUS, "Unknown event: %d for call %d", e->etype, callNo); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |