Setting Custom Registration Header

SM
Spencer MacDonald
Tue, Dec 11, 2012 10:42 AM

Hi,

Im trying to send a custom header in a SIP Registration, but I can't find a
way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error.
Looking in footprint.c this method appears to be commented out.

Should this be working or is there an alternative solution?

Regards

Spencer

Hi, Im trying to send a custom header in a SIP Registration, but I can't find a way to do so. It looks like you should be able to call pjsip_regc_get_module() to get the sip registration module, but this gives me a linker error. Looking in footprint.c this method appears to be commented out. Should this be working or is there an alternative solution? Regards Spencer
SK
Sandeep Karanth
Tue, Dec 11, 2012 10:51 AM

You can use the method
pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom
header.

Regards,
Sandeep

On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

Hi,

Im trying to send a custom header in a SIP Registration, but I can't find
a way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error.
Looking in footprint.c this method appears to be commented out.

Should this be working or is there an alternative solution?

Regards

Spencer


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

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

You can use the method pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom header. Regards, Sandeep On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald < spencer.macdonald.other@gmail.com> wrote: > Hi, > > Im trying to send a custom header in a SIP Registration, but I can't find > a way to do so. > > It looks like you should be able to call > > pjsip_regc_get_module() > > to get the sip registration module, but this gives me a linker error. > Looking in footprint.c this method appears to be commented out. > > Should this be working or is there an alternative solution? > > Regards > > Spencer > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
SM
Spencer MacDonald
Tue, Dec 11, 2012 10:56 AM

The issue is that PJSIP is handling the registration for me, I just set
the reg_timeout for an account.

Regards

Spencer

On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth sandeepk.kdp@gmail.comwrote:

You can use the method
pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom
header.

Regards,
Sandeep

On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

Hi,

Im trying to send a custom header in a SIP Registration, but I can't find
a way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error.
Looking in footprint.c this method appears to be commented out.

Should this be working or is there an alternative solution?

Regards

Spencer


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

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

The issue is that PJSIP is handling the registration for me, I just set the reg_timeout for an account. Regards Spencer On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth <sandeepk.kdp@gmail.com>wrote: > You can use the method > pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom > header. > > Regards, > Sandeep > > On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald < > spencer.macdonald.other@gmail.com> wrote: > >> Hi, >> >> Im trying to send a custom header in a SIP Registration, but I can't find >> a way to do so. >> >> It looks like you should be able to call >> >> pjsip_regc_get_module() >> >> to get the sip registration module, but this gives me a linker error. >> Looking in footprint.c this method appears to be commented out. >> >> Should this be working or is there an alternative solution? >> >> Regards >> >> Spencer >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
SK
Sandeep Karanth
Tue, Dec 11, 2012 11:08 AM

So are you using the pjsua app? How do you do the registration?If you could
mention that it would give a more clear view of your problem to me.

On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

The issue is that PJSIP is handling the registration for me, I just set
the reg_timeout for an account.

Regards

Spencer

On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth sandeepk.kdp@gmail.comwrote:

You can use the method
pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom
header.

Regards,
Sandeep

On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

Hi,

Im trying to send a custom header in a SIP Registration, but I can't
find a way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error.
Looking in footprint.c this method appears to be commented out.

Should this be working or is there an alternative solution?

Regards

Spencer


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

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

So are you using the pjsua app? How do you do the registration?If you could mention that it would give a more clear view of your problem to me. On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald < spencer.macdonald.other@gmail.com> wrote: > The issue is that PJSIP is handling the registration for me, I just set > the reg_timeout for an account. > > Regards > > Spencer > > > On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth <sandeepk.kdp@gmail.com>wrote: > >> You can use the method >> pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom >> header. >> >> Regards, >> Sandeep >> >> On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald < >> spencer.macdonald.other@gmail.com> wrote: >> >>> Hi, >>> >>> Im trying to send a custom header in a SIP Registration, but I can't >>> find a way to do so. >>> >>> It looks like you should be able to call >>> >>> pjsip_regc_get_module() >>> >>> to get the sip registration module, but this gives me a linker error. >>> Looking in footprint.c this method appears to be commented out. >>> >>> Should this be working or is there an alternative solution? >>> >>> Regards >>> >>> Spencer >>> >>> _______________________________________________ >>> Visit our blog: http://blog.pjsip.org >>> >>> pjsip mailing list >>> pjsip@lists.pjsip.org >>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>> >>> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
SM
Spencer MacDonald
Tue, Dec 11, 2012 11:17 AM

I just create an account and add it to pjsua like so:

pjsua_acc_config accountConfig;
pjsua_acc_config_default(&accountConfig);

//Other Config is here
accountConfig.reg_timeout = 600;

pjsua_acc_id accountIdentifier;
pj_status_t status = pjsua_acc_add(&accountConfig,
PJ_FALSE,&accountIdentifier);

Regards

Spencer

On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth sandeepk.kdp@gmail.comwrote:

