[Pkg-voip-commits] r5779 - in /asterisk/trunk/debian: changelog patches/bristuff/ast-send-message patches/bristuff/zapata-gsm

paravoid at alioth.debian.org paravoid at alioth.debian.org
Sun May 25 17:56:52 UTC 2008


Author: paravoid
Date: Sun May 25 17:56:51 2008
New Revision: 5779

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=5779
Log:
Revert API changes to ast_sendtext() (ast-send-message).

Modified:
    asterisk/trunk/debian/changelog
    asterisk/trunk/debian/patches/bristuff/ast-send-message
    asterisk/trunk/debian/patches/bristuff/zapata-gsm

Modified: asterisk/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/changelog?rev=5779&op=diff
==============================================================================
--- asterisk/trunk/debian/changelog (original)
+++ asterisk/trunk/debian/changelog Sun May 25 17:56:51 2008
@@ -18,12 +18,13 @@
   [ Faidon Liambotis ]
   * Update to bristuff-0.4.0-RC1:
     - Revert API changes to res_agi (xagi).
+    - Revert API changes to ast_sendtext() (ast-send-message).
     - Remove disabled chan-capi patch, obsoleted by upstream.
     - Remove uniqueid-01-use-pid-on-uniqueid-generation patch, dropped by
       upstream.
     - Other minor and cosmetic fixes.
 
- -- Faidon Liambotis <paravoid at debian.org>  Sun, 25 May 2008 20:41:49 +0300
+ -- Faidon Liambotis <paravoid at debian.org>  Sun, 25 May 2008 20:55:42 +0300
 
 asterisk (1:1.4.19.1~dfsg-1) unstable; urgency=low
 

Modified: asterisk/trunk/debian/patches/bristuff/ast-send-message
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff/ast-send-message?rev=5779&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/bristuff/ast-send-message (original)
+++ asterisk/trunk/debian/patches/bristuff/ast-send-message Sun May 25 17:56:51 2008
@@ -3,16 +3,17 @@
 
 --- a/include/asterisk/channel.h
 +++ b/include/asterisk/channel.h
