[asterisk-users] DIALSTATUS on CANCEL

Vardan Harutyunyan hvardan71 at gmail.com
Fri Dec 24 15:13:55 UTC 2010


In AEL macro you must use catch h

for example

macro DialToSIPProv (tech,number,prov) {

	Dial(${tech}/${number}@${prov});
	switch(${DIALSTATUS}) {
		case BUSY:
			Noop(BUSY);
			[Do some one]
			break;
		case CHANUNAVAIL:
			Noop(CHANUN);
			[Do some one]
			break;
		case NOANSWER:
			Noop(NOANS);
			[Do some one]
			break;
		case CANCEL:
			Noop(CANCEL);
			[Do some one]
			break;
		case CONGESTION:
			Noop(CONG);
			[Do some one]
			break;
		case ANSWER:
			Noop(ANS);
			[Do some one]
			break;
		default:
			Noop(default);
			[Do some one]
			break;
	};

	catch h {
		Noop(Hangup in macro);
		Noop(${DIALSTATUS});
		Hangup;
	};
	
	return;
};


-- 
Vardan Harutyunyan,
Senior System Administrator

Enterprise Incubator Foundation
123 Hovsep Emin Street,
Yerevan 0051, Republic of Armenia
Tel: + 374 10 219735
Fax: + 374 10 219777
E-mail: info at eif.am
www.eif-it.com