So are you using the pjsua app? How do you do the registration?If you
could mention that it would give a more clear view of your problem to me.

On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

The issue is that PJSIP is handling the registration for me, I just set
the reg_timeout for an account.

Regards

Spencer

On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth <sandeepk.kdp@gmail.com

wrote:

You can use the method
pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom
header.

Regards,
Sandeep

On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

Hi,

Im trying to send a custom header in a SIP Registration, but I can't
find a way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error.
Looking in footprint.c this method appears to be commented out.

Should this be working or is there an alternative solution?

Regards

Spencer


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

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

I just create an account and add it to pjsua like so: pjsua_acc_config accountConfig; pjsua_acc_config_default(&accountConfig); //Other Config is here accountConfig.reg_timeout = 600; pjsua_acc_id accountIdentifier; pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier); Regards Spencer On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth <sandeepk.kdp@gmail.com>wrote: > So are you using the pjsua app? How do you do the registration?If you > could mention that it would give a more clear view of your problem to me. > > On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald < > spencer.macdonald.other@gmail.com> wrote: > >> The issue is that PJSIP is handling the registration for me, I just set >> the reg_timeout for an account. >> >> Regards >> >> Spencer >> >> >> On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth <sandeepk.kdp@gmail.com >> > wrote: >> >>> You can use the method >>> pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom >>> header. >>> >>> Regards, >>> Sandeep >>> >>> On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald < >>> spencer.macdonald.other@gmail.com> wrote: >>> >>>> Hi, >>>> >>>> Im trying to send a custom header in a SIP Registration, but I can't >>>> find a way to do so. >>>> >>>> It looks like you should be able to call >>>> >>>> pjsip_regc_get_module() >>>> >>>> to get the sip registration module, but this gives me a linker error. >>>> Looking in footprint.c this method appears to be commented out. >>>> >>>> Should this be working or is there an alternative solution? >>>> >>>> Regards >>>> >>>> Spencer >>>> >>>> _______________________________________________ >>>> Visit our blog: http://blog.pjsip.org >>>> >>>> pjsip mailing list >>>> pjsip@lists.pjsip.org >>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>> >>>> >>> >>> _______________________________________________ >>> Visit our blog: http://blog.pjsip.org >>> >>> pjsip mailing list >>> pjsip@lists.pjsip.org >>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>> >>> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
SK
Sandeep Karanth
Tue, Dec 11, 2012 11:45 AM

You could try something like this and hopefully should help you.
pjsip_hdr *hdr;
pj_str_t hname = pj_str("HEADER_NAME");
pj_str_t hvalue = pj_str("HEADER_VALUE");

hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue);
pj_list_push_back(&accountConfig.reg_hdr_list,hdr );
pj_status_t status = pjsua_acc_add(&accountConfig,
PJ_FALSE,&accountIdentifier);

On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

I just create an account and add it to pjsua like so:

pjsua_acc_config accountConfig;
pjsua_acc_config_default(&accountConfig);

//Other Config is here
accountConfig.reg_timeout = 600;

pjsua_acc_id accountIdentifier;
pj_status_t status = pjsua_acc_add(&accountConfig,
PJ_FALSE,&accountIdentifier);

Regards

Spencer

On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth sandeepk.kdp@gmail.comwrote:

So are you using the pjsua app? How do you do the registration?If you
could mention that it would give a more clear view of your problem to me.

On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

The issue is that PJSIP is handling the registration for me, I just set
the reg_timeout for an account.

Regards

Spencer

On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth <
sandeepk.kdp@gmail.com> wrote:

You can use the method
pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom
header.

Regards,
Sandeep

On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

Hi,

Im trying to send a custom header in a SIP Registration, but I can't
find a way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error.
Looking in footprint.c this method appears to be commented out.

Should this be working or is there an alternative solution?

Regards

Spencer


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

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

