Normally, the SIP device ID and the extension number would be the same. Furthermore, the IP phone may even reject the INVITE from Asterisk if the username and extension number don't match. However, because the entities are independent within Asterisk it means you can do tricks like this:
SIP.CONF:
[2300desk]
type=friend
username=2300desk
secret=pass1
etc
[2300soft]
type=friend
username=2300soft
secret=pass2
etc
EXTENSION.CONF:
[mycontext]
exten => _2XXX,1,Dial(SIP/${EXTEN}desk&SIP/${EXTEN}soft|30)