-@@ -245,7 +245,7 @@ struct ast_channel_tech {
- 	int (* const write)(struct ast_channel *chan, struct ast_frame *frame);
+@@ -247,6 +247,9 @@ struct ast_channel_tech {
+ 	/*! \brief Display or transmit text */
+ 	int (* const send_text)(struct ast_channel *chan, const char *text);
  
- 	/*! \brief Display or transmit text */
--	int (* const send_text)(struct ast_channel *chan, const char *text);
-+	int (* const send_text)(struct ast_channel *chan, const char *dest, const char *text, int ispdu);
- 
++	/*! \brief send a message */
++	int (* const send_message)(struct ast_channel *chan, const char *dest, const char *text, int ispdu);
++
  	/*! \brief Display or send an image */
  	int (* const send_image)(struct ast_channel *chan, struct ast_frame *frame);
-@@ -689,6 +689,16 @@ struct ast_channel *ast_request_and_dial
+ 
+@@ -689,6 +692,16 @@ struct ast_channel *ast_request_and_dial
  
  struct ast_channel *__ast_request_and_dial(const char *type, int format, void *data, int timeout, int *reason, const char *cidnum, const char *cidname, struct outgoing_helper *oh);
  
@@ -20,59 +21,55 @@
 + * \param type type of channel to request
 + * \param data data to pass to the channel requester
 + * \param status status
-+ * Request a channel of a given type, with data as optional information used 
++ * Request a channel of a given type, with data as optional information used
 + * by the low level module
 + * \return Returns 0 on success, -1 on failure.
 + */
 +int ast_send_message(const char *type, void *data, char *to, char *from, char *message, int ispdu);
-+ 
++
  /*!\brief Register a channel technology (a new channel driver)
   * Called by a channel module to register the kind of channels it supports.
   * \param tech Structure defining channel technology or "type"
-@@ -905,10 +915,12 @@ int ast_set_write_format(struct ast_chan
- /*! \brief Sends text to a channel 
-  * Write text to a display on a channel
-  * \param chan channel to act upon
+@@ -910,6 +923,16 @@ int ast_set_write_format(struct ast_chan
+  */
+ int ast_sendtext(struct ast_channel *chan, const char *text);
+ 
++/*! \brief Sends message to a channel
++ * Write text to a display on a channel
++ * \param chan channel to act upon
 + * \param dest destination number/user
-  * \param text string of text to send on the channel
++ * \param text string of text to send on the channel
 + * \param ispdu message is in PDU format
-  * \return Returns 0 on success, -1 on failure
-  */
--int ast_sendtext(struct ast_channel *chan, const char *text);
-+int ast_sendtext(struct ast_channel *chan, const char *dest, const char *text, int ispdu);
- 
++ * \return Returns 0 on success, -1 on failure
++ */
++int ast_sendmessage(struct ast_channel *chan, const char *dest, const char *text, int ispdu);
++
  /*! \brief Receives a text character from a channel
   * \param chan channel to act upon
+  * \param timeout timeout in milliseconds (0 for infinite wait)
 --- a/main/channel.c
 +++ b/main/channel.c
-@@ -2435,7 +2435,7 @@ char *ast_recvtext(struct ast_channel *c
- 	return buf;
+@@ -2448,6 +2448,19 @@ int ast_sendtext(struct ast_channel *cha
+ 	return res;
  }
  
--int ast_sendtext(struct ast_channel *chan, const char *text)
-+int ast_sendtext(struct ast_channel *chan, const char *dest, const char *text, int ispdu)
++int ast_sendmessage(struct ast_channel *chan, const char *dest, const char *text, int ispdu)
++{
++	int res = 0;
++	/* Stop if we're a zombie or need a soft hangup */
++	if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan))
++		return -1;
++	CHECK_BLOCKING(chan);
++	if (chan->tech->send_message)
++		res = chan->tech->send_message(chan, dest, text, ispdu);
++	ast_clear_flag(chan, AST_FLAG_BLOCKING);
++	return res;
++}
++
+ int ast_senddigit_begin(struct ast_channel *chan, char digit)
  {
- 	int res = 0;
- 	/* Stop if we're a zombie or need a soft hangup */
-@@ -2443,7 +2443,7 @@ int ast_sendtext(struct ast_channel *cha
- 		return -1;
- 	CHECK_BLOCKING(chan);
- 	if (chan->tech->send_text)
--		res = chan->tech->send_text(chan, text);
-+		res = chan->tech->send_text(chan, dest, text, ispdu);
- 	ast_clear_flag(chan, AST_FLAG_BLOCKING);
- 	return res;
- }
-@@ -2634,7 +2634,7 @@ int ast_write(struct ast_channel *chan, 
- 		break;
- 	case AST_FRAME_TEXT:
- 		res = (chan->tech->send_text == NULL) ? 0 :
--			chan->tech->send_text(chan, (char *) fr->data);
-+			chan->tech->send_text(chan, NULL, (char *) fr->data, 0);
- 		break;
- 	case AST_FRAME_HTML:
- 		res = (chan->tech->send_html == NULL) ? 0 :
-@@ -4487,6 +4487,25 @@ void ast_channel_stop_silence_generator(
+ 	/* Device does not support DTMF tones, lets fake
+@@ -4487,6 +4500,25 @@ void ast_channel_stop_silence_generator(
  }
  
  
@@ -86,7 +83,7 @@
 +	    if (from) {
 +		ast_set_callerid(chan, from, from, from);
 +	    }
-+	    res = ast_sendtext(chan, to, message, ispdu);
++	    res = ast_sendmessage(chan, to, message, ispdu);
 +	    /* XXX what about message CDRs ??? XXX */
 +	    ast_hangup(chan);
 +	    return res;
@@ -98,172 +95,3 @@
  /*! \ brief Convert channel reloadreason (ENUM) to text string for manager event */
  const char *channelreloadreason2txt(enum channelreloadreason reason)
  {
---- a/apps/app_sendtext.c
-+++ b/apps/app_sendtext.c
-@@ -103,7 +103,7 @@ static int sendtext_exec(struct ast_chan
- 	}
- 	status = "FAILURE";
- 	ast_channel_unlock(chan);
--	res = ast_sendtext(chan, args.text);
-+	res = ast_sendtext(chan, NULL, args.text, 0);
- 	if (!res)
- 		status = "SUCCESS";
- 	pbx_builtin_setvar_helper(chan, "SENDTEXTSTATUS", status);
---- a/res/res_agi.c
-+++ b/res/res_agi.c
-@@ -486,7 +486,7 @@ static int handle_sendtext(struct ast_ch
- 	   would probably be to strip off the trailing newline before
- 	   parsing, then here, add a newline at the end of the string
- 	   before sending it to ast_sendtext --DUDE */
--	res = ast_sendtext(chan, argv[2]);
-+	res = ast_sendtext(chan, NULL, argv[2], 0);
- 	fdprintf(agi->fd, "200 result=%d\n", res);
- 	return (res >= 0) ? RESULT_SUCCESS : RESULT_FAILURE;
- }
---- a/channels/chan_agent.c
-+++ b/channels/chan_agent.c
-@@ -249,7 +249,7 @@ static int agent_answer(struct ast_chann
- static struct ast_frame *agent_read(struct ast_channel *ast);
- static int agent_write(struct ast_channel *ast, struct ast_frame *f);
- static int agent_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen);
--static int agent_sendtext(struct ast_channel *ast, const char *text);
-+static int agent_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu);
- static int agent_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen);
- static int agent_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
- static struct ast_channel *agent_bridgedchannel(struct ast_channel *chan, struct ast_channel *bridge);
-@@ -558,13 +558,13 @@ static int agent_sendhtml(struct ast_cha
- 	return res;
- }
- 
--static int agent_sendtext(struct ast_channel *ast, const char *text)
-+static int agent_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu)
- {
- 	struct agent_pvt *p = ast->tech_pvt;
- 	int res = -1;
- 	ast_mutex_lock(&p->lock);
- 	if (p->chan) 
--		res = ast_sendtext(p->chan, text);
-+		res = ast_sendtext(p->chan, dest, text, ispdu);
- 	ast_mutex_unlock(&p->lock);
- 	return res;
- }
---- a/channels/chan_alsa.c
-+++ b/channels/chan_alsa.c
-@@ -186,7 +186,7 @@ static int nosound = 0;
- /* ZZ */
- static struct ast_channel *alsa_request(const char *type, int format, void *data, int *cause);
- static int alsa_digit(struct ast_channel *c, char digit, unsigned int duration);
--static int alsa_text(struct ast_channel *c, const char *text);
-+static int alsa_text(struct ast_channel *c, const char *dest, const char *text, int ispdu);
- static int alsa_hangup(struct ast_channel *c);
- static int alsa_answer(struct ast_channel *c);
- static struct ast_frame *alsa_read(struct ast_channel *chan);
-@@ -496,7 +496,7 @@ static int alsa_digit(struct ast_channel
- 	return 0;
- }
- 
--static int alsa_text(struct ast_channel *c, const char *text)
-+static int alsa_text(struct ast_channel *c, const char *dest, const char *text, int ispdu)
- {
- 	ast_mutex_lock(&alsalock);
- 	ast_verbose(" << Console Received text %s >> \n", text);
---- a/channels/chan_local.c
-+++ b/channels/chan_local.c
-@@ -77,7 +77,7 @@ static int local_write(struct ast_channe
- static int local_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen);
- static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
- static int local_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen);
--static int local_sendtext(struct ast_channel *ast, const char *text);
-+static int local_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu);
- static int local_devicestate(void *data);
- 
- /* PBX interface structure for channel registration */
-@@ -407,7 +407,7 @@ static int local_digit_end(struct ast_ch
- 	return res;
- }
- 
--static int local_sendtext(struct ast_channel *ast, const char *text)
-+static int local_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu)
- {
- 	struct local_pvt *p = ast->tech_pvt;
- 	int res = -1;
---- a/channels/chan_oss.c
-+++ b/channels/chan_oss.c
-@@ -405,7 +405,7 @@ static struct ast_channel *oss_request(c
- , int *cause);
- static int oss_digit_begin(struct ast_channel *c, char digit);
- static int oss_digit_end(struct ast_channel *c, char digit, unsigned int duration);
--static int oss_text(struct ast_channel *c, const char *text);
-+static int oss_text(struct ast_channel *c, const char *dest, const char *text, int ispdu);
- static int oss_hangup(struct ast_channel *c);
- static int oss_answer(struct ast_channel *c);
- static struct ast_frame *oss_read(struct ast_channel *chan);
-@@ -773,7 +773,7 @@ static int oss_digit_end(struct ast_chan
- 	return 0;
- }
- 
--static int oss_text(struct ast_channel *c, const char *text)
-+static int oss_text(struct ast_channel *c, const char *dest, const char *text, int ispdu)
- {
- 	/* print received messages */
- 	ast_verbose(" << Console Received text %s >> \n", text);
---- a/channels/chan_phone.c
-+++ b/channels/chan_phone.c
-@@ -166,7 +166,7 @@ static int phone_answer(struct ast_chann
- static struct ast_frame *phone_read(struct ast_channel *ast);
- static int phone_write(struct ast_channel *ast, struct ast_frame *frame);
- static struct ast_frame *phone_exception(struct ast_channel *ast);
--static int phone_send_text(struct ast_channel *ast, const char *text);
-+static int phone_send_text(struct ast_channel *ast, const char *dest, const char *text, int ispdu);
- static int phone_fixup(struct ast_channel *old, struct ast_channel *new);
- static int phone_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen);
- 
-@@ -643,7 +643,7 @@ static int phone_write_buf(struct phone_
- 	return len;
- }
- 
--static int phone_send_text(struct ast_channel *ast, const char *text)
-+static int phone_send_text(struct ast_channel *ast, const char *dest, const char *text, int ispdu)
- {
-     int length = strlen(text);
-     return phone_write_buf(ast->tech_pvt, text, length, length, 0) == 
---- a/channels/chan_sip.c
-+++ b/channels/chan_sip.c
-@@ -1219,7 +1219,7 @@ static struct ast_config *notify_types;	
- /*--- PBX interface functions */
- static struct ast_channel *sip_request_call(const char *type, int format, void *data, int *cause);
- static int sip_devicestate(void *data);
--static int sip_sendtext(struct ast_channel *ast, const char *text);
-+static int sip_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu);
- static int sip_call(struct ast_channel *ast, char *dest, int timeout);
- static int sip_hangup(struct ast_channel *ast);
- static int sip_answer(struct ast_channel *ast);
-@@ -2371,7 +2371,7 @@ static char *get_in_brackets(char *tmp)
- 
- /*! \brief Send SIP MESSAGE text within a call
- 	Called from PBX core sendtext() application */
--static int sip_sendtext(struct ast_channel *ast, const char *text)
-+static int sip_sendtext(struct ast_channel *ast, const char *dest, const char *text, int ispdu)
- {
- 	struct sip_pvt *p = ast->tech_pvt;
- 	int debug = sip_debug_test_pvt(p);
---- a/channels/chan_iax2.c
-+++ b/channels/chan_iax2.c
-@@ -846,7 +846,7 @@ static int iax2_provision(struct sockadd
- static int iax2_send(struct chan_iax2_pvt *pvt, struct ast_frame *f, unsigned int ts, int seqno, int now, int transfer, int final);
- static int iax2_sendhtml(struct ast_channel *c, int subclass, const char *data, int datalen);
- static int iax2_sendimage(struct ast_channel *c, struct ast_frame *img);
--static int iax2_sendtext(struct ast_channel *c, const char *text);
-+static int iax2_sendtext(struct ast_channel *c, const char *dest, const char *text, int ispdu);
- static int iax2_setoption(struct ast_channel *c, int option, void *data, int datalen);
- static int iax2_transfer(struct ast_channel *c, const char *dest);
- static int iax2_write(struct ast_channel *c, struct ast_frame *f);
-@@ -2728,7 +2728,7 @@ static int iax2_digit_end(struct ast_cha
- 	return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_DTMF_END, digit, 0, NULL, 0, -1);
- }
- 
--static int iax2_sendtext(struct ast_channel *c, const char *text)
-+static int iax2_sendtext(struct ast_channel *c, const char *dest, const char *text, int ispdu)
- {
- 	
- 	return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_TEXT,

Modified: asterisk/trunk/debian/patches/bristuff/zapata-gsm
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff/zapata-gsm?rev=5779&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/bristuff/zapata-gsm (original)
+++ asterisk/trunk/debian/patches/bristuff/zapata-gsm Sun May 25 17:56:51 2008
@@ -27,16 +27,15 @@
  
  static int ifcount = 0;
  
-@@ -249,7 +255,7 @@ static int restart_monitor(void);
- 
- static enum ast_bridge_result zt_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms);
- 
--static int zt_sendtext(struct ast_channel *c, const char *text);
-+static int zt_sendtext(struct ast_channel *c, const char *dest, const char *text, int ispdu);
- 
+@@ -251,6 +257,7 @@ static enum ast_bridge_result zt_bridge(
+ 
+ static int zt_sendtext(struct ast_channel *c, const char *text);
+ 
++static int zt_sendmessage(struct ast_channel *c, const char *dest, const char *text, int ispdu);
  
  /*! \brief Avoid the silly zt_getevent which ignores a bunch of events */
-@@ -364,6 +370,19 @@ struct zt_pri {
+ static inline int zt_get_event(int fd)
+@@ -364,6 +371,19 @@ struct zt_pri {
  	int debugfd;
  };
  
@@ -74,16 +73,24 @@
  	int polarity;
  	int dsp_features;
  	char begindigit;
-@@ -710,7 +733,7 @@ static struct zt_chan_conf zt_chan_conf_
+@@ -710,7 +734,7 @@ static struct zt_chan_conf zt_chan_conf_
  static struct ast_channel *zt_request(const char *type, int format, void *data, int *cause);
  static int zt_digit_begin(struct ast_channel *ast, char digit);
  static int zt_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
 -static int zt_sendtext(struct ast_channel *c, const char *text);
-+static int zt_sendtext(struct ast_channel *c, const char *dest, const char *text, int ispdu);
++static int zt_sendmessage(struct ast_channel *c, const char *dest, const char *text, int ispdu);
  static int zt_call(struct ast_channel *ast, char *rdest, int timeout);
  static int zt_hangup(struct ast_channel *ast);
  static int zt_answer(struct ast_channel *ast);
-@@ -1262,6 +1285,8 @@ static char *zap_sig2str(int sig)
+@@ -732,6 +756,7 @@ static const struct ast_channel_tech zap
+ 	.send_digit_begin = zt_digit_begin,
+ 	.send_digit_end = zt_digit_end,
+ 	.send_text = zt_sendtext,
++	.send_message = zt_sendmessage,
+ 	.call = zt_call,
+ 	.hangup = zt_hangup,
+ 	.answer = zt_answer,
+@@ -1262,6 +1287,8 @@ static char *zap_sig2str(int sig)
  		return "GR-303 with FXOKS";
  	case SIG_GR303FXSKS:
  		return "GR-303 with FXSKS";
@@ -802,7 +809,21 @@
 +}
 +#endif
 +
-+static int zt_sendtext(struct ast_channel *c, const char *dest, const char *text, int ispdu) {
++static int zt_sendtext(struct ast_channel *c, const char *text) {
++ struct zt_pvt *p = c->tech_pvt;
++ if (!p) return -1;
++ if (p->sig == SIG_PRI) {
++#ifdef HAVE_PRI
++	return zt_pri_sendtext(c, text);
++#endif
++ } else if (p->sig == SIG_GSM) {
++ } else {
++	return zt_tdd_sendtext(c, text);
++ }
++ return -1;
++}
++
++static int zt_sendmessage(struct ast_channel *c, const char *dest, const char *text, int ispdu) {
 + struct zt_pvt *p = c->tech_pvt;
 + if (!p) return -1;
 + if (p->sig == SIG_PRI) {
@@ -818,6 +839,10 @@
 +     return zt_gsm_sendtext(c, dest, text, ispdu);
 +#endif
 + } else {
++	if (ispdu) {
++	    ast_log(LOG_WARNING, "Dont know how to send PDU on ZAP channel\n");
++	    return -1;
++	}
 +	return zt_tdd_sendtext(c, text);
 + }
 + return -1;




More information about the Pkg-voip-commits mailing list