[asterisk-dev] "Sending Complete" IE status availability ?

Pavel Troller patrol at sinus.cz
Thu May 24 23:24:56 CDT 2012


Hi Richard!

> >   I would like to ask, whether it is possible to query the "Sending
> >   Complete"
> > flag status received by the PRI DAHDI channel (in Asterisk 1.8 and
> > above).
> >   Let's explain better: A SETUP message comes to Asterisk with Called
> >   Party
> > Number digits = 12345. This message MAY contain the Sending Complete
> > IE,
> > telling, that no more dialling will come, or MAY NOT contain it, in
> > which case
> > more digits in the overlap mode can be received.
> >   Is there a chance to query the status of the Sending Complete IE
> >   presence
> > from the dialplan ?
> 
> No.  The sending complete flag is not saved and is not made available
> to the dialplan.

Thank you for your response.
Because I need it in the dialplan to know, whether the dialling is finished
for sure or not, I've written a simple patch, which adds parameter called
"sending_complete_received" to the CHANNEL() core function, so for example
the following is now working for me:

[macro-pri-sethashed]

exten => s,1,GotoIf($["${CHANNEL(channeltype)}" != "DAHDI"]?nodahdi)
exten => s,n,GotoIf($["${CHANNEL(dahdi_type)}" != "pri"]?nodahdi)
exten => s,n,GotoIf($["${CHANNEL(sending_complete_received)}" = "0"]?nodahdi)
exten => s,n,Log(WARNING,"Setting HASHED")
exten => s,n,Set(HASHED="y")
exten => s,n(nodahdi),MacroExit()

Thanks to this, the variable HASHED may be set in the dialplan. This variable
is used generally through the dialplan to determine, whether the dial string is
to be considered complete (for example, in my handling of SS7 calls it is
being set if the number ends with a "F" digit, which has also the meaning
of "Sending Complete" status).

Do you think this extension could be merged into the official Asterisk 
sources ? If yes, I will improve it a bit (for example, the new parameter
is not yet mentioned in the help text) and post the patch to the review
board. Now it's just 7 lines added.

> 
> > Let's imagine that the dialplan contains the _1!
> > extension,
> > which will be triggered by the above example SETUP message. In the
> > extension logic there may be a part which reads more digits in the
> > overlap
> > mode, but skips the reading in the en-bloc mode (i.e. if the Sending
> > Complete
> > IE has been received). I didn't find anything relevant on Google, and
> > the only
> > usage of the flag which I found in sig_pri.c was that presence of
> > this
> > IE together with zero digits received triggers the "s" extension.
> 
> The sending complete flag is used three times.  The first is for the
> "s" extension.  The second is in determining what response message to send
> (PROCEEDING/ANSWER/SETUP-ACKNOWLEDGE).  The third is to determine if the
> pri_ss_thread needs to be started to gather more digits for a dialplan
> extension match.

Thank you for the explanation, I found all the occurences after your notice.

> 
> Richard

With regards, Pavel



More information about the asterisk-dev mailing list