[Asterisk-Users] Dialstatus
Moises Silva
moises.silva at gmail.com
Tue Jun 6 07:06:44 MST 2006
this is what I have, and it works on Asterisk-1.2.1
[macro-sipextens]
exten => s,1,Macro(validate_extension)
exten => s,2,Dial(SIP/${sipprefix}${num},${calltimeout}|${calloptions})
exten => s,3,Macro(catch_dial_response,${DIALSTATUS})
so, After Dial, I catch the dial response, and heres the catch macro
[macro-catch_dial_response]
exten => s,1,GotoIf($[${ARG1} = NOANSWER] ? 11 : 2)
exten => s,2,GotoIf($[${ARG1} = CHANUNAVAIL] ? 22 : 3)
exten => s,3,GotoIf($[${ARG1} = BUSY] ? 33 : 4)
exten => s,4,Macro(generic_handler)
exten => s,11,Macro(noanswer_handler)
exten => s,22,Macro(unavail_handler)
exten => s,33,Macro(busy_handler)
FInally here are the 4 other macros
[macro-noanswer_handler]
exten => s,1,SetCDRUserField(-10/${agi_cdr_id})
exten => s,2,Set(voicemail_flags=u)
exten => s,3,Playback(iss_noanswer_channel_${defaultlang})
exten => s,4,Goto(loopback_ivr,s,1)
[macro-unavail_handler]
exten => s,1,SetCDRUserField(-11/${agi_cdr_id})
exten => s,2,Set(voicemail_flags=u)
exten => s,3,GotoIf($[foo${is_exten} = foo] ? 4 : 6)
exten => s,4,Playback(iss_unavailable_channel_${defaultlang})
exten => s,5,Goto(loopback_ivr,s,1)
exten => s,6,Playback(iss_unavailable_extension_${defaultlang})
exten => s,7,Goto(loopback_ivr,s,1)
[macro-busy_handler]
exten => s,1,SetCDRUserField(-12/${agi_cdr_id})
exten => s,2,Set(voicemail_flags=b)
exten => s,3,Playback(iss_busy_channel_${defaultlang})
exten => s,4,Goto(loopback_ivr,s,1)
[macro-generic_handler]
exten => s,1,SetCDRUserField(-14/${agi_cdr_id})
exten => s,2,Set(voicemail_flags=u)
exten => s,3,GotoIf($[foo${is_exten} = foo] ? 4 : 6)
exten => s,4,Playback(iss_unavailable_channel_${defaultlang})
exten => s,5,Goto(loopback_ivr,s,1)
exten => s,6,Playback(iss_unavailable_extension_${defaultlang})
exten => s,7,Goto(loopback_ivr,s,1)
If you cant get it working, simply do something like this:
[test]
exten => _XX,1,Answer()
exten => _XX,2,Dial(SIP/${EXTEN})
exten => _XX,3,NoOp(${DIALSTATUS})
That will tell you what status is generated.
Regards
On 6/6/06, bob at semanticedge.de <bob at semanticedge.de> wrote:
> I tried with CHANUNAVAIL but I was not successful. I want to try to call a
> SIP client. If it is not answering and cannot be found I want wo call
> someone else.
> How can I do that? NOANSWER and CHANUNAVAIL do not work out.
> > Wether the SIP client is not registered or does not exists at all you
> > will get CHANUNAVAIL.
> >
> > Regards
> >
> > On 6/6/06, Christophorus Laube <bob at semanticedge.de> wrote:
> >> Hi,
> >>
> >> I use an E1-Board to hand the calls over to internal SIP-Clients. My
> >> Question is which Dialstatus is set when the SIP-client is unreachable.
> >> I tried with NOANSWER but does not seem to be suitable.
> >> Does anyone of you have a solution?
> >> In voip-info.org wiki there is a Dialstatus CHANUNAVAIL but this is
> >> explained by " Channel unavailable. On SIP, peer may not be
> >> registered.". So this seems not to be right, or does it?
> >> TIA, Christophorus
> >>
> >>
> >>
> >> _______________________________________________
> >> --Bandwidth and Colocation provided by Easynews.com --
> >>
> >> Asterisk-Users mailing list
> >> To UNSUBSCRIBE or update options visit:
> >> http://lists.digium.com/mailman/listinfo/asterisk-users
> >>
> >>
> >>
> >>
> >
> >
> > --
> > "Su nombre es GNU/Linux, no solamente Linux, mas info en
> > http://www.gnu.org"
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > Asterisk-Users mailing list
> > To UNSUBSCRIBE or update options visit:
> > http://lists.digium.com/mailman/listinfo/asterisk-users
> >
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
--
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"
More information about the asterisk-users
mailing list