BryantZ at zktech.com wrote:
> If a call is hung up before an answer our "h" extension is not running in our dial macro
>
> Bryant
>
> On Dec 24, 2010, at 3:47 AM, Vardan Harutyunyan<hvardan71 at gmail.com>  wrote:
>
>> Hello Bryant
>> Extension "h" is worked in any case of hangup.
>> It not important to that the call was answered or no.
>> It also be more flexible, if you use instead of ${DIALSTATUS}use ${HANGUPCAUSE}, while in most of cause ${DIALSTATUS} is returned the same return code.
>> http://www.voip-info.org/wiki/view/Asterisk+variable+hangupcause
>>
>>
>> --
>> Vardan Harutyunyan,
>> Senior System Administrator
>>
>> Enterprise Incubator Foundation
>> 123 Hovsep Emin Street,
>> Yerevan 0051, Republic of Armenia
>> Tel: + 374 10 219735
>> Fax: + 374 10 219777
>> E-mail: info at eif.am
>> www.eif-it.com
>>
>> Bryant Zimmerman wrote:
>>> Vardan
>>>
>>> I have not use AEL so it is a bit hard to follow with the formatting the
>>> way it is but it looks like correct.
>>> Please note the "h" extension only appears to run if a call is connected
>>> so I do not know when the "CANCEL" would ever be set.
>>> There may be someone else who can speak to this. It also appears thet
>>> ${DIALSTATUS} may not be set if the call is not allowed to time out or
>>> dialed. To me it would make sense to set the inital state of the
>>> ${DIALSTATUS} to CANCEL and if nothing changes it that would stand, but
>>> I may be missing the point on this can anyone else speak to it?
>>>
>>> Bryant
>>>
>>> ------------------------------------------------------------------------
>>> *From*: "Vardan Harutyunyan"<hvardan71 at gmail.com>
>>> *Sent*: Thursday, December 23, 2010 2:11 AM
>>> *To*: asterisk-users at lists.digium.com
>>> *Subject*: Re: [asterisk-users] DIALSTATUS on CANCEL
>>>
>>> I have make test in AEL.
>>>
>>> context fu {
>>>
>>> _000./userN =>  {
>>> Dial(SIP/${EXTEN:3}@Prov);
>>> Noop(${DIALSTATUS});
>>> };
>>> h =>  {
>>> Noop(${DIALSTATUS});
>>> };
>>> };
>>>
>>> And look CLI
>>> -- Executing [00018185402020 at fu:1] NoOp("SIP/userN-b6317738", "")
>>> in new stack
>>> -- Executing [00018185402020 at fo:2] Dial("SIP/user3-b6317738",
>>> "SIP/18185402020 at Prov") in new stack
>>> -- Called 18185402020 at Prov
>>> -- SIP/Prov-082a83b8 is making progress passing it to
>>> SIP/userN-b6317738
>>> == Spawn extension (fu, 00018185402020, 2) exited non-zero on
>>> 'SIP/user3-b6317738'
>>> -- Executing [h at fu:1] NoOp("SIP/userN-b6317738", "CANCEL") in new stack
>>>
>>> I think, I am right
>>>
>>> --
>>> Vardan Harutyunyan,
>>> Senior System Administrator
>>>
>>> Enterprise Incubator Foundation
>>> 123 Hovsep Emin Street,
>>> Yerevan 0051, Republic of Armenia
>>> Tel: + 374 10 219735
>>> Fax: + 374 10 219777
>>> E-mail: info at eif.am
>>> www.eif-it.com
>>>
>>> Bryant Zimmerman wrote:
>>>> The Dial Status is not set when accessing it from the h extension.
>>>>
>>>> Bryant
>>>>
>>>> ------------------------------------------------------------------------
>>>> *From*: "Vardan Harutyunyan"<hvardan71 at gmail.com>
>>>> *Sent*: Wednesday, December 22, 2010 10:39 AM
>>>> *To*: asterisk-users at lists.digium.com
>>>> *Subject*: Re: [asterisk-users] DIALSTATUS on CANCEL
>>>>
>>>> Try to use h extension
>>>>
>>>> --
>>>> Vardan Harutyunyan,
>>>> Senior System Administrator
>>>>
>>>> Enterprise Incubator Foundation
>>>> 123 Hovsep Emin Street,
>>>> Yerevan 0051, Republic of Armenia
>>>> Tel: + 374 10 219735
>>>> Fax: + 374 10 219777
>>>> E-mail: info at eif.am
>>>> www.eif-it.com
>>>>
>>>> Michael wrote:
>>>>> Hi Nikhil,
>>>>>
>>>>> Both debug and verbose are set to 20. That's all I got, but as you can
>>>>> see, for the other types of reasons, the DIALSTATUS got a value (and we
>>>>> see the events). I'm pretty sure it's a bug.
>>>>>
>>>>> Michael
>>>>>
>>>>> On Wed, Dec 22, 2010 at 9:01 AM, Nikhil<d.nikhil at cem-solutions..net
>>>>> <mailto:d.nikhil at cem-solutions.net>>  wrote:
>>>>>
>>>>> Hi
>>>>> Enable debug level to more than 1 ,you may get something.
>>>>>
>>>>> Thanks
>>>>> Nikhil
>>>>>
>>>>> On 12/22/2010 11:26 AM, Michael wrote:
>>>>>
>>>>> Spawn extension (incoming-private, 11111111, 3) exited non-zero
>>>>> on 'SIP/Proxy-00000031'
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> _____________________________________________________________________
>>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>>>> http://www.asterisk.org/hello
>>>>>
>>>>> asterisk-users mailing list
>>>>> To UNSUBSCRIBE or update options visit:
>>>>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>>>
>>>>
>>>> --
>>>> _____________________________________________________________________
>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>>> http://www.asterisk.org/hello
>>>>
>>>> asterisk-users mailing list
>>>> To UNSUBSCRIBE or update options visit:
>>>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>>>
>>>>
>>>>
>>>> --
>>>> _____________________________________________________________________
>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>>> http://www.asterisk.org/hello
>>>>
>>>> asterisk-users mailing list
>>>> To UNSUBSCRIBE or update options visit:
>>>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>>
>>>
>>> --
>>> _____________________________________________________________________
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>> http://www.asterisk.org/hello
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>>
>>>
>>>
>>> --
>>> _____________________________________________________________________
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>>                 http://www.asterisk.org/hello
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>     http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>               http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                 http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>     http://lists.digium.com/mailman/listinfo/asterisk-users
>




More information about the asterisk-users mailing list