Original callerID not sent over trunk for Instant Message

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

You might try removing “fromuser” line from sip_trunks.conf

And posting SIP logs.

Hi penguinpbx,

Thanks for your help.

If I remove the “fromuser” option the trunk doesn’t work. The remote pbx need this “shared” user to authenticate the dialog.

Clarification:
The sip users are in their own databases and they are not shared to the remote pbx. Example: Alice belongs to domain-rd2.com and Bob belongs to domain-rd3.com

If I turn off sendrpid and trustrpid options, I recieve a call from trunkrd3 or trunkrd2 as for messages, so why these options do not work with messages?

In sip traces for messages look at:

<--- Transmitting (no NAT) to @ip_ssp:5060 --->
SIP/2.0 202 Accepted
Via: SIP/2.0/UDP @ip_ssp:5060;branch=z9hG4bK54c62635b1b802926efa36cd9a150bab;received=@ip_ssp
Via: SIP/2.0/TLS @ip_wan:5061;branch=z9hG4bKf52b29625cccd79cabea4896dc7f70e4
Via: SIP/2.0/UDP @ip_pbx:5060;branch=z9hG4bK5b9af43f
From: "kandor" <sip:trunkrd3@domain-rd2.com>;tag=as0f62971f
To: <sip:Alice@trunk.domain-rd2.com>;tag=as62f991e8
Call-ID: 1de142f053431c365ba5561e209e4568@domain-rd2.com
CSeq: 103 MESSAGE
Server: PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

The “From” field start with “kandor” (this is a project name) whereas the From field with a call start with “Bob Bob” or “Alice Alice” (first name last name), maybe a clue ?

I want share you sender (Bob) and receiver (Alice) sip traces but I can’t upload files because I’m a new user… Maybe I can send you the traces by another means ?

Many thanks,

Regards

Madgics

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.