[asterisk-dev] ${DIALSTATUS} = NULL - is that OK?

Chris Maciejewski chris at wima.co.uk
Mon Jun 9 11:14:06 CDT 2008


> Andrew Kohlsmith (lists) wrote:
>> On June 9, 2008 06:34:29 am Chris Maciejewski wrote:
>>> Is behaviour described above normal? The reason I am asking is because
>>> my dialplan logic depends on ${DIALSTATUS} variable and currently I
>>> use "GotoIf($[${ISNULL(${DIALSTATUS})} = 1]?label1:label2)" which
>>> works fine for now, but may break if Dial will return some status in
>>> the future.
>>
>> Personally I would like to see Dial set the variable to INPROGRESS as soon as
>> it runs.  I use DIALSTATUS=NULL to see if I dialed at all.  :-)
>
> That would be a reasonable enhancement to make.
>
> In response to the original question.  I think that if there is any code
> path which allows Dial() to exist without setting a DIALSTATUS, then
> that is a bug.

If you consider this a bug, here is a general idea what I am doing (how
to reproduce Dial() returning NULL status).

1. My setup:
  OpenSER (registrar, proxy) <= SIP => Asterisk (Media Proxy,
Application Server)

2. Incoming SIP INVITE (from PSTN) => OpenSER => Asterisk
Dial(user at OpenSER) (we insert ${CHANNEL} into MySQL db) => OpenSer =>
UA2

3. UA2 is "Ringing"

4. UA1 sends and INVITE (**) pickup => OpenSER (get * ${Channel} from
DB and insert SIP header; rewrites URI to "pickup" => Asterisk: exten
=> pickup,n,Bridge(${SIP_HEADER(X-call_id)}) which results in:

a) BYE to UA2
b) Dial from point 2) returns DIALSTATUS = NULL
c) UA1 "Pick Ups" oryginal call

Hope that helps.

SIP flow for above described can be found here:
http://wima.co.uk/sip/2008-06-07_18-55-44-pickup_index.html

regards,
Chris

