I am using Asterisk ARI to originate a call and explicitly set a custom context (e.g., “test2”), but when the call reaches the StasisStart event, it appears in the default context instead. Why is the context being overridden or ignored?
- Log Before Originate Call (Expected Context: “test2”)
-
Originate Code Snippet
Channel channel = ari.channels().originate(endpoint)
.setContext(context)
.setApp(asteriskApp)
.setCallerId(fromWithout0)
.setAppArgs(args)
.setExtension(fromWithout0)
.execute(); -
onStasisStart Log (Unexpected: Context Defaults to “default”)
Verified the context value before originating the call – It is set to test2.
Checked extensions.conf for the context "test2"
– It exists in the dialplan.
Tried setting setContext() before setApp()
, but the issue persists.
What could be causing Asterisk to override or ignore the context set during originate()? Could it be an issue with ARI, dialplan configuration, or something else? Any guidance would be appreciated!