How To Get SIP Response Code And Use It To Change Destination.

Home » Asterisk Users » How To Get SIP Response Code And Use It To Change Destination.
Asterisk Users 1 Comment

Hello,

I need to do such a simple thing:

1. Dial SIP/123
2. If I get for example “503” – jump to Dial SIP/789
3. If I get for example “403” – jump to Playback(…)

The real question is:
how can I get SIP Responses and use it in dialplan?

Regards, Jarek

One thought on - How To Get SIP Response Code And Use It To Change Destination.

  • If you’re using below 1.8, there isn’t a way. The DIALSTATUS channel variable can give you a little, but not with those response codes.

    However, if you’re using 1.8, there’s some hope: you can use
    ${HASH(SIP_CAUSE,)} (where is the destination channel, not source) to read the SIP response code.

    For my setup, I have an OpenSIPS sever that handles the lower level logic such as failure routes. I find it a lot amiable to deal with than Asterisk for that sort of thing.

    – Logan