You could try something like this and hopefully should help you. pjsip_hdr *hdr; pj_str_t hname = pj_str("HEADER_NAME"); pj_str_t hvalue = pj_str("HEADER_VALUE"); hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue); pj_list_push_back(&accountConfig.reg_hdr_list,hdr ); pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier); On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald < spencer.macdonald.other@gmail.com> wrote: > I just create an account and add it to pjsua like so: > > pjsua_acc_config accountConfig; > pjsua_acc_config_default(&accountConfig); > > //Other Config is here > accountConfig.reg_timeout = 600; > > pjsua_acc_id accountIdentifier; > pj_status_t status = pjsua_acc_add(&accountConfig, > PJ_FALSE,&accountIdentifier); > > Regards > > Spencer > > On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth <sandeepk.kdp@gmail.com>wrote: > >> So are you using the pjsua app? How do you do the registration?If you >> could mention that it would give a more clear view of your problem to me. >> >> On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald < >> spencer.macdonald.other@gmail.com> wrote: >> >>> The issue is that PJSIP is handling the registration for me, I just set >>> the reg_timeout for an account. >>> >>> Regards >>> >>> Spencer >>> >>> >>> On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth < >>> sandeepk.kdp@gmail.com> wrote: >>> >>>> You can use the method >>>> pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom >>>> header. >>>> >>>> Regards, >>>> Sandeep >>>> >>>> On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald < >>>> spencer.macdonald.other@gmail.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> Im trying to send a custom header in a SIP Registration, but I can't >>>>> find a way to do so. >>>>> >>>>> It looks like you should be able to call >>>>> >>>>> pjsip_regc_get_module() >>>>> >>>>> to get the sip registration module, but this gives me a linker error. >>>>> Looking in footprint.c this method appears to be commented out. >>>>> >>>>> Should this be working or is there an alternative solution? >>>>> >>>>> Regards >>>>> >>>>> Spencer >>>>> >>>>> _______________________________________________ >>>>> Visit our blog: http://blog.pjsip.org >>>>> >>>>> pjsip mailing list >>>>> pjsip@lists.pjsip.org >>>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Visit our blog: http://blog.pjsip.org >>>> >>>> pjsip mailing list >>>> pjsip@lists.pjsip.org >>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>> >>>> >>> >>> _______________________________________________ >>> Visit our blog: http://blog.pjsip.org >>> >>> pjsip mailing list >>> pjsip@lists.pjsip.org >>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>> >>> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
SM
Spencer MacDonald
Tue, Dec 11, 2012 2:49 PM

Hi Sandeep,

That works great, thanks a lot for your help!!!

Regards

Spencer

On Tue, Dec 11, 2012 at 11:45 AM, Sandeep Karanth sandeepk.kdp@gmail.comwrote:

You could try something like this and hopefully should help you.
pjsip_hdr *hdr;
pj_str_t hname = pj_str("HEADER_NAME");
pj_str_t hvalue = pj_str("HEADER_VALUE");

hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue);
pj_list_push_back(&accountConfig.reg_hdr_list,hdr );
pj_status_t status = pjsua_acc_add(&accountConfig,
PJ_FALSE,&accountIdentifier);

On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

I just create an account and add it to pjsua like so:

pjsua_acc_config accountConfig;
pjsua_acc_config_default(&accountConfig);

//Other Config is here
accountConfig.reg_timeout = 600;

pjsua_acc_id accountIdentifier;
pj_status_t status = pjsua_acc_add(&accountConfig,
PJ_FALSE,&accountIdentifier);

Regards

Spencer

On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth <sandeepk.kdp@gmail.com

wrote:

So are you using the pjsua app? How do you do the registration?If you
could mention that it would give a more clear view of your problem to me.

On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

The issue is that PJSIP is handling the registration for me, I just set
the reg_timeout for an account.

Regards

Spencer

On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth <
sandeepk.kdp@gmail.com> wrote:

You can use the method
pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom
header.

Regards,
Sandeep

On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

Hi,

Im trying to send a custom header in a SIP Registration, but I can't
find a way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error.
Looking in footprint.c this method appears to be commented out.

Should this be working or is there an alternative solution?

Regards

Spencer


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 Sandeep, That works great, thanks a lot for your help!!! Regards Spencer On Tue, Dec 11, 2012 at 11:45 AM, Sandeep Karanth <sandeepk.kdp@gmail.com>wrote: > You could try something like this and hopefully should help you. > pjsip_hdr *hdr; > pj_str_t hname = pj_str("HEADER_NAME"); > pj_str_t hvalue = pj_str("HEADER_VALUE"); > > hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue); > pj_list_push_back(&accountConfig.reg_hdr_list,hdr ); > pj_status_t status = pjsua_acc_add(&accountConfig, > PJ_FALSE,&accountIdentifier); > > > > On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald < > spencer.macdonald.other@gmail.com> wrote: > >> I just create an account and add it to pjsua like so: >> >> pjsua_acc_config accountConfig; >> pjsua_acc_config_default(&accountConfig); >> >> //Other Config is here >> accountConfig.reg_timeout = 600; >> >> pjsua_acc_id accountIdentifier; >> pj_status_t status = pjsua_acc_add(&accountConfig, >> PJ_FALSE,&accountIdentifier); >> >> Regards >> >> Spencer >> >> On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth <sandeepk.kdp@gmail.com >> > wrote: >> >>> So are you using the pjsua app? How do you do the registration?If you >>> could mention that it would give a more clear view of your problem to me. >>> >>> On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald < >>> spencer.macdonald.other@gmail.com> wrote: >>> >>>> The issue is that PJSIP is handling the registration for me, I just set >>>> the reg_timeout for an account. >>>> >>>> Regards >>>> >>>> Spencer >>>> >>>> >>>> On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth < >>>> sandeepk.kdp@gmail.com> wrote: >>>> >>>>> You can use the method >>>>> pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom >>>>> header. >>>>> >>>>> Regards, >>>>> Sandeep >>>>> >>>>> On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald < >>>>> spencer.macdonald.other@gmail.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> Im trying to send a custom header in a SIP Registration, but I can't >>>>>> find a way to do so. >>>>>> >>>>>> It looks like you should be able to call >>>>>> >>>>>> pjsip_regc_get_module() >>>>>> >>>>>> to get the sip registration module, but this gives me a linker error. >>>>>> Looking in footprint.c this method appears to be commented out. >>>>>> >>>>>> Should this be working or is there an alternative solution? >>>>>> >>>>>> Regards >>>>>> >>>>>> Spencer >>>>>> >>>>>> _______________________________________________ >>>>>> Visit our blog: http://blog.pjsip.org >>>>>> >>>>>> pjsip mailing list >>>>>> pjsip@lists.pjsip.org >>>>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Visit our blog: http://blog.pjsip.org >>>>> >>>>> pjsip mailing list >>>>> pjsip@lists.pjsip.org >>>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Visit our blog: http://blog.pjsip.org >>>> >>>> pjsip mailing list >>>> pjsip@lists.pjsip.org >>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>> >>>> >>> >>> _______________________________________________ >>> Visit our blog: http://blog.pjsip.org >>> >>> pjsip mailing list >>> pjsip@lists.pjsip.org >>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>> >>> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
MO
moath othman
Wed, Dec 12, 2012 10:20 AM

