[Asterisk-Dev] IAX2 Frame_Text to send Hangup Cause

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Thu Dec 9 10:37:22 MST 2004


On Thursday 09 December 2004 05:38, reseaux wrote:
> Dear List
> 	i have post yestarday a mail where i can try to explain my problem of
> interconnect two * box and receive the Hangup Cause from the * end point
> (TDM PRI), after some test i see that i cant receive the right Cause ID, i
> have look inside the Iax2.c but im not a c developer so i decide to try the
> SendTEXT application but without lucky because i cant receive the Text from
> the Source * box. Example:
>
> A Server (source Call)
> [extension.conf]
> exten=>_X.,1,Dial(IAX2/test:test at bserver/${EXTEN}
> exten=>_X.,2,Hangup
>
> B Server (Termination Call)
> [extension.conf]
> exten=>_X.,1,Dial(Zap/g0)
> exten=>_X.,2,SendTEXT(${HANGUPCAUSE})
> exten =>_X.,3,Hangup
>
> After sending the Text how can "Client" is able to receive?

Maybe something simple like this?  (see attached patch)

You'd just have to modify your sendtext to something like
SendText(hangupcause=${HANGUPCAUSE}), which leaves more room
for future sending of messages in this way.

-- 
Tilghman
-------------- next part --------------
Index: channels/chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.221
diff -u -r1.221 chan_iax2.c
--- channels/chan_iax2.c	29 Nov 2004 03:24:35 -0000	1.221
+++ channels/chan_iax2.c	9 Dec 2004 17:34:15 -0000
@@ -5378,6 +5378,11 @@
 			if (f.subclass != iaxs[fr.callno]->videoformat) {
 				ast_log(LOG_DEBUG, "Ooh, video format changed to %d\n", f.subclass & ~0x1);
 				iaxs[fr.callno]->videoformat = f.subclass & ~0x1;
+			}
+		}
+		if (f.frametype == AST_FRAME_TEXT) {
+			if (!strncasecmp(f.data, "hangupcause=", 12)) {
+				iaxs[fr.callno]->owner->hangupcause = atoi(f.data + 12);
 			}
 		}
 		if (f.frametype == AST_FRAME_IAX) {


More information about the asterisk-dev mailing list