Hi everybody,
I’ve configured a SIP trunk between two asterisk(13.14.0). With this trunk I want to call and send messages. The calls work perfectly i.e when I call user_b from user_a, I get a call that show user_a is calling, perfect but the messages display the trunk user defined in sip_trunks.conf.
A part of my sip.conf contains:
trustrpid=yes
sendrpid=yes
and
accept_outofcall_message=yes
outofcall_message_context=astsms_chan_sip
auth_message_requests=yes
A part of extensions.conf:
; Manage SIP message
[macro-chan_sip]
exten => s,1,NoOp(SMS Delivery, from: ${MESSAGE(from)}, to: ${MESSAGE(to)})
exten => s,n,Set(TS=${MESSAGE_DATA(X-IM-received)})
exten => s,n,Set(MESSAGE_DATA(X-IM-received)=${IF(${ISNULL(${TS})}?${EPOCH}:${TS})})
exten => s,n,Set(SRC=${CUT(MESSAGE(from),:,2)})
exten => s,n,Set(SRC2=${CUT(MESSAGE(to),:,2)})
exten => s,n,Set(FROM=${CUT(SRC,@,1)})
exten => s,n,Set(TO=${CUT(SRC2,@,1)})
exten => s,n,Set(CDR(userfield)=${FROM})
exten => s,n,Set(DOMAIN=${SHELL(/usr/local/bin/sipdomain_im "${SRC2}" )})
exten => s,n,MessageSend(sip:${TO}@${DOMAIN}, ${MESSAGE(from)})
exten => s,n,Hangup()
[astsms_chan_sip]
exten => _[a-z].,1,Macro(chan_sip)
exten => _[A-Z].,1,Macro(chan_sip)
my sip_trunks.conf:
[trunk.domain-rd2.com]
type=peer
username=trunkrd3
fromuser=trunkrd3
fromdomain=domain-rd2.com
secret=password
host=domain-rd2.com
outboundproxy=ip
So I receive a message from trunkrd3 instead receiving message from user_a. Maybe I missed something ? Any help will be greatly appreciated. I specify that I am new on the subject. Thanks in advance.
Regards