Hi spencer and sandeep

am also trying to add custom headers

i am using this method

     pj_str_t hname = pj_str(headerx);
     pj_str_t hvalue = pj_str(header);
    pjsua_msg_data_init(&msg_data);
    pjsip_generic_string_hdr_init2(&my_hdr, &hname, &hvalue);
    pj_list_push_back(&msg_data.hdr_list, &my_hdr);
   
    status = pjsua_call_make_call(acc_id, &pj_uri, 0, NULL, &msg_data, call_id);

it works but not always !! Its strange !!
the server is not always catch the custom header 20% of trials not work !!

is there a better way to do add the custom header ?!!

 

Eng. Moath Othman

+962-796988538


From: Spencer MacDonald spencer.macdonald.other@gmail.com
To: pjsip list pjsip@lists.pjsip.org
Sent: Tuesday, December 11, 2012 4:49 PM
Subject: Re: [pjsip] Setting Custom Registration Header

Hi Sandeep,

That works great, thanks a lot for your help!!!

Regards

Spencer

On Tue, Dec 11, 2012 at 11:45 AM, Sandeep Karanth sandeepk.kdp@gmail.com wrote:

You could try something like this and hopefully should help you.

pjsip_hdr *hdr;
pj_str_t hname = pj_str("HEADER_NAME");
pj_str_t hvalue = pj_str("HEADER_VALUE");

hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue);
 pj_list_push_back(&accountConfig.reg_hdr_list,hdr );
pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier);

On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald spencer.macdonald.other@gmail.com wrote:

I just create an account and add it to pjsua like so:

pjsua_acc_config accountConfig;
pjsua_acc_config_default(&accountConfig);
  
//Other Config is here
accountConfig.reg_timeout = 600;
 
pjsua_acc_id accountIdentifier;
pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier);

Regards

Spencer

On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth sandeepk.kdp@gmail.com wrote:

So are you using the pjsua app? How do you do the registration?If you could mention that it would give a more clear view of your problem to me.

On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald spencer.macdonald.other@gmail.com wrote:

The issue is that PJSIP is handling the registration for me, I just set the reg_timeout for an account.

Regards

Spencer

On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth sandeepk.kdp@gmail.com wrote:

You can use the method 

pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom header. 

Regards,
Sandeep

On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald spencer.macdonald.other@gmail.com wrote:

Hi,

Im trying to send a custom header in a SIP Registration, but I can't find a way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error. Looking in footprint.c this method appears to be commented out. 

Should this be working or is there an alternative solution?

Regards

