Custom Context

  • Post
    AR
    Participant
    Up
    0
    Down
    this custom context was working in older release of Vital, since upgraded to the following release, I am getting this errror, when dialing custom application extension, direct PJSIP extension  is working and answered by jitsi

    VitalPBX 3.0.8-3
    Asterisk 18.3.0-1

    screen shots and custom code is attached.

    — Executing [cc-1@custom-contexts:2] Gosub(“PJSIP/1001-00000073”, “Jitsi-Conference-Entry,s,1(app-termination,hangup,1)”) in new stack
    [2021-06-04 17:26:14] ERROR[26573][C-00000087]: app_stack.c:593 gosub_exec: Attempt to reach a non-existent destination for Gosub: (Context:Jitsi-Conference -Entry, Extension:s, Priority:1)
    == Spawn extension (custom-contexts, cc-1, 2) exited non-zero on ‘PJSIP/1001-00000073’

    Attachments:
    You must be logged in to view attached files.
    0
Viewing 5 replies - 1 through 5 (of 5 total)
  • Replies
    PitzKey
    Participant
    US
    Up
    0
    Down
    It means that the custom dialplan does not exist, or Asterisk cannot read it.

    In which conf file do you have this dialplan?

    0
    AR
    Participant
    Up
    0
    Down
    extension__30008-dialplan.conf

     

    [root@phone ~]# cd /etc/asterisk/vitalpbx/
    [root@phone vitalpbx]# cat extension__30008-dialplan.conf
    [Jitsi-Conference-Entry]
    exten => s,1,Answer()
    ;Set the extension used for Jitsi
    exten => s,2,Set(Jitsi=30008)
    ;set variable to prevent looping
    exten => s,3,Set(Attempts=0)
    exten => s,4,Set(Attempts=${MATH(${Attempts}+1,i)})
    ;Test for invalid entries. On 4th attempt go to error sub
    exten => s,5,ExecIf($[“${Attempts}” = “4”]?Gosub(Attempts-Error,s,1))
    exten => s,6(begin),NooP()
    ;system listens for DTMF and sets variable “confid”
    ;10=MAX DIGITS, 10=timeout
    exten => s,n,Read(confid,conf-getpin,10,,,10)
    ;If blank value, start over
    exten => s,n,ExecIf($[“${confid}”=””]?goto(Jitsi-Conference-Entry,s,4))
    ;systems plays back the number entered
    exten => s,n,Playback(you-entered)
    exten => s,n,SayDigits(${confid})
    ;system asks to press 1 to accept or 2 to retry
    exten => s,n,Read(digi,if-this-is-correct-press&digits/1&otherwise-press&digits/2,1,,1,10)
    ;If blank value, start over
    exten => s,n,ExecIf($[“${digi}”=””]?goto(Jitsi-Conference-Entry,s,4))
    ;if user presses 1 to confirm, system moves onto to check for passcode, if applicable
    exten => s,n,ExecIf($[“${digi}”=”1″]?goto(passcode))
    ;if callers presses any other digit, system will re-ask them to enter in their number
    exten => s,n,goto(Jitsi-Conference-Entry,s,begin)
    ;CURL Jitsi API with meeting pin & retrieve meeting name as the result
    exten => s,n(passcode),Set(CURL_RESULT=${SHELL(curl –silent https://jitsi-api.jitsi.net/conferenceMapper?id=${confid} | sed -e ‘s/.*”conference”:”\(.*\)@.*/\1/’)})
    exten => s,n,Verbose(0, ${CURL_RESULT});
    ;speeding this up for the password, but you could mirror the process above if you want the extra readout and verification…
    ;system listens for DTMF and sets variable “confpin”
    ;6=MAX DIGITS, 10=timeout
    exten => s,n,Read(confpin,pls-enter-conf-password&vm-then-pound&vm-tocancel,6,,,10)
    ;pls-enter-conf-password
    ;User will be sent onto the conference whether confpin is blank or not
    exten => s,n,goto(enterconf)
    ;Add SIP Headers based on caller’s entries & CURL result
    exten => s,n(enterconf),SIPAddHeader(Jitsi-Conference-Room:${CURL_RESULT})
    exten => s,n,SIPAddHeader(Jitsi-Conference-Room-Pass:${confpin})
    ;Sets CDR “userfield” with the Conference ID
    ;CDR can now be used to track number of calls and durations associated to the Conference ID
    exten => s,n,Set(CDR(userfield)=Jitsi:${CURL_RESULT})
    ;Record Caller’s Name
    exten => s,n,Set(__rnum=${RAND()})
    exten => s,n,Playback(vm-rec-name)
    exten => s,n,Record(/tmp/name-${rnum}.gsm,3,10)
    ;set spygroup to be used for injecting whisper
    exten => s,n,Set(SPYGROUP=1000)
    ;Dial Jitsi extension and play recorded name to the jitisi conference channel
    ;3 = seconds to ring , m = play music on hold , A = announcement for dialed channel, M = Macro after call connects
    exten => s,n,Dial(SIP/${Jitsi},3,m(silence)A(/tmp/name-${rnum})M(Jitsi-join))
    exten => s,n,Verbose(0, Contacting ${Jitsi}… Status is ${DIALSTATUS} );
    ;Take actions based on dialstatus
    exten => s,n,GotoIf($[“${DIALSTATUS}” = “BUSY”]?unknown)
    exten => s,n,GotoIf($[“${DIALSTATUS}” = “NOANSWER”]?conf-busy)
    exten => s,n,GotoIf($[“${DIALSTATUS}” = “CANCEL”]?unknown)
    exten => s,n,GotoIf($[“${DIALSTATUS}” = “CONGESTION”]?unknown)
    exten => s,n,GotoIf($[“${DIALSTATUS}” = “CHANUNAVAIL”]?unknown)
    exten => s,n,GotoIf($[“${DIALSTATUS}” = “DONTCALL”]?unknown)
    exten => s,n,GotoIf($[“${DIALSTATUS}” = “TORTURE”]?unknown)
    exten => s,n,GotoIf($[“${DIALSTATUS}” = “INVALIDARGS”]?unknown)
    ;Hangup if condition is not matched (in the event a new dialstatus is added with an update
    exten => s,n,Hangup()
    ;Jitsi is not reachable, play error message
    ;This is also a good place to send an SMS to your lead system admins
    exten => s,n(unknown),playback(please-contact-tech-supt&vm-goodbye)
    exten => s,n,Hangup()
    ;Initial attempt was ok, but Jitsi didn’t pickup the call.
    ;It’s likely that the host hasn’t yet authenticated / started the meeting
    ;Indicate that we’re waiting for the leader to join and keep trying
    exten => s,n(conf-busy),Playback(conf-waitforleader)
    ;120 = seconds to ring , m = play music on hold , A = announcement for dialed channel, M = Macro after call connects
    exten => s,n,Dial(SIP/${Jitsi},120,m(default)A(/tmp/name-${rnum})M(Jitsi-join))
    exten => s,n,Hangup()

    [Attempts-Error]
    ;system plays message and hangs up
    exten => s,1,playback(sorry-youre-having-problems)
    exten => s,n,playback(tt-monkeys)
    ;exten => s,n,playback(hangup-try-again)
    exten => s,n,Hangup()

    [macro-Jitsi-join]
    exten => s,1,Originate(Local/999@JitsiWhisper,app,Playback,confbridge-join)

    [JitsiWhisper]
    exten => _X.,1,NoCDR
    exten => _X.,n,Answer()
    exten => _X.,n,ChanSpy(,g(1000),qw)
    exten => _X.,n,Hangup()

    [root@phone vitalpbx]#

     

    0
    PitzKey
    Participant
    US
    Up
    0
    Down
    cd /etc/asterisk/vitalpbx/
    mv extension__30008-dialplan.conf extensions__30008-dialplan.conf
    asterisk -x"core reload"
    asterisk -x"dialplan show Jitsi-Conference-Entry"

     

    Post the output from the last command

    0
    AR
    Participant
    Up
    0
    Down
    [root@phone ~]# cd /etc/asterisk/vitalpbx/
    [root@phone vitalpbx]# mv extension__30008-dialplan.conf extensions__30008-dialplan.conf
    [root@phone vitalpbx]# asterisk -x”core reload”
    [root@phone vitalpbx]# asterisk -x”dialplan show Jitsi-Conference-Entry”
    [ Context ‘Jitsi-Conference-Entry’ created by ‘pbx_config’ ]
    ‘s’ => 1. Answer() [extensions__30008-dialplan.conf:2967]
    2. Set(Jitsi=30008) [extensions__30008-dialplan.conf:2969]
    3. Set(Attempts=0) [extensions__30008-dialplan.conf:2971]
    4. Set(Attempts=${MATH(${Attempts}+1,i)}) [extensions__30008-dialplan.conf:2972]
    5. ExecIf($[“${Attempts}” = “4”]?Gosub(Attempts-Error,s,1)) [extensions__30008-dialplan.conf:2974]
    [begin] 6. NooP() [extensions__30008-dialplan.conf:2975]
    7. Read(confid,conf-getpin,10,,,10) [extensions__30008-dialplan.conf:2978]
    8. ExecIf($[“${confid}”=””]?goto(Jitsi-Conference-Entry,s,4)) [extensions__30008-dialplan.conf:2980]
    9. Playback(you-entered) [extensions__30008-dialplan.conf:2982]
    10. SayDigits(${confid}) [extensions__30008-dialplan.conf:2983]
    11. Read(digi,if-this-is-correct-press&digits/1&otherwise-press&digits/2,1,,1,10) [extensions__30008-dialplan.conf:2985]
    12. ExecIf($[“${digi}”=””]?goto(Jitsi-Conference-Entry,s,4)) [extensions__30008-dialplan.conf:2987]
    13. ExecIf($[“${digi}”=”1″]?goto(passcode)) [extensions__30008-dialplan.conf:2989]
    14. goto(Jitsi-Conference-Entry,s,begin) [extensions__30008-dialplan.conf:2991]
    [passcode] 15. Set(CURL_RESULT=${SHELL(curl –silent https://jitsi-api.jitsi.net/conferenceMapper?id=${confid} | sed -e ‘s/.*”conference”:”\(. *\)@.*/\1/’)}) [extensions__30008-dialplan.conf:2993]
    16. Verbose(0, ${CURL_RESULT}) [extensions__30008-dialplan.conf:2994]
    17. Read(confpin,pls-enter-conf-password&vm-then-pound&vm-tocancel,6,,,10) [extensions__30008-dialplan.conf:2998]
    18. goto(enterconf) [extensions__30008-dialplan.conf:3001]
    [enterconf] 19. SIPAddHeader(Jitsi-Conference-Room:${CURL_RESULT}) [extensions__30008-dialplan.conf:3003]
    20. SIPAddHeader(Jitsi-Conference-Room-Pass:${confpin}) [extensions__30008-dialplan.conf:3004]
    21. Set(CDR(userfield)=Jitsi:${CURL_RESULT}) [extensions__30008-dialplan.conf:3007]
    22. Set(__rnum=${RAND()}) [extensions__30008-dialplan.conf:3009]
    23. Playback(vm-rec-name) [extensions__30008-dialplan.conf:3010]
    24. Record(/tmp/name-${rnum}.gsm,3,10) [extensions__30008-dialplan.conf:3011]
    25. Set(SPYGROUP=1000) [extensions__30008-dialplan.conf:3013]
    26. Dial(SIP/${Jitsi},3,m(silence)A(/tmp/name-${rnum})M(Jitsi-join)) [extensions__30008-dialplan.conf:3016]
    27. Verbose(0, Contacting ${Jitsi}… Status is ${DIALSTATUS} ) [extensions__30008-dialplan.conf:3017]
    28. GotoIf($[“${DIALSTATUS}” = “BUSY”]?unknown) [extensions__30008-dialplan.conf:3019]
    29. GotoIf($[“${DIALSTATUS}” = “NOANSWER”]?conf-busy) [extensions__30008-dialplan.conf:3020]
    30. GotoIf($[“${DIALSTATUS}” = “CANCEL”]?unknown) [extensions__30008-dialplan.conf:3021]
    31. GotoIf($[“${DIALSTATUS}” = “CONGESTION”]?unknown) [extensions__30008-dialplan.conf:3022]
    32. GotoIf($[“${DIALSTATUS}” = “CHANUNAVAIL”]?unknown) [extensions__30008-dialplan.conf:3023]
    33. GotoIf($[“${DIALSTATUS}” = “DONTCALL”]?unknown) [extensions__30008-dialplan.conf:3024]
    34. GotoIf($[“${DIALSTATUS}” = “TORTURE”]?unknown) [extensions__30008-dialplan.conf:3025]
    35. GotoIf($[“${DIALSTATUS}” = “INVALIDARGS”]?unknown) [extensions__30008-dialplan.conf:3026]
    36. Hangup() [extensions__30008-dialplan.conf:3028]
    [unknown] 37. playback(please-contact-tech-supt&vm-goodbye) [extensions__30008-dialplan.conf:3031]
    38. Hangup() [extensions__30008-dialplan.conf:3032]
    [conf-busy] 39. Playback(conf-waitforleader) [extensions__30008-dialplan.conf:3036]
    40. Dial(SIP/${Jitsi},120,m(default)A(/tmp/name-${rnum})M(Jitsi-join)) [extensions__30008-dialplan.conf:3038]
    41. Hangup() [extensions__30008-dialplan.conf:3039]

    -= 1 extension (41 priorities) in 1 context. =-
    [root@phone vitalpbx]#

    0
    AR
    Participant
    Up
    0
    Down
    it is working after renaming the file and restart asterisk -x”core reload”

     

    thanks a lot

    0
Viewing 5 replies - 1 through 5 (of 5 total)
  • The forum ‘Reporting an Issue’ is closed to new topics and replies.