Distinction between context and extension

Channels are defined in sip.conf? And contexts in extensions.conf? That, at least, is my understanding:

asteriskdocs.org/en/3rd_Edit … 3_0601.png

Delving into the dialplan, p 176 of the Asterisk guide has:

exten => 1NXXNXXXXXXX,1,Dial(SIP/${EXTEN}@myprovider)

where myprovider, being BabyTel in this case, is defined as the context:

[babytel_out] type=peer username=1234567890 host=nat5.babytel.net outboundproxy=nat5.babytel.ca:5065 secret=gfdgf5435gff canreinvite=no insecure=invite

I’m a little bit confused because when I look at the peer for babytel_out:

[code]vici*CLI> sip show peer babytel_out

  • Name : babytel_out
    Secret :
    MD5Secret :
    Remote Secret:
    Context : trunkinbound[/code]

I thought that babytel_out was the context?

Both contexts and extensions are defined in extensions.conf.