I do it by prefixing the number with some extra digits that contain the information, then strip off those extra digits at the receiving server. It means you are quite restricted in what can be sent, but is useful for transmitting a small amount of "data". For example:
Asterisk 1
exten => s,1,Set(MYVARIABLE=5) ; must be a single digit piece of data
exten => s,n,Dial(IAX2/Asterisk2/${MYVARIABLE},30,r)
Asterisk 2
exten => _X,1,Set(MYvariable2=${EXTEN:0:1})
exten => _X,n,Goto(${EXTEN:1},1)
exten => ,1,GotoIf(${MYVariable2}=5?finish)
exten => ,n,Dial(....)