extensions_custom.conf

how do I know if the code in this file is being called or not ?

[custom-get-did-from-sip]
exten => s,1,Noop(Fixing DID using information from SIP TO header)
exten => s,n,Set(pseudodid=${SIP_HEADER(To)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => s,n,Goto(from-trunk,${pseudodid},1)

also how would I call it from a trunk so

i have a context=custom-get-did-from-sip in the trunk peer
FreePBX 2.5.1.5
Asterisk 1.4.23.1
ubuntu 8.04

From the machine’s console, or a ssh session type the following…[code]

asterisk -r

  • CLI> core set verbose 3
  • CLI>
    [/code]
    And then cause a call (e.g. dial) whatever number you think should trigger this context. The call flow through the dial plan will display line-by-line-by-line at the CLI prompt. Watch for your fragment.

Sorry, but I’m not too sure what you’re asking in part-two of your post re: “call it from a trunk.”

/S

I think the main issue was that I wasn’t sure exactly how the extension_custom.conf works.

after a battle with a service provider we found out the issue was on their end.

but basically they have this script
exten => s,1,Noop(Fixing DID using information from SIP TO header)
exten => s,n,Set(pseudodid=${SIP_HEADER(To)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => s,n,Goto(from-trunk,${pseudodid},1)

That what I am assuming strips the header in the sip packets and forwards this information and sends it to from-trunk.

I just didn’t even know how to call this part of the script in the extensions_custom.conf file when we have an incoming call.

All this asterisk stuff is finally starting to come together in my head! :stuck_out_tongue:

I had to add a custom destination through the gui to get it to call the custom context I had in extensions_custom.conf file.

So essentially you would have to create a custom destination like this:
custom-get-did-from-sip,s,1

Then in your inbound or ivr, set the custom destination as the destination.

Yes!pls, can you break it down more on sip.conf of script.
Thanks