Partial Rerouting / SIP 302 with FreePBX

Folks,

I am trying to achieve something with moderate Asterisk and/or FreePBX knowledge related to deflecting calls using Partial Rerouting / SIP 302. I know my trunk provider supports the feature, but I fail to understand how I would, for instance, add this to the dial-plan in FreePBX. I need to use Asterisk’s Transfer()-function to deflect the call – but where would I put it, and what would be the ideal features to use in FreePBX for this? I’ve tried custom extensions and a number of other things but this doesn’t seen right.

The desired outcome is:

  • Call comes in to a group of phones
  • Nobody picks up
  • Call is deflected via Transfer() to another phone number.

Thank you very much for your help in advance. And pointers to according documentation would also be highly appreciated. I’ve wrenched out Google, but it doesn’t give me a lot about this.

Transfer will do what you want with some custom dialplan. I don’t remember if it was an option in ring groups as I don’t have the UI open but you want to uncheck answer. You can’t 302 after an answer

So people can follow this, the user ran into an old issue and created a new Github issue for it: [bug]: res_pjsip: Contact header set incorrectly for call redirect (302 Moved temp.) when external_* set · Issue #1141 · asterisk/asterisk · GitHub

Yup, thank you. Just for the record, here is a solution that will work flawlessly, provided the mentioned patch above is applied: Add a custom extension to extensions_custom.conf that looks like this:

[external-transfer-out]
exten => s,1,transfer(PJSIP/sip:[email protected])

(example applies to CompanyFlex SIP trunks provided by Deutsche Telekom in Germany). Then, in FreePBX, create a custom destination and have it point to “external-transfer-out”. Use that destination as target for unhandled calls in your extension / call group / whatever, et voilà.

Thanks. Is there some way to make that destination number variable? So for example I would want it to transfer to number A today. And next week I want it to a different number. Is there anyway to update that number instead of hard coding it into the custom dial plan?

You can put it in AstDB, or another database, or even read it from a simple text file. You could even put it in a global variable.

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