[Asterisk-Dev] IAX2 Frame_Text to send Hangup Cause

reseaux reseauxit at yahoo.it
Fri Dec 10 06:29:23 MST 2004


Hi Tilghman
	i have discored the problem :-) I have patch the Server A with your patch 
(not the B..) and i have remove the line that ovveride the Receive Send Text 
from server B:
from chan_iax2.c
--------------------
+++ Line 5503
case IAX_COMMAND_HANGUP:
                                iaxs[fr.callno]->alreadygone = 1;
                                ast_log(LOG_DEBUG, "Immediately destroying %d, 
having received hangup\n", fr.callno);

                                /* Set hangup cause */
+++                                //      if (ies.cause)
+++                                //             
iaxs[fr.callno]->owner->hangupcause = atoi(ies.cause);

                                /* Send ack immediately, before we destroy */
                                send_command_immediate(iaxs[fr.callno], 
AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
                                iax2_destroy_nolock(fr.callno);
                                break;
----------------------------------------------------------------------------
After this hack the SendText from B server is able to send the HangupCause to 
server A :-)
How can fix my stupid hack with a good line of code? 
Thanks 
Dimitri

On Friday 10 December 2004 12:57, reseaux wrote:
> Hi Tilghman
> 	i have try your patch but seems to still reporting no Cause below i report
> my test:
> - Every box use * version 1.0.2 patch with BRIStuff
> - I have patched the 2 box with your iax2.c mod (i think i have need to
> patch only the B server that send the text)
>
>  A Server (source Call)
>  [extension.conf]
>  exten=>_X.,1,Dial(IAX2/text:1234 at bserver/${EXTEN}
>  exten=>_X.,2,NoOp(${HANGUPCAUSE})
>  exten=>_X.,3,Hangup
>
>  B Server (Termination Call)
>  [extension.conf]
>  exten=>_X.,1,Dial(Zap/g0)
>  exten=>_X.,2,NoOP(${HANGUPCAUSE})
>  exten=>_X.,3,SendTEXT(hangupcause=${HANGUPCAUSE})
>  exten=>_X.,4,Hangup
>
>
> --------- call generate from server A -----------
>     -- Executing
> Dial("IAX2/dimi3 at dimi3/3","IAX2/text:1234 at bserver/6666 at text") in new stack
> Dec 10 12:27:32 NOTICE[524308]: channel.c:284 ast_alloc_uniqueid: uid =
> asterisk-5294-1102678052.25
>     -- Called text:1234 at bserver/6666 at text
>     -- Call accepted by 192.168.1.77 (format GSM)
>     -- Format for call is GSM
>     -- IAX2/192.168.1.77:4569/5 is ringing
>     -- Hungup 'IAX2/192.168.1.77:4569/5'
>   == No one is available to answer at this time
>     -- Executing NoOp("IAX2/dimi3 at dimi3/3", "0") in new stack
>     -- Executing NoOp("IAX2/dimi3 at dimi3/3", "") in new stack
>     -- Executing Hangup("IAX2/dimi3 at dimi3/3", "") in new stack
> ----------------
>
> -------------- Call receive from B server and deliverd to Zap HFC BRI --
> Accepting AUTHENTICATED call from 192.168.1.45, requested format = 2,
> actual format = 2
>     -- Executing Dial("IAX2/text at 192.168.1.45:4569/2", "Zap/g0") in new
> stack -- Called g0
>     -- Zap/1-1 is ringing
>     -- Channel 0/1, span 1 got hangup
>     -- Hungup 'Zap/1-1'
>   == No one is available to answer at this time
>     -- Executing NoOp("IAX2/text at 192.168.1.45:4569/2", "16") in new stack
>     -- Executing SendText("IAX2/text at 192.168.1.45:4569/2",
> "hangupcause=16") in new stack
>     -- Executing Hangup("IAX2/text at 192.168.1.45:4569/2", "") in new stack
>   == Spawn extension (text, 6666, 4) exited non-zero on
> 'IAX2/text at 192.168.1.45:4569/2'
> ----------------------------------------------------
>
> As you can see the B server report the right cause "16" and send it using
> SendText but from the A side report the same value "0".
> How can i debug the problem? Is right extension.conf in both Server?
> Many thanks for your help
> Dimitri
>
> On Thursday 09 December 2004 18:37, Tilghman Lesher wrote:
> > 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.
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev



More information about the asterisk-dev mailing list