Check specific value for an endpoint in pjsip.conf from dialplan

Is it possible to check for a specific value present for an endpoint in sip.conf or pjsip.conf from Asterisk dial plan?

E.g. from dial plan, look up value for named_call_group for pjsip endpoint 2000?

Nope, doesn’t look like it. When you do a DumpChan() you’ll see in the Channel Data details there is CallGroup and PickupGroup but those only hold the call_group and pickup_group (callgroup, pickupgroup for chan_sip) and there are no options shown for named versions of those settings.

As well even though they are listed in the channel data, no channel variable is created to hold that information to call on it later.

PJSIP has a dialplan function which can be used to query about an endpoint[1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+Function_PJSIP_ENDPOINT

3 Likes

Doh, I didn’t even think of that. I was just looking at channel variables. So yeah something like PJSIP_ENDPOINT(<endpoint>, named_call_group) would get that information.

1 Like

When using Dumpchan, how do I reference a value for an item under Info:?

The variables are referenced via ${var}, however how do I do the same for all the values under Info:?

  Dumping Info For Channel: PJSIP/5315-0000097d:
        ================================================================================
        Info:
        Name=               PJSIP/5315-0000097d
        Type=               PJSIP
        UniqueID=           1566154159.277879
        LinkedID=           1566154159.277879
        CallerIDNum=        5315
        CallerIDName=       Johann 
        ConnectedLineIDNum= 5314
        ConnectedLineIDName=Johann (Away)
        DNIDDigits=         (N/A)
        RDNIS=              (N/A)
        Parkinglot=
        Language=           en
        State=              Ring (4)
        Rings=              1
        NativeFormat=       (g722|ulaw|g729)
        WriteFormat=        g722
        ReadFormat=         g722
        RawWriteFormat=     g722
        RawReadFormat=      g722
        WriteTranscode=     No
        ReadTranscode=      No
        1stFileDescriptor=  -1
        Framesin=           0
        Framesout=          0
        TimetoHangup=       0
        ElapsedTime=        0h0m0s
        BridgeID=           (Not bridged)
        Context=            macro-dialout-one-predial-hook
        Extension=          s
        Priority=           2
        CallGroup=
        PickupGroup=
        Application=        DumpChan
        Data=               9
        Blocking_in=        (Not Blocking)
       
        Variables:
        MACRO_DEPTH=3
        ARG1=
        MACRO_PRIORITY=50
        MACRO_CONTEXT=macro-dial-one
        MACRO_EXTEN=s
        D_OPTIONS=TtrI
        DB_RESULT=Johann
        GOSUB_RETVAL=
        PRESENCESTATE_DISPLAY=(Away)
        KEEPCID=TRUE
        CWIGNORE=
        ALERT_INFO=
        DSTRING=PJSIP/5314/sip:5314@10.124.193.26:5060
        ITER=2
        THISDIAL=PJSIP/5314/sip:5314@10.124.193.26:5060
        ITER2=2
        NEWDIAL=PJSIP/5314&
        THISPART2=PJSIP/5314
        LOOPCNT2=1
        LOOPCNT=1
        DEVICES=5314
        EXTHASCW=ENABLED
        DIALSTATUS_CW=
        DEXTEN=5314
        ARG3=5314
        ARG2=Ttr
        RECMODE=dontcare
        CALLEE=dontcare
        CALLTYPE=internal
        REC_POLICY_MODE_SAVE=
        MON_FMT=wav
        FROMEXTEN=5315
        TIMESTR=20190818-144919
        YEAR=2019
        MONTH=08
        DAY=18
        NOW=1566154159
        REC_STATUS=INITIALIZED
        RT=17
        PICKUPMARK=5314
        EXTTOCALL=5314
        RingGroupMethod=none
        TTL=64
        CALLEE_ACCOUNCODE=
        DIAL_OPTIONS=Ttr
        AMPUSERCID=5315
        AMPUSERCIDNAME=Johann
        AMPUSER=5315
        REALCALLERIDNUM=5315
        TOUCH_MONITOR=1566154159.277879
        ARG5=0
        ARG4=0
        RINGTIMER=17

Any that are accessible would be under the CHANNEL dialplan function[1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+Function_CHANNEL

1 Like

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