I’m trying to set up a scenario where I:
Have an existing SIP call.
When this caller presses a particular choice on an IVR, I want to route that call out a SIP trunk (which is a custom extension).
When I create a custom extension using FreePBX 2.4.0, I can put things like:
SIP/1234@OtherSipBox
into my “Device Options->This device uses custom technology. dial” rule with no problem.
However, the SIP box on the other end of this trunk really wants to gather its DID from the extension dialed. Therefore, I want my “Device Options->This device uses custom technology. dial” rule to look like:
SIP/${EXTEN}@OtherSipTrunk
or
SIP/${DIALEDPEERNAME}@OtherSipTrunk
or similar scenarios, where I could put in the typical Asterisk dialplan variable and have it resolved and dialed. When I put this into my extension, test it, and dial the appropriate condition in the IVR, Asterisk properly sends the call down the trunk, but seems to literally dial the ${} macro variable name. It seems FreePBX is quoting it and passing it to Asterisk?
Asterisk says:
– Executing [s@macro-dial:7] Dial(“SIP/172.16.3.75-08217f48”, “SIP/7${SIP_HEADER(TO)}@OtherSipTrunk||tr”) in new stack
– Called 7${SIP_HEADER(TO)}@OtherSipTrunk
– Got SIP response 400 “Bad Request - ‘Malformed/Missing URL’” back from 172.16.3.75
– SIP/VoIPGW-08275850 is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
In this scenario, 172.16.3.75 is getting a request to dial a non-number and it doesn’t know how to do that.
Is there a quick trick to make FreePBX/Asterisk let me put dialplan variables directly into my dial rule, or do I have to do that with a custom context? Or perhaps I can do it with a custom trunk?