Get the sip response with dialplan

Hello all,

Is it possible to get the sip response with dialplan and store it to debug or cdr userfield etc?
I prefer the sip response instead of .850 causes :slight_smile:

Kind regards,
KCH

You can do the following:

exten = s,1,Set(SIP_CAUSE=${HANGUPCAUSE(${CHANNEL(name)},tech)})

This will return something like SIP 200 OK or SIP 486 User Busy because it is going to supply the cause based on the tech (PJSIP/SIP are SIP) so you will need to parse that to get the reply code only or use REGEX to match the code.

In order to do this you will need to add a hangup handler to the called channel meaning that with chan_pjsip this has to be done in pre-dial handler which will require you to re-write the func-apply-sipheaders Gosub() to add the hangup handler properly to grab the information. Since that is the pre-dial gosub called on.

thanks for your quick answer. have your tried on PJSIP?

Yes. Hence my saying it.

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