Spencer


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 spencer and sandeep am also trying to add custom headers i am using this method      pj_str_t hname = pj_str(headerx);      pj_str_t hvalue = pj_str(header);     pjsua_msg_data_init(&msg_data);     pjsip_generic_string_hdr_init2(&my_hdr, &hname, &hvalue);     pj_list_push_back(&msg_data.hdr_list, &my_hdr);         status = pjsua_call_make_call(acc_id, &pj_uri, 0, NULL, &msg_data, call_id); it works but not always !! Its strange !! the server is not always catch the custom header 20% of trials not work !! is there a better way to do add the custom header ?!!   ----------------------- Eng. Moath Othman +962-796988538 ------------------------ ________________________________ From: Spencer MacDonald <spencer.macdonald.other@gmail.com> To: pjsip list <pjsip@lists.pjsip.org> Sent: Tuesday, December 11, 2012 4:49 PM Subject: Re: [pjsip] Setting Custom Registration Header Hi Sandeep, That works great, thanks a lot for your help!!! Regards Spencer On Tue, Dec 11, 2012 at 11:45 AM, Sandeep Karanth <sandeepk.kdp@gmail.com> wrote: You could try something like this and hopefully should help you. >pjsip_hdr *hdr; >pj_str_t hname = pj_str("HEADER_NAME"); >pj_str_t hvalue = pj_str("HEADER_VALUE"); > > >hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue); > pj_list_push_back(&accountConfig.reg_hdr_list,hdr ); >pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier); > > > > > >On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald <spencer.macdonald.other@gmail.com> wrote: > >I just create an account and add it to pjsua like so: >> >> >>pjsua_acc_config accountConfig; >>pjsua_acc_config_default(&accountConfig); >>   >>//Other Config is here >>accountConfig.reg_timeout = 600; >>  >>pjsua_acc_id accountIdentifier; >>pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier); >> >> >>Regards >> >>Spencer >> >> >>On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth <sandeepk.kdp@gmail.com> wrote: >> >>So are you using the pjsua app? How do you do the registration?If you could mention that it would give a more clear view of your problem to me. >>> >>> >>> >>>On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald <spencer.macdonald.other@gmail.com> wrote: >>> >>>The issue is that PJSIP is handling the registration for me, I just set the reg_timeout for an account. >>>> >>>> >>>>Regards >>>> >>>>Spencer >>>> >>>> >>>> >>>>On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth <sandeepk.kdp@gmail.com> wrote: >>>> >>>>You can use the method  >>>>>pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom header.  >>>>> >>>>> >>>>>Regards, >>>>>Sandeep >>>>> >>>>> >>>>> >>>>>On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald <spencer.macdonald.other@gmail.com> wrote: >>>>> >>>>>Hi, >>>>>> >>>>>> >>>>>>Im trying to send a custom header in a SIP Registration, but I can't find a way to do so. >>>>>> >>>>>> >>>>>>It looks like you should be able to call >>>>>> >>>>>> >>>>>>pjsip_regc_get_module() >>>>>> >>>>>> >>>>>>to get the sip registration module, but this gives me a linker error. Looking in footprint.c this method appears to be commented out.  >>>>>> >>>>>> >>>>>>Should this be working or is there an alternative solution? >>>>>> >>>>>> >>>>>>Regards >>>>>> >>>>>>Spencer >>>>>>_______________________________________________ >>>>>>Visit our blog: http://blog.pjsip.org >>>>>> >>>>>>pjsip mailing list >>>>>>pjsip@lists.pjsip.org >>>>>>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>>>> >>>>>> >>>>> >>>>>_______________________________________________ >>>>>Visit our blog: http://blog.pjsip.org >>>>> >>>>>pjsip mailing list >>>>>pjsip@lists.pjsip.org >>>>>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>>> >>>>> >>>> >>>>_______________________________________________ >>>>Visit our blog: http://blog.pjsip.org >>>> >>>>pjsip mailing list >>>>pjsip@lists.pjsip.org >>>>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>> >>>> >>> >>>_______________________________________________ >>>Visit our blog: http://blog.pjsip.org >>> >>>pjsip mailing list >>>pjsip@lists.pjsip.org >>>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>> >>> >> >>_______________________________________________ >>Visit our blog: http://blog.pjsip.org >> >>pjsip mailing list >>pjsip@lists.pjsip.org >>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > >_______________________________________________ >Visit our blog: http://blog.pjsip.org > >pjsip mailing list >pjsip@lists.pjsip.org >http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
SK
Sandeep Karanth
Wed, Dec 12, 2012 10:50 AM

Looks alright to me! Not sure why are you facing issues

On Wed, Dec 12, 2012 at 3:50 PM, moath othman m_o_3_1989@yahoo.com wrote:

Hi spencer and sandeep

am also trying to add custom headers

i am using this method

  pj_str_t hname = pj_str(headerx);
  pj_str_t hvalue = pj_str(header);
 pjsua_msg_data_init(&msg_data);
 pjsip_generic_string_hdr_init2(&my_hdr, &hname, &hvalue);
 pj_list_push_back(&msg_data.hdr_list, &my_hdr);

 status = pjsua_call_make_call(acc_id, &pj_uri, 0, NULL, &msg_data,

call_id);

it works but not always !! Its strange !!
the server is not always catch the custom header 20% of trials not work !!

is there a better way to do add the custom header ?!!


Eng. Moath Othman

+962-796988538


From: Spencer MacDonald spencer.macdonald.other@gmail.com
To: pjsip list pjsip@lists.pjsip.org
Sent: Tuesday, December 11, 2012 4:49 PM
Subject: Re: [pjsip] Setting Custom Registration Header

Hi Sandeep,

That works great, thanks a lot for your help!!!

Regards

Spencer

On Tue, Dec 11, 2012 at 11:45 AM, Sandeep Karanth sandeepk.kdp@gmail.comwrote:

You could try something like this and hopefully should help you.
pjsip_hdr *hdr;
pj_str_t hname = pj_str("HEADER_NAME");
pj_str_t hvalue = pj_str("HEADER_VALUE");

hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue);
pj_list_push_back(&accountConfig.reg_hdr_list,hdr );
pj_status_t status = pjsua_acc_add(&accountConfig,
PJ_FALSE,&accountIdentifier);

On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

I just create an account and add it to pjsua like so:

pjsua_acc_config accountConfig;
pjsua_acc_config_default(&accountConfig);

//Other Config is here
accountConfig.reg_timeout = 600;

pjsua_acc_id accountIdentifier;
pj_status_t status = pjsua_acc_add(&accountConfig,
PJ_FALSE,&accountIdentifier);

Regards

Spencer

On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth sandeepk.kdp@gmail.comwrote:

So are you using the pjsua app? How do you do the registration?If you
could mention that it would give a more clear view of your problem to me.

On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

The issue is that PJSIP is handling the registration for me, I just set
the reg_timeout for an account.

Regards

Spencer

On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth sandeepk.kdp@gmail.comwrote:

You can use the method
pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom
header.

Regards,
Sandeep

On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald <
spencer.macdonald.other@gmail.com> wrote:

Hi,

Im trying to send a custom header in a SIP Registration, but I can't find
a way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error.
Looking in footprint.c this method appears to be commented out.

Should this be working or is there an alternative solution?

Regards

Spencer


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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

Looks alright to me! Not sure why are you facing issues On Wed, Dec 12, 2012 at 3:50 PM, moath othman <m_o_3_1989@yahoo.com> wrote: > Hi spencer and sandeep > > am also trying to add custom headers > > i am using this method > > pj_str_t hname = pj_str(headerx); > pj_str_t hvalue = pj_str(header); > pjsua_msg_data_init(&msg_data); > pjsip_generic_string_hdr_init2(&my_hdr, &hname, &hvalue); > pj_list_push_back(&msg_data.hdr_list, &my_hdr); > > status = pjsua_call_make_call(acc_id, &pj_uri, 0, NULL, &msg_data, > call_id); > > it works but not always !! Its strange !! > the server is not always catch the custom header 20% of trials not work !! > > is there a better way to do add the custom header ?!! > > > > ----------------------- > Eng. Moath Othman > > +962-796988538 > ------------------------ > ------------------------------ > *From:* Spencer MacDonald <spencer.macdonald.other@gmail.com> > *To:* pjsip list <pjsip@lists.pjsip.org> > *Sent:* Tuesday, December 11, 2012 4:49 PM > *Subject:* Re: [pjsip] Setting Custom Registration Header > > Hi Sandeep, > > That works great, thanks a lot for your help!!! > > Regards > > Spencer > > On Tue, Dec 11, 2012 at 11:45 AM, Sandeep Karanth <sandeepk.kdp@gmail.com>wrote: > > You could try something like this and hopefully should help you. > pjsip_hdr *hdr; > pj_str_t hname = pj_str("HEADER_NAME"); > pj_str_t hvalue = pj_str("HEADER_VALUE"); > > hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue); > pj_list_push_back(&accountConfig.reg_hdr_list,hdr ); > pj_status_t status = pjsua_acc_add(&accountConfig, > PJ_FALSE,&accountIdentifier); > > > > On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald < > spencer.macdonald.other@gmail.com> wrote: > > I just create an account and add it to pjsua like so: > > pjsua_acc_config accountConfig; > pjsua_acc_config_default(&accountConfig); > > //Other Config is here > accountConfig.reg_timeout = 600; > > pjsua_acc_id accountIdentifier; > pj_status_t status = pjsua_acc_add(&accountConfig, > PJ_FALSE,&accountIdentifier); > > Regards > > Spencer > > On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth <sandeepk.kdp@gmail.com>wrote: > > So are you using the pjsua app? How do you do the registration?If you > could mention that it would give a more clear view of your problem to me. > > On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald < > spencer.macdonald.other@gmail.com> wrote: > > The issue is that PJSIP is handling the registration for me, I just set > the reg_timeout for an account. > > Regards > > Spencer > > > On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth <sandeepk.kdp@gmail.com>wrote: > > You can use the method > pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom > header. > > Regards, > Sandeep > > On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald < > spencer.macdonald.other@gmail.com> wrote: > > Hi, > > Im trying to send a custom header in a SIP Registration, but I can't find > a way to do so. > > It looks like you should be able to call > > pjsip_regc_get_module() > > to get the sip registration module, but this gives me a linker error. > Looking in footprint.c this method appears to be commented out. > > Should this be working or is there an alternative solution? > > Regards > > Spencer > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
MO
moath othman
Wed, Dec 12, 2012 1:29 PM

do you have any other methods to do that ,,,
if i could change the contact name in header , it will be solved for me ,,
can you guide me to the way to change the contact Field !!

it looks like that 

Contact: "myName" sip:6260@xxx.xxx.xxx.xx:5060;ob

I could set the Contact name (my Name)

in the registration phase

i want to be able to change every time I make a call ...

 
thank you alot


