<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 15, 2021 at 2:49 AM Jean Aunis <<a href="mailto:jean.aunis@prescom.fr">jean.aunis@prescom.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Le 09/06/2021 à 16:18, George Joseph a écrit :<br>
> Hi Guys,<br>
><br>
> The change for allowing a dialstring-like destination in MessageSend <br>
> (pjsip only) is now committed in the 16, 18 and master branches. You <br>
> can now use MessageSend(pjsip:PJSIP/<number>@<provider_endpoint>) and <br>
> the request URI will be composed of the endpoint's contact uri with <br>
> the number inserted as the user portion of the uri. Please give it a test.<br>
><br>
> For Asterisk 19 (not an LTS release) what would you guys think of <br>
> changing the MessageSend application to accept discrete parameters for <br>
> destination uri, endpoint, user, etc.? This would remove about 400 <br>
> lines of fuzzy parsing code and give you the most flexibility in <br>
> constructing a destination.<br>
<br>
Hi George,<br>
<br>
I've just tested this with the latest version on branch 16.<br>
<br>
I have a SIP phone "linphone" performing an inbound registration, and I <br>
try to send a message to it with the following dialplan:<br>
<br>
exten = 800,1,Set(MESSAGE(body)=test)<br>
same = n,MessageSend(pjsip:PJSIP/3200@linphone,8000)<br>
<br>
The test fails. The SIP MESSAGE is not sent and the following errors are <br>
displayed:<br>
<br>
*CLI> channel originate Local/800@default application Hangup<br>
*CLI> -- Executing [800@default:1] <br>
Set("Local/800@default-00000000;2", "MESSAGE(body)=test") in new stack<br>
-- Called 800@default<br>
-- Executing [800@default:2] <br>
MessageSend("Local/800@default-00000000;2", <br>
"pjsip:PJSIP/3200@linphone,8000") in new stack<br>
[2021-06-15 10:42:49.885] WARNING[5163]: res_pjsip_messaging.c:247 <br>
insert_user_in_contact_uri: Dest: 'PJSIP/3200@linphone' MSG SEND FAIL: <br>
There's already a username in endpoint linphone's contact URI <br>
'<a href="http://sip:linphone@127.0.0.1:5063" target="_blank">sip:linphone@127.0.0.1:5063</a>;line=068b0910396d2ed'.<br>
[2021-06-15 10:42:49.885] ERROR[5163]: res_pjsip_messaging.c:1240</blockquote><div><br></div><div><br></div><div>Yeah that's the expected behavior although I guess I can change it. I figured that if there was a user already specified in the contact uri that overwriting it with something else was probably not a good idea. Now that I think of it though, I was thinking more from sending messages upstream to a provider not downstream to a client.</div><div><br></div><div>So what should the behavior be? To construct the Request URI replace any user in the contact URI with the user or number specified in the MessageSend call?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br>
msg_send: PJSIP MESSAGE - Could not find endpoint 'PJSIP/3200@linphone' <br>
and no default outbound endpoint configured<br>
-- Auto fallthrough, channel 'Local/800@default-00000000;2' status <br>
is 'UNKNOWN'<br>
<br>
I can provide logs if you need.<br>
<br>
Regards,<br>
<br>
Jean<br>
<br>
<br>
<br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div></div>