I have asterisk 13.13cert2, pjsip, a simple dialplan:
extensions = {
["from-local"] = {
["_."] = from_local
},
["from-transfer"] = {
["_.*"] = transfer
}
}
function from_local(context,extension)
app.Set("TRANSFER_CONTEXT=from-transfer")
app.Dial("PJSIP/" .. extension .. ",,tT")
end
function transfer(context, extension)
app.Set('CALLERID(name)=Transfer')
app.Set('CALLERID(num)=1111')
app.Dial("PJSIP/" .. extension .. ",,tT")
end
And several endpoints:
[9716]
type=endpoint
transport=udp-transport
aors=9716
auth=9716
context=from-local
disallow=all
allow=alaw
direct_media=yes
dtmf_mode=auto
rewrite_contact=yes
callerid=9716 <9716>
[9717]
type=endpoint
transport=udp-transport
aors=9717
auth=9717
context=from-local
disallow=all
allow=alaw,g729,ulaw
direct_media=yes
dtmf_mode=auto
rewrite_contact=yes
callerid=9717 <9717>
[9718]
type=endpoint
transport=udp-transport
aors=9718
auth=9718
context=from-local
disallow=all
allow=alaw
direct_media=yes
dtmf_mode=auto
rewrite_contact=yes
callerid=9718 <9718>
I’m calling from 9716 to 9717 and transferring to 9718. In the case of blind transfer, invite (header From:) contains the information that i set using the CALLERID function. But in the case of attended transfer, invite (header From:) contains the information of the person who made the transfer, and not what i set using the CALLERID function.
How to change callerid when use attended transfer?