Eng. Moath Othman
Computer Engineer
DDAD For Information Technology
Amman-Jordan
+962-788279184


From: Sandeep Karanth sandeepk.kdp@gmail.com
To: moath othman m_o_3_1989@yahoo.com; pjsip list pjsip@lists.pjsip.org
Sent: Wednesday, December 12, 2012 12:50 PM
Subject: Re: [pjsip] Setting Custom Registration Header

Looks alright to me! Not sure why are you facing issues 

On Wed, Dec 12, 2012 at 3:50 PM, moath othman m_o_3_1989@yahoo.com wrote:

Hi spencer and sandeep

am also trying to add custom headers

i am using this method

     pj_str_t hname = pj_str(headerx);
     pj_str_t hvalue = pj_str(header);
    pjsua_msg_data_init(&msg_data);
    pjsip_generic_string_hdr_init2(&my_hdr, &hname, &hvalue);
    pj_list_push_back(&msg_data.hdr_list, &my_hdr);
   
    status = pjsua_call_make_call(acc_id, &pj_uri, 0, NULL, &msg_data, call_id);

it works but not always !! Its strange !!
the server is not always catch the custom header 20% of trials not work !!

is there a better way to do add the custom header

?!!

 

Eng. Moath Othman

+962-796988538


From: Spencer MacDonald spencer.macdonald.other@gmail.com
To: pjsip list pjsip@lists.pjsip.org
Sent: Tuesday, December 11, 2012 4:49 PM
Subject: Re: [pjsip] Setting Custom Registration Header

Hi Sandeep,

That works great, thanks a lot for your help!!!

Regards

Spencer

On Tue, Dec 11, 2012 at 11:45 AM, Sandeep Karanth sandeepk.kdp@gmail.com wrote:

You could try something like this and hopefully should help you.

pjsip_hdr *hdr;
pj_str_t hname = pj_str("HEADER_NAME");
pj_str_t hvalue = pj_str("HEADER_VALUE");

hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue);
 pj_list_push_back(&accountConfig.reg_hdr_list,hdr );
pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier);

On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald spencer.macdonald.other@gmail.com wrote:

I just create an account and add it to pjsua like so:

pjsua_acc_config accountConfig;
pjsua_acc_config_default(&accountConfig);
  
//Other Config is here
accountConfig.reg_timeout = 600;
 
pjsua_acc_id accountIdentifier;
pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier);

Regards

Spencer

On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth sandeepk.kdp@gmail.com wrote:

So are you using the pjsua app? How do you do the registration?If you could mention that it would give a more clear view of your problem to me.

On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald spencer.macdonald.other@gmail.com wrote:

The issue is that PJSIP is handling the registration for me, I just set the reg_timeout for an account.

Regards

Spencer

On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth sandeepk.kdp@gmail.com wrote:

You can use the method 

pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom header. 

Regards,
Sandeep

On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald spencer.macdonald.other@gmail.com wrote:

Hi,

Im trying to send a custom header in a SIP Registration, but I can't find a way to do so.

It looks like you should be able to call

pjsip_regc_get_module()

to get the sip registration module, but this gives me a linker error. Looking in footprint.c this method appears to be commented out. 

Should this be working or is there an alternative solution?

Regards

Spencer


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

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

