Hello!
We have about 5 phone numbers
Can you please help me defining which number dialed client to reach our asterisk?
Hello!
We have about 5 phone numbers
Can you please help me defining which number dialed client to reach our asterisk?
If it is a PSTN call over SIP trunk or PRI, Check DNIS variable in dialplan. In case of extension to extension calling, look at value of EXTEN variable.
–Satish Barot
Generally it is always the extensions number. I think you will find that ${DNIS} is coming from your GUI. Having said that, there may be some cases where ${CALLERID(dnid)} is useful.
Ahha missed it. David55 you are right. it should be ${CALLERID(dnid)} and not DNIS
–Satish Barot
great, thank you, i’ll try it out!
I’m using this variable in CURL function to send info directly to site.I’ve done tike this but it doesn’t work:
[globals]
SITE=${CURL(site.com/telephony/get-manager-phone?phone=${CALLERID(num)}$dest=${CALLERID(DNID)})}
[welcome253]
exten => s,1,Ringing
exten => s,n,Set(phid=${SITE})
exten => s,n,GotoIf($["${phid}"=“0”]?hello)
exten => s,n,Dial(SIP/${phid},15,Tt)
exten => s,n,GotoIf($[$["${phid}"=“249”]|$["${phid}"=“239”]|$["${phid}"=“216”]|$["${phid}"=“213”]]?welcome449,s,10:hello)
exten => s,n(hello),Answer
exten => s,n,Ringing
exten => s,n,wait(1)
exten => s,n,BackGround(/etc/asterisk/5XXwelcome/hw-ekb-work)
exten => s,n,WaitExten(2)
exten => 1,1,Macro(dialnumber,SIP/503&SIP/504,503+504,180,Tt)
exten => 1,n,Hangup
exten => 2,1,Macro(dialnumber,SIP/216&SIP/239,216+239,120,Tt)
exten => 2,n,Hangup
exten => 3,1,Playback(/etc/asterisk/5XXwelcome/hw-ekb-rejim)
exten => 3,n,Goto(s,2)
exten => t,1,Macro(dialnumber,SIP/503&SIP/504,503+504,180,Tt)
exten => t,n,Hangup
[welcome449]
exten => s,1,Ringing
exten => s,n,Set(phid=${SITE})
exten => s,n,GotoIf($["${phid}"=“0”]?hello)
exten => s,n,Dial(SIP/${phid},15,Tt)
exten => s,n,GotoIf($[$["${phid}"=“249”]|$["${phid}"=“239”]|$["${phid}"=“216”]|$["${phid}"=“213”]]?welcome449,s,10:hello)
exten => s,n(hello),Answer
;exten => s,1,Answer
exten => s,n,Ringing
exten => s,n,wait(1)
exten => s,n,BackGround(/etc/asterisk/inet/hw-inet-work)
exten => s,n,Macro(dialnumber,SIP/239&SIP/249,216+239,15,Tt)
exten => s,n,Macro(dialnumber,SIP/216&SIP/213,216+239,120,Tt)
exten => s,n,Hangup
I beleive the parameter is case sensistive.