Can not receive DIALSTATUS

Dear everyone
I can not receive answer status after connected call.

one side is webphone
other side is webphone.
this is dialplan that works for my calling.

[macro-dial-one]
include => macro-dial-one-custom
exten => s,1,Set(DEXTEN=${ARG3})
exten => s,n,Set(__CRM_SOURCE=${CALLERID(num)})
exten => s,n(setexttocall),ExecIf($[${LEN(${EXTTOCALL})}=0 & ${LEN(${DEXTEN})}>0]?Set(__EXTTOCALL=${DEXTEN}))
exten => s,n,Set(DIALSTATUS_CW=)
exten => s,n,GosubIf($[“${FROM_DID}”!=“” & “${SCREEN}”=“” & “${SIGNORE}”=“” & “${DB(AMPUSER/${DEXTEN}/screen)}”!=“”]?screen,1())
exten => s,n,GosubIf($[“${DB(CF/${DEXTEN})}”!=“”]?cf,1())
exten => s,n,GotoIf($[“${DEXTEN:-1}”=“#” | “${DB(DND/${DEXTEN})}”=“”]?skip1)
exten => s,n,Set(DEXTEN=)
exten => s,n,Set(DIALSTATUS=BUSY)
exten => s,n(skip1),GotoIf($[“${DEXTEN}”=“”]?nodial)
exten => s,n,GotoIf($[“${DEXTEN:-1}”=“#”]?continue)
exten => s,n,Set(EXTHASCW=${IF($[“${CWIGNORE}”!=“”]? :${DB(CW/${DEXTEN})})})
exten => s,n,GotoIf($[“${EXTHASCW}”=“” | “${DB(CFB/${DEXTEN})}”!=“” | “${DB(CFU/${DEXTEN})}”!=“”]?next1:cwinusebusy)
exten => s,n(next1),GotoIf($[“${DB(CFU/${DEXTEN})}”!=“” & (“${EXTENSION_STATE(${DEXTEN}@ext-local)}”=“UNAVAILABLE” | “${EXTENSION_STATE(${DEXTEN}@ext-local)}”=“UNKNOWN”)]?docfu:skip3)
exten => s,n(docfu),Set(DEXTEN=)
exten => s,n,Set(DIALSTATUS=NOANSWER)
exten => s,n,Goto(nodial)
exten => s,n(skip3),GotoIf($[“${EXTHASCW}”=“” | “${DB(CFB/${DEXTEN})}”!=“”]?next2:continue)
exten => s,n(next2),GotoIf($[“${EXTENSION_STATE(${DEXTEN}@ext-local)}”=“NOT_INUSE” | “${EXTENSION_STATE(${DEXTEN}@ext-local)}”=“UNAVAILABLE” | “${EXTENSION_STATE(${DEXTEN}@ext-local)}”=“UNKNOWN”]?continue)
exten => s,n,ExecIf($[“${DB(CFB/${DEXTEN})}”!=“” & “${CFIGNORE}”=“”]?Set(DIALSTATUS=BUSY))
exten => s,n,GotoIf($[“${EXTHASCW}”!=“” | “${DEXTEN:-1}”=“#”]?cwinusebusy)
exten => s,n,Set(DEXTEN=)
exten => s,n,Set(DIALSTATUS=BUSY)
exten => s,n,Goto(nodial)
exten => s,n(cwinusebusy),GotoIf($[“${EXTHASCW}”!=“” & “${CWINUSEBUSY}”=“true”]?next3:continue)
exten => s,n(next3),ExecIf($[“${EXTENSION_STATE(${DEXTEN}@ext-local)}”!=“UNAVAILABLE” & “${EXTENSION_STATE(${DEXTEN}@ext-local)}”!=“NOT_INUSE” & “${EXTENSION_STATE(${DEXTEN}@ext-local)}”!=“UNKNOWN”]?Set(DIALSTATUS_CW=BUSY))
exten => s,n(continue),GotoIf($[“${DEXTEN}”=“”]?nodial)
exten => s,n,GosubIf($[“${DEXTEN:-1}”!=“#”]?dstring,1():dlocal,1())
exten => s,n,GotoIf($[${LEN(${DSTRING})}=0]?nodial)
exten => s,n,GotoIf($[“${DEXTEN:-1}”=“#”]?skiptrace)
exten => s,n,GosubIf($[${REGEX(“[1]?[0-9]+$” ${CALLERID(number)})} = 1]?ctset,1():ctclear,1())
exten => s,n(skiptrace),Set(D_OPTIONS=${IF($[“${NODEST}”!=“” & ${REGEX(“(M[(]auto-blkvm[)])” ${ARG2})} != 1]?${ARG2}M(auto-blkvm):${ARG2})})
exten => s,n,GosubIf($[“${ALERT_INFO}”!=“” & “${HASH(SIPHEADERS,Alert-Info)}”=“”]?func-set-sipheader,s,1(Alert-Info,${ALERT_INFO}))
exten => s,n,Noop(Blind Transfer: ${BLINDTRANSFER}, Attended Transfer: ${ATTENDEDTRANSFER}, User: ${AMPUSER}, Alert Info: ${ALERT_INFO})
exten => s,n,ExecIf($[“${ALERT_INFO}”=“” & ${LEN(${AMPUSER})}!=0 & ${LEN(${BLINDTRANSFER})}=0 & ${LEN(${ATTENDEDTRANSFER})}=0]?Set(ALERT_INFO=))
exten => s,n,ExecIf($[${LEN(${BLINDTRANSFER})}!=0]?Set(ALERT_INFO=))
exten => s,n,ExecIf($[${LEN(${ATTENDEDTRANSFER})}!=0]?Set(ALERT_INFO=))
exten => s,n,ExecIf($[“${RVOL}”!=“”]?Set(ALERT_INFO=${IF($[“${ALERT_INFO}”!=“”]?${ALERT_INFO}:Normal)};volume=${RVOL}))
exten => s,n,ExecIf($[“${RVOL}”=“” & “${DB(AMPUSER/${EXTTOCALL}/rvolume)}” != “”]?Set(ALERT_INFO=${IF($[“${ALERT_INFO}”!=“”]?${ALERT_INFO}:Normal)};volume=${DB(AMPUSER/${EXTTOCALL}/rvolume)}))
exten => s,n,GosubIf($[“${ALERT_INFO}”!=“” & “${ALERT_INFO}”!=" “]?func-set-sipheader,s,1(Alert-Info,${ALERT_INFO}))
exten => s,n,ExecIf($[(”${MOHCLASS}“!=“default”) & (”${MOHCLASS}“!=”“)]?Set(CHANNEL(musicclass)=${MOHCLASS}))
exten => s,n,GosubIf($[”${QUEUEWAIT}“!=”“]?qwait,1())
exten => s,n,Set(__CWIGNORE=${CWIGNORE})
exten => s,n,Set(__KEEPCID=TRUE)
exten => s,n,GotoIf($[”${USEGOTO}“=“1”]?usegoto,1)
exten => s,n,GotoIf($[”${DB(AMPUSER/${EXTTOCALL}/cidname)}" = “” || “${DB(AMPUSER/${AMPUSER}/cidname)}” = “”]?godial)
exten => s,n,Gosub(sub-presencestate-display,s,1(${EXTTOCALL}))
exten => s,n,Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/${EXTTOCALL}/cidname)} ${PRESENCESTATE_DISPLAY})
exten => s,n,Set(CONNECTEDLINE(num)=${EXTTOCALL})
exten => s,n,Set(D_OPTIONS=${D_OPTIONS})
exten => s,n(godial),Macro(dialout-one-predial-hook,)
exten => s,n,ExecIf($[“${DIRECTION}” = “INBOUND”]?Set(D_OPTIONS=${STRREPLACE(D_OPTIONS,T)}I))
exten => s,n,ExecIf($[“${DB(AMPUSER/${DEXTEN}/cwtone)}” = “enabled” & “${EXTENSION_STATE(${DEXTEN}@ext-local)}” = “INUSE”]?Set(CWRING=r(callwaiting)):Set(CWRING=))
exten => s,n(dialapp),Noop()
exten => s,n,ExecIf($[“${ivrreturn}” = “1”]?Set(D_OPTIONS=${D_OPTIONS}g))
exten => s,n,Dial(${DSTRING},${ARG1},${D_OPTIONS}${CWRING})
exten => s,n,Log(NOTICE, Alice call result: ${DIALSTATUS})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n,ExecIf($[“${DIALSTATUS}”=“ANSWER” & “${CALLER_DEST}”!=“”]?MacroExit())
exten => s,n,ExecIf($[“${DIALSTATUS_CW}”!=“”]?Set(DIALSTATUS=${DIALSTATUS_CW}))
exten => s,n,GosubIf($[(“${SCREEN}”!=“”&(“${DIALSTATUS}”=“TORTURE”|“${DIALSTATUS}”=“DONTCALL”))|“${DIALSTATUS}”=“ANSWER”]?s-${DIALSTATUS},1())
exten => s,n,MacroExit()
exten => s,n(nodial),Noop()
exten => s,n,ExecIf($[“${DIALSTATUS}” = “”]?Set(DIALSTATUS=NOANSWER))
exten => s,n,Noop(Returned from dial-one with nothing to call and DIALSTATUS: ${DIALSTATUS})
exten => s,n,MacroExit()
exten => s,n,GotoIf($[“${ZULU_RAW_TYPE}”!=“Sangomacrm-url”]?crm-save)
exten => s,n,AGI(agi://127.0.0.1/sangomacrm.agi,true)
exten => s,n,Goto(zulu-event)
exten => s,n(crm-save),AGI(agi://127.0.0.1/sangomacrm.agi)

exten => h,1,Macro(hangupcall,)

exten => usegoto,1,Set(USEGOTO=)
exten => usegoto,n,Goto(from-internal,${DSTRING},1)

exten => ctset,1,Set(DB(CALLTRACE/${DEXTEN})=${CALLERID(number)})
exten => ctset,n,Return()

exten => ctclear,1,Noop(Deleting: CALLTRACE/${DEXTEN} ${DB_DELETE(CALLTRACE/${DEXTEN})})
exten => ctclear,n,Return()

exten => dlocal,1,Set(DSTRING=${IF($[“${ARG1}”=“”]?${DEXTEN:0:${MATH(${LEN(${DEXTEN})}-1,int)}}:Local/${DEXTEN:0:${MATH(${LEN(${DEXTEN})}-1,int)}}@from-internal/n)})
exten => dlocal,n,Set(USEGOTO=${IF($[“${ARG1}”=“”]?1:0)})
exten => dlocal,n,Return()

exten => s-ANSWER,1,Noop(Call successfully answered)
exten => s-ANSWER,n,GosubIf($[“${DIALSTATUS}”=“ANSWER”]?GETDTMF^${AMPUSER}^${CALLERID(number)})
exten => s-ANSWER,n,GotoIf($[“${ivrreturn}” = “1”]?${IVR_CONTEXT},return,1)
exten => s-ANSWER,n(bye),Macro(hangupcall,)

;–== end of [macro-dial-one] ==–;


  1. + ↩︎

tl;dr

This isn’t ‘your dialplan.’ This is a snippet of what you think is part of your dialplan. What is important is what Asterisk thinks is your dialplan. I suspect a couple of ‘show dialplan <context>’ and a console log will be more helpful.

What have you observed that may be the problem?

What have you tried to resolve the problem?

Also, macro was deprecated back in Asterisk 11 so I suspect interest may be minimal.

Also, also, wrapping code snippets and console log snippets in block preformatted text tags (3 backticks before and after) will help readability.

this is standard dialplan.
my extension context is from-internal.
based on the from-internal, the dialplan works for my extension.
all is good.

I gonna get dtmf code.
so to get this code, I created dtmf context
and I trying to find the location.
as checking for CLI log for calling, I can see dial () of macro-dial-one.
current calling works with macro-dial-one.
so after dial() function, I added detect dialstatus function and if the status is answer, it will goto dtmf getting part.

exten => s,n,Dial(${DSTRING},${ARG1},${D_OPTIONS}${CWRING})
exten => s,n,Log(NOTICE, Alice call result: ${DIALSTATUS})
exten => s,n,Goto(s-${DIALSTATUS},1)

exten => s-ANSWER,1,Noop(Call successfully answered)
exten => s-ANSWER,n,GosubIf($[“${DIALSTATUS}”=“ANSWER”]?GETDTMF^${AMPUSER}^${CALLERID(number)})
exten => s-ANSWER,n,GotoIf($[“${ivrreturn}” = “1”]?${IVR_CONTEXT},return,1)
exten => s-ANSWER,n(bye),Macro(hangupcall,)

but this is problem.
in calling, after dial() accessed, all lines below dial().doesnt processed.
so although I added detect function, it doesnt work.
why?
what is problem?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.