PJSUA(+patch): Specify custom "From" user when making calls

AW
Andreas Wehrmann
Fri, Feb 21, 2020 10:51 AM

Hey there,

I needed the ability to specify the userpart of the "From" header when
making calls.
Since PJSUA automatically uses the associated account ID for that, it
wasn't possible.

I added a new field to pjsua_call_setting which allows the user to set a
custom From user.
When pjsua_call_make_call() is called, only the userpart from the
account ID will be changed and used for the dialog.

This is especially useful when you need to make calls on behalf of
someone else and want to carry their number/identity along
which is almost always the case when writing session border controllers
or some kind of B2B gateways.

I'm providing the patch here in case somebody else needs something like
this.

@Teluu:
Is there a chance that this feature gets into upstream?

Are there others reading here who might find this feature useful?

Best Regards,
Andreas Wehrmann

Hey there, I needed the ability to specify the userpart of the "From" header when making calls. Since PJSUA automatically uses the associated account ID for that, it wasn't possible. I added a new field to pjsua_call_setting which allows the user to set a custom From user. When pjsua_call_make_call() is called, only the userpart from the account ID will be changed and used for the dialog. This is especially useful when you need to make calls on behalf of someone else and want to carry their number/identity along which is almost always the case when writing session border controllers or some kind of B2B gateways. I'm providing the patch here in case somebody else needs something like this. @Teluu: Is there a chance that this feature gets into upstream? Are there others reading here who might find this feature useful? Best Regards, Andreas Wehrmann
M
Ming
Mon, Feb 24, 2020 3:40 AM

Hi Andreas,

Thanks for the patch. Since we have moved to Github, you can submit a
pull request from there. It will make it easier for us to review.

Regards,
Ming

On Fri, Feb 21, 2020 at 6:52 PM Andreas Wehrmann a.wehrmann@yandex.com wrote:

Hey there,

I needed the ability to specify the userpart of the "From" header when
making calls.
Since PJSUA automatically uses the associated account ID for that, it
wasn't possible.

I added a new field to pjsua_call_setting which allows the user to set a
custom From user.
When pjsua_call_make_call() is called, only the userpart from the
account ID will be changed and used for the dialog.

This is especially useful when you need to make calls on behalf of
someone else and want to carry their number/identity along
which is almost always the case when writing session border controllers
or some kind of B2B gateways.

I'm providing the patch here in case somebody else needs something like
this.

@Teluu:
Is there a chance that this feature gets into upstream?

Are there others reading here who might find this feature useful?

Best Regards,
Andreas Wehrmann


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi Andreas, Thanks for the patch. Since we have moved to Github, you can submit a pull request from there. It will make it easier for us to review. Regards, Ming On Fri, Feb 21, 2020 at 6:52 PM Andreas Wehrmann <a.wehrmann@yandex.com> wrote: > > Hey there, > > I needed the ability to specify the userpart of the "From" header when > making calls. > Since PJSUA automatically uses the associated account ID for that, it > wasn't possible. > > I added a new field to pjsua_call_setting which allows the user to set a > custom From user. > When pjsua_call_make_call() is called, only the userpart from the > account ID will be changed and used for the dialog. > > This is especially useful when you need to make calls on behalf of > someone else and want to carry their number/identity along > which is almost always the case when writing session border controllers > or some kind of B2B gateways. > > I'm providing the patch here in case somebody else needs something like > this. > > @Teluu: > Is there a chance that this feature gets into upstream? > > Are there others reading here who might find this feature useful? > > > Best Regards, > Andreas Wehrmann > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org