2008/6/9  <asterisk-dev-request at lists.digium.com>:
> Send asterisk-dev mailing list submissions to
>        asterisk-dev at lists.digium.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.digium.com/mailman/listinfo/asterisk-dev
> or, via email, send a message with subject or body 'help' to
>        asterisk-dev-request at lists.digium.com
>
> You can reach the person managing the list at
>        asterisk-dev-owner at lists.digium.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of asterisk-dev digest..."
>
>
> Today's Topics:
>
>   1. MusicOnHold event (Chris Maciejewski)
>   2. ${DIALSTATUS} = NULL - is that OK? (Chris Maciejewski)
>   3. Patch for app_asr.c: DTMF instead of goto (nik600)
>   4. Re: ${DIALSTATUS} = NULL - is that OK? (Andrew Kohlsmith (lists))
>   5. Re: MusicOnHold event (Gabriel Ortiz Lour)
>   6. Re: MusicOnHold event (Russell Bryant)
>   7. Asterisk 1.4.21-rc2 Now Available (The Asterisk Development Team)
>   8. Re: MusicOnHold event (Gabriel Ortiz Lour)
>   9. Re: MusicOnHold event (Mark Michelson)
>  10. Re: MusicOnHold event (Russell Bryant)
>  11. Re: ${DIALSTATUS} = NULL - is that OK? (Russell Bryant)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 9 Jun 2008 09:49:12 +0100
> From: "Chris Maciejewski" <chris at wima.co.uk>
> Subject: [asterisk-dev] MusicOnHold event
> To: asterisk-dev at lists.digium.com
> Message-ID:
>        <4a67e17b0806090149m7fbcd048gb3d216708316c24a at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi List,
>
> I have a question for developers. Is there any chance of MusicOnHold sending
> "start/stop" events to * manager?
> In my application it would be really great to see MoH in * manager.
>
> Kind regards,
> Chris
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080609/8aef0b9e/attachment-0001.htm
>
> ------------------------------
>
> Message: 2
> Date: Mon, 9 Jun 2008 11:34:29 +0100
> From: "Chris Maciejewski" <chris at wima.co.uk>
> Subject: [asterisk-dev] ${DIALSTATUS} = NULL - is that OK?
> To: asterisk-dev at lists.digium.com
> Message-ID:
>        <4a67e17b0806090334r1410fe54lac67bb737b228fc9 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
>
> I am using Asterisk 1.6-beta9.
>
> As of http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+Dial
> after Dial is finished ${DIALSTATUS} will be one of CHANUNAVAIL, BUSY
> etc. However I have just noticed when channel is ringing after Dial
> and before it is answered we use 'Bridge' application to connect it to
> some other part of the dialplan ${DIALSTATUS} of original Dial is
> NULL.
>
> Is behaviour described above normal? The reason I am asking is because
> my dialplan logic depends on ${DIALSTATUS} variable and currently I
> use "GotoIf($[${ISNULL(${DIALSTATUS})} = 1]?label1:label2)" which
> works fine for now, but may break if Dial will return some status in
> the future.
>
> Thanks for info.
>
> Chris
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 9 Jun 2008 14:04:02 +0200
> From: nik600 <nik600 at gmail.com>
> Subject: [asterisk-dev] Patch for app_asr.c: DTMF instead of goto
> To: asterisk-dev at lists.digium.com
> Message-ID:
>        <9469c3170806090504m52795d7an22ca35c1a1ac47f1 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi to all
>
> if someone of you is interested on it, i've changed the code of app_asr.c
>
> With these patch you can use the ASR application to play DTMF tones,
> so you can have your own AGI application that uses the ASR and manages
> the DTMF tones without change the dialplan.
>
> EXAMPLE
>
> exten => 003,1,Ringing
> exten => 003,2,Wait(3)
> exten => 003,3,Answer
> exten => 003,4,ASR(t5000c80l4,100,200:pippo,300:pluto,400:paperino)
> exten => 003,5,Read(digito||3)
> exten => 003,6,SayDigits(${digito})
> exten => 003,7,Wait(30)
>
> The old app_asr will send you to the 200,300 or 400 extension.
>
> With the modified app_asr you will hear (and Asterisk can detects, via
> AGI or dialplan) 200,300,400 DTMF tones.
>
> You can find more information here.
>
> http://www.kumbe.it/pagine/dettaglio/34/206.html
>
> Bye
>
> --
> /*************/
> nik600
> https://sourceforge.net/projects/ccmanager
> https://sourceforge.net/projects/reportmaker
> https://sourceforge.net/projects/nikstresser
>
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 9 Jun 2008 08:20:04 -0400
> From: "Andrew Kohlsmith (lists)" <aklists at mixdown.ca>
> Subject: Re: [asterisk-dev] ${DIALSTATUS} = NULL - is that OK?
> To: asterisk-dev at lists.digium.com
> Message-ID: <200806090820.04379.aklists at mixdown.ca>
> Content-Type: text/plain;  charset="iso-8859-1"
>
> On June 9, 2008 06:34:29 am Chris Maciejewski wrote:
>> Is behaviour described above normal? The reason I am asking is because
>> my dialplan logic depends on ${DIALSTATUS} variable and currently I
>> use "GotoIf($[${ISNULL(${DIALSTATUS})} = 1]?label1:label2)" which
>> works fine for now, but may break if Dial will return some status in
>> the future.
>
> Personally I would like to see Dial set the variable to INPROGRESS as soon as
> it runs.  I use DIALSTATUS=NULL to see if I dialed at all.  :-)
>
> -A.
>
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 9 Jun 2008 09:36:29 -0300
> From: "Gabriel Ortiz Lour" <ortiz.admin at gmail.com>
> Subject: Re: [asterisk-dev] MusicOnHold event
> To: "Asterisk Developers Mailing List" <asterisk-dev at lists.digium.com>
> Message-ID:
>        <167fb8740806090536k7aa540d5t2c97216b96e6a5dd at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
>  I've been developing some features in my asterisk here and did some
> improves on the manager events to help me out. What you are looking for
> should be very simple to implement.
>  I just did some modification on the 1.4.19 version so I can send "custom"
> manager events from the CLI, and I'll be doing this on the trunk sourcecode
> soon, some day on this week, then I can check to see if your request is
> simple to do.
>
> Gabriel Ortiz
>
>
>
> 2008/6/9 Chris Maciejewski <chris at wima.co.uk>:
>
>> Hi List,
>>
>> I have a question for developers. Is there any chance of MusicOnHold
>> sending "start/stop" events to * manager?
>> In my application it would be really great to see MoH in * manager.
>>
>> Kind regards,
>> Chris
>>
>>
>> _______________________________________________
>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>>
>> asterisk-dev mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080609/d0a83122/attachment-0001.htm
>
> ------------------------------
>
> Message: 6
> Date: Mon, 09 Jun 2008 07:38:35 -0500
> From: Russell Bryant <russell at digium.com>
> Subject: Re: [asterisk-dev] MusicOnHold event
> To: Asterisk Developers Mailing List <asterisk-dev at lists.digium.com>
> Message-ID: <484D244B.8090405 at digium.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Chris Maciejewski wrote:
>> I have a question for developers. Is there any chance of MusicOnHold sending
>> "start/stop" events to * manager?
>> In my application it would be really great to see MoH in * manager.
>
> It would be trivial to implement if someone wants to do it.  You need to
> insert a call to manager_event() inside of local_ast_moh_start() and
> local_ast_moh_stop() in res/res_musiconhold.c.
>
> --
> Russell Bryant
> Senior Software Engineer
> Open Source Team Lead
> Digium, Inc.
>
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 09 Jun 2008 07:45:27 -0500
> From: The Asterisk Development Team <asteriskteam at digium.com>
> Subject: [asterisk-dev] Asterisk 1.4.21-rc2 Now Available
> To: undisclosed-recipients:;
> Message-ID: <484D25E7.4030003 at digium.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> The Asterisk development team has released Asterisk version 1.4.21-rc2.
>
> This release is a release candidate for the upcoming official release of
>  1.4.21.  A few bugs have been fixed since 1.4.21-rc2.  Please continue
> to assist in testing before we release 1.4.21!
>
> The release candidate is available on the download site.
>
> http://downloads.digium.com/pub/telephony/asterisk
>
> Please provide release candidate testing feedback to the asterisk-dev
> mailing list, or the issue tracker, http://bugs.digium.com/.
>
> Thank you for your continued support of Asterisk!
>
>
>
> ------------------------------
>
> Message: 8
> Date: Mon, 9 Jun 2008 10:00:10 -0300
> From: "Gabriel Ortiz Lour" <ortiz.admin at gmail.com>
> Subject: Re: [asterisk-dev] MusicOnHold event
> To: "Asterisk Developers Mailing List" <asterisk-dev at lists.digium.com>
> Message-ID:
>        <167fb8740806090600j4c98bb76kdb78f1d04ce2d417 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi again,
>
> I'll do it. But I have a question, why the trunk source code is so diferent
> from the release ones? I have done some modifications on the Asterisk I use
> here (1.4.19) and would like to include in the trunk version, but since it's
> so diferent I was wondering when this changes would be in a release?
>
> Gabriel
>
> 2008/6/9 Russell Bryant <russell at digium.com>:
>
>> Chris Maciejewski wrote:
>> > I have a question for developers. Is there any chance of MusicOnHold
>> sending
>> > "start/stop" events to * manager?
>> > In my application it would be really great to see MoH in * manager.
>>
>> It would be trivial to implement if someone wants to do it.  You need to
>> insert a call to manager_event() inside of local_ast_moh_start() and
>> local_ast_moh_stop() in res/res_musiconhold.c.
>>
>> --
>> Russell Bryant
>> Senior Software Engineer
>> Open Source Team Lead
>> Digium, Inc.
>>
>> _______________________________________________
>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>>
>> asterisk-dev mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080609/7d57d5c4/attachment-0001.htm
>
> ------------------------------
>
> Message: 9
> Date: Mon, 09 Jun 2008 09:38:55 -0500
> From: Mark Michelson <mmichelson at digium.com>
> Subject: Re: [asterisk-dev] MusicOnHold event
> To: Asterisk Developers Mailing List <asterisk-dev at lists.digium.com>
> Message-ID: <484D407F.4080501 at digium.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Gabriel Ortiz Lour wrote:
>> Hi again,
>>
>> I'll do it. But I have a question, why the trunk source code is so
>> diferent from the release ones? I have done some modifications on the
>> Asterisk I use here (1.4.19) and would like to include in the trunk
>> version, but since it's so diferent I was wondering when this changes
>> would be in a release?
>>
>> Gabriel
>
> The current trunk serves as the development area for the 1.6 releases of
> Asterisk. 1.6.0 has been feature-frozen. This means that the features that are
> in trunk (or a subset of them) which are not in 1.6.0 will be candidates for
> future versions of 1.6.
>
> Regarding your question of why trunk is so much different than 1.4, the simple
> answer is that it is where new development of Asterisk occurs. As a result,
> there are new features, more streamlined ways of implementing old features, and
> new API's available. If you have questions about specific portions of the trunk
> code, then they could be explained. The CHANGES file in the top-level source
> directory is a good source for seeing user-level changes to Asterisk between 1.4
> and trunk and may help shed some light from a development angle as well.
>
> Mark Michelson
>
>
>
> ------------------------------
>
> Message: 10
> Date: Mon, 09 Jun 2008 09:43:38 -0500
> From: Russell Bryant <russell at digium.com>
> Subject: Re: [asterisk-dev] MusicOnHold event
> To: Asterisk Developers Mailing List <asterisk-dev at lists.digium.com>
> Message-ID: <484D419A.1010306 at digium.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Gabriel Ortiz Lour wrote:
>> I'll do it. But I have a question, why the trunk source code is so diferent
>> from the release ones? I have done some modifications on the Asterisk I use
>> here (1.4.19) and would like to include in the trunk version, but since it's
>> so diferent I was wondering when this changes would be in a release?
>
> Asterisk 1.4 is feature frozen.  Asterisk trunk gets all of the new
> features, which will be included in Asterisk 1.6.
>
> --
> Russell Bryant
> Senior Software Engineer
> Open Source Team Lead
> Digium, Inc.
>
>
>
> ------------------------------
>
> Message: 11
> Date: Mon, 09 Jun 2008 09:57:15 -0500
> From: Russell Bryant <russell at digium.com>
> Subject: Re: [asterisk-dev] ${DIALSTATUS} = NULL - is that OK?
> To: Asterisk Developers Mailing List <asterisk-dev at lists.digium.com>
> Message-ID: <484D44CB.4060607 at digium.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Andrew Kohlsmith (lists) wrote:
>> On June 9, 2008 06:34:29 am Chris Maciejewski wrote:
>>> Is behaviour described above normal? The reason I am asking is because
>>> my dialplan logic depends on ${DIALSTATUS} variable and currently I
>>> use "GotoIf($[${ISNULL(${DIALSTATUS})} = 1]?label1:label2)" which
>>> works fine for now, but may break if Dial will return some status in
>>> the future.
>>
>> Personally I would like to see Dial set the variable to INPROGRESS as soon as
>> it runs.  I use DIALSTATUS=NULL to see if I dialed at all.  :-)
>
> That would be a reasonable enhancement to make.
>
> In response to the original question.  I think that if there is any code
> path which allows Dial() to exist without setting a DIALSTATUS, then
> that is a bug.
>
> --
> Russell Bryant
> Senior Software Engineer
> Open Source Team Lead
> Digium, Inc.
>
>
>
> ------------------------------
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>
> End of asterisk-dev Digest, Vol 47, Issue 24
> ********************************************
>



More information about the asterisk-dev mailing list