Make SIP call file

I want to make a call file to make a phone between server 2 to server 1, which both servers I created myself.
I execute the call file on server 2.

Previously, I’ve managed to create a call file for iax, with
Channel: IAX2 / : @ <ip server 1> / @ <context on server 1>

However, when i change to sip to be
Channel: SIP / : @ <ip server 1> / @ <context on server 1>

On server 1 CLI, I got an error
"… rejected since extension not found in context ‘default’ …"

What should I change on the call file?

SIP has no concept of a context. The context is determined by the context parameter in sip.conf entry on the machine acting as UAS (server 2?) that matches the request from the UAC (server 1?).

1 Like

Oh okay, can you explain gradually what I need to do to call from UAS to UAC using a call file, and what I should write in the call file.
I am confused on call file configuration in order to connect directly to UAC.
Do I have to trunk these two servers first?

You can only call from a UAC to a UAS.

Call a sutiable extension number on the UAS. On the UAS, define a context. Put that context in the type=peer entry for server 1. In that context, parse that extension number into something used to select the real context, and into the real extension number.

Owh, sorry I misunderstand about uac and uas.
Can you provide a sample script in the context section? Or is there a source I can read to make it easy for me to understand.
I’m working on a project, doing a stress test on an asterisk server by generate 100 calls.
IAX is done, but now i stuck in SIP