[asterisk-dev] PJSIP messaging : specifying the user portion of the request-URI

George Joseph gjoseph at sangoma.com
Tue Jun 15 08:28:31 CDT 2021


On Tue, Jun 15, 2021 at 2:49 AM Jean Aunis <jean.aunis at prescom.fr> wrote:

> Le 09/06/2021 à 16:18, George Joseph a écrit :
> > Hi Guys,
> >
> > The change for allowing a dialstring-like destination in MessageSend
> > (pjsip only) is now committed in the 16, 18 and master branches.  You
> > can now use MessageSend(pjsip:PJSIP/<number>@<provider_endpoint>) and
> > the request URI will be composed of the endpoint's contact uri with
> > the number inserted as the user portion of the uri. Please give it a
> test.
> >
> > For Asterisk 19 (not an LTS release) what would you guys think of
> > changing the MessageSend application to accept discrete parameters for
> > destination uri, endpoint, user, etc.?  This would remove about 400
> > lines of fuzzy parsing code and give you the most flexibility in
> > constructing a destination.
>
> Hi George,
>
> I've just tested this with the latest version on branch 16.
>
> I have a SIP phone "linphone" performing an inbound registration, and I
> try to send a message to it with the following dialplan:
>
> exten = 800,1,Set(MESSAGE(body)=test)
> same  = n,MessageSend(pjsip:PJSIP/3200 at linphone,8000)
>
> The test fails. The SIP MESSAGE is not sent and the following errors are
> displayed:
>
> *CLI> channel originate Local/800 at default application Hangup
> *CLI>     -- Executing [800 at default:1]
> Set("Local/800 at default-00000000;2", "MESSAGE(body)=test") in new stack
>      -- Called 800 at default
>      -- Executing [800 at default:2]
> MessageSend("Local/800 at default-00000000;2",
> "pjsip:PJSIP/3200 at linphone,8000") in new stack
> [2021-06-15 10:42:49.885] WARNING[5163]: res_pjsip_messaging.c:247
> insert_user_in_contact_uri: Dest: 'PJSIP/3200 at linphone' MSG SEND FAIL:
> There's already a username in endpoint linphone's contact URI
> 'sip:linphone at 127.0.0.1:5063;line=068b0910396d2ed'.
> [2021-06-15 10:42:49.885] ERROR[5163]: res_pjsip_messaging.c:1240



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.

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?



>
> msg_send: PJSIP MESSAGE - Could not find endpoint 'PJSIP/3200 at linphone'
> and no default outbound endpoint configured
>      -- Auto fallthrough, channel 'Local/800 at default-00000000;2' status
> is 'UNKNOWN'
>
> I can provide logs if you need.
>
> Regards,
>
> Jean
>
>
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20210615/31fc2c7d/attachment.html>


More information about the asterisk-dev mailing list