I was able to find a work-around solution using yours and others input. Hopefully this will help someone else that requires the ability to dynamically communicate through different video codecs and for anyone coming across this solution, feel free to improve it.
When a caller comes in to the PBX, they are run through an IVVR menu which will place them in a Queue to be connected with an agent. While in this initial IVVR menu, the following code is placed:
;This part retrieves the pjsip SDP video codecs from the caller
exten => start,8,Set(codec=${PJSIP_MEDIA_OFFER(video)})
;This part looks at the variable and determines which codec is first, if vp8 or vp9, we go to VP8 subroutine, else we assume H264 and go to h264 subroutine.
;Match for vp8/vp9 preferred codec if present in the SDP offer, if it is not the first codec, move to next
exten => start,9,GotoIf($[$["${codec:0:3}" = "vp9"] | $["${codec:0:3}" = "vp8"]]?if_vp8,1)
;Match for h264 preferred codec if present in the SDP offer, if it is not present, agent is not capable of receiving call and progresses to next line in dial plan. (or set :context,extension,priority) to send caller to another part of dial plan.
exten => start,10,GotoIf($[$["${codec:0:4}" = "h264"]]?if_h264,1)
This is the subroutine the caller will go to, based on the determination above
exten => if_vp8,1,NoOp()
same => n,Set(codec=vp8)
same => n,Queue(QueueA,,,,,,,1(codecid^if_vp8^1)) ;Queues caller with instructions to run extension if_vp8 from codecid context when coming out of queue and connecting to agent.
exten => if_h264,1,NoOp()
same => n,Set(codec=h264)
same => n,Queue(QueueA,,,,,,,1(codecid^if_h264^1)) ;Queues caller with instructions to run extension if_h264 from codecid context when coming out of queue and connecting to agent.
This is the context codecid which has the code to be executed when the caller is dropped out of the queue, as per the instructions given in extensions ‘if_vp8’ or ‘if_h264’.
[codecid]
exten => if_vp8,1,NoOp()
same => n,Set(codec=vp8) ;manually set variable
same => n,Set(PJSIP_MEDIA_OFFER(video)=!all,${codec}) ;set invite with defined variable
same => n,Set(PJSIP_SEND_SESSION_REFRESH()=invite) ;send invite with variable
same => n,Return()
exten => if_h264,1,NoOp()
same => n,Set(codec=h264) ;manually set variable
same => n,Set(PJSIP_MEDIA_OFFER(video)=!all,${codec}) ;set invite with defined variable
same => n,Set(PJSIP_SEND_SESSION_REFRESH()=invite) ;send invite with variable
same => n,Return()