do you have any other methods to do that ,,, if i could change the contact name in header , it will be solved for me ,, can you guide me to the way to change the contact Field !! it looks like that  Contact: "myName" <sip:6260@xxx.xxx.xxx.xx:5060;ob> I could set the Contact name (my Name) in the registration phase i want to be able to change every time I make a call ...   thank you alot ----------------------- Eng. Moath Othman Computer Engineer DDAD For Information Technology Amman-Jordan +962-788279184 ------------------------ ________________________________ From: Sandeep Karanth <sandeepk.kdp@gmail.com> To: moath othman <m_o_3_1989@yahoo.com>; pjsip list <pjsip@lists.pjsip.org> Sent: Wednesday, December 12, 2012 12:50 PM Subject: Re: [pjsip] Setting Custom Registration Header Looks alright to me! Not sure why are you facing issues  On Wed, Dec 12, 2012 at 3:50 PM, moath othman <m_o_3_1989@yahoo.com> wrote: Hi spencer and sandeep > >am also trying to add custom headers > >i am using this method > >     pj_str_t hname = pj_str(headerx); >     pj_str_t hvalue = pj_str(header); >    pjsua_msg_data_init(&msg_data); >    pjsip_generic_string_hdr_init2(&my_hdr, &hname, &hvalue); >    pj_list_push_back(&msg_data.hdr_list, &my_hdr); >    >    status = pjsua_call_make_call(acc_id, &pj_uri, 0, NULL, &msg_data, call_id); > >it works but not always !! Its strange !! >the server is not always catch the custom header 20% of trials not work !! > >is there a better way to do add the custom header ?!! > > > > >  >----------------------- >Eng. Moath Othman > >+962-796988538 >------------------------ > > >________________________________ > From: Spencer MacDonald <spencer.macdonald.other@gmail.com> >To: pjsip list <pjsip@lists.pjsip.org> >Sent: Tuesday, December 11, 2012 4:49 PM >Subject: Re: [pjsip] Setting Custom Registration Header > > > >Hi Sandeep, > > >That works great, thanks a lot for your help!!! > > >Regards > > >Spencer > > >On Tue, Dec 11, 2012 at 11:45 AM, Sandeep Karanth <sandeepk.kdp@gmail.com> wrote: > >You could try something like this and hopefully should help you. >>pjsip_hdr *hdr; >>pj_str_t hname = pj_str("HEADER_NAME"); >>pj_str_t hvalue = pj_str("HEADER_VALUE"); >> >> >>hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(pool, &hname ,&hvalue); >> pj_list_push_back(&accountConfig.reg_hdr_list,hdr ); >>pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier); >> >> >> >> >> >>On Tue, Dec 11, 2012 at 4:47 PM, Spencer MacDonald <spencer.macdonald.other@gmail.com> wrote: >> >>I just create an account and add it to pjsua like so: >>> >>> >>>pjsua_acc_config accountConfig; >>>pjsua_acc_config_default(&accountConfig); >>>   >>>//Other Config is here >>>accountConfig.reg_timeout = 600; >>>  >>>pjsua_acc_id accountIdentifier; >>>pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE,&accountIdentifier); >>> >>> >>>Regards >>> >>>Spencer >>> >>> >>>On Tue, Dec 11, 2012 at 11:08 AM, Sandeep Karanth <sandeepk.kdp@gmail.com> wrote: >>> >>>So are you using the pjsua app? How do you do the registration?If you could mention that it would give a more clear view of your problem to me. >>>> >>>> >>>> >>>>On Tue, Dec 11, 2012 at 4:26 PM, Spencer MacDonald <spencer.macdonald.other@gmail.com> wrote: >>>> >>>>The issue is that PJSIP is handling the registration for me, I just set the reg_timeout for an account. >>>>> >>>>> >>>>>Regards >>>>> >>>>>Spencer >>>>> >>>>> >>>>> >>>>>On Tue, Dec 11, 2012 at 10:51 AM, Sandeep Karanth <sandeepk.kdp@gmail.com> wrote: >>>>> >>>>>You can use the method  >>>>>>pjsip_msg_add_hdr(pjsip_msg *msg, pjsip_hdr *hdr ) to add your custom header.  >>>>>> >>>>>> >>>>>>Regards, >>>>>>Sandeep >>>>>> >>>>>> >>>>>> >>>>>>On Tue, Dec 11, 2012 at 4:12 PM, Spencer MacDonald <spencer.macdonald.other@gmail.com> wrote: >>>>>> >>>>>>Hi, >>>>>>> >>>>>>> >>>>>>>Im trying to send a custom header in a SIP Registration, but I can't find a way to do so. >>>>>>> >>>>>>> >>>>>>>It looks like you should be able to call >>>>>>> >>>>>>> >>>>>>>pjsip_regc_get_module() >>>>>>> >>>>>>> >>>>>>>to get the sip registration module, but this gives me a linker error. Looking in footprint.c this method appears to be commented out.  >>>>>>> >>>>>>> >>>>>>>Should this be working or is there an alternative solution? >>>>>>> >>>>>>> >>>>>>>Regards >>>>>>> >>>>>>>Spencer >>>>>>>_______________________________________________ >>>>>>>Visit our blog: http://blog.pjsip.org >>>>>>> >>>>>>>pjsip mailing list >>>>>>>pjsip@lists.pjsip.org >>>>>>>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>>>>> >>>>>>> >>>>>> >>>>>>_______________________________________________ >>>>>>Visit our blog: http://blog.pjsip.org >>>>>> >>>>>>pjsip mailing list >>>>>>pjsip@lists.pjsip.org >>>>>>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>>>> >>>>>> >>>>> >>>>>_______________________________________________ >>>>>Visit our blog: http://blog.pjsip.org >>>>> >>>>>pjsip mailing list >>>>>pjsip@lists.pjsip.org >>>>>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>>> >>>>> >>>> >>>>_______________________________________________ >>>>Visit our blog: http://blog.pjsip.org >>>> >>>>pjsip mailing list >>>>pjsip@lists.pjsip.org >>>>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>>> >>>> >>> >>>_______________________________________________ >>>Visit our blog: http://blog.pjsip.org >>> >>>pjsip mailing list >>>pjsip@lists.pjsip.org >>>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>> >>> >> >>_______________________________________________ >>Visit our blog: http://blog.pjsip.org >> >>pjsip mailing list >>pjsip@lists.pjsip.org >>http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > >_______________________________________________ >Visit our blog: http://blog.pjsip.org > >pjsip mailing list >pjsip@lists.pjsip.org >http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > >_______________________________________________ >Visit our blog: http://blog.pjsip.org > >pjsip mailing list >pjsip@lists.pjsip.org >http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >