[pjsip] Registration with pjsip-lib, pjsip_regc_init

Benny Prijono bennylp at pjsip.org
Thu May 22 04:05:27 EDT 2008


On Wed, May 21, 2008 at 11:40 PM, Damien Herraud <d.herraud at gmail.com> wrote:
> Hi,
>
>  I have a problem with pjsip_regc_register. I get :
>
>> ../src/pjsip-ua/sip_reg.c:239: pjsip_regc_init: Assertion `regc && srv_url
>> && from_url && to_url && contact_cnt && contact && expires' failed.
>
> when I launch my program.
>

That assertion of course means that one (or more) of the listed
variables/parameters is zero or NULL. I suspect it's
acc->cfg.reg_timeout, since you didn't initialize this value.
According to the API, you should set this argument to
PJSIP_REGC_EXPIRATION_NOT_SPECIFIED if you don't want to specify
expiration.

>
> It is driving me crazy since I am sure it has worked before (pjsip_regc_send
> also worked, I mean I got no error. I was getting into regc_cb() code when I
> got this error).
> I tried to use many saves  but I still get this error !!!
>

Since the acc->cfg.reg_timeout is not initialized it may contain any
value. It could be that last time it contains a garbage non-zero value
hence it passed the assertion.

Cheers
 Benny


> You can find my source code (very simple modification of simpleua.c and
> util.h) attached !
>
>
> Cheers,
>
> Damien
>
>
> On Wed, May 21, 2008 at 7:01 AM, Benny Prijono <bennylp at pjsip.org> wrote:
>>
>> On Tue, May 20, 2008 at 11:39 PM, Damien Herraud <d.herraud at gmail.com>
>> wrote:
>> > Ok ! I am indeed using version 0.8.
>> >
>> > Do you advise me to use svn version instead ?
>> >
>> >
>>
>> No, I didn't and won't advise you to use svn version just because 0.8
>> lacks pj_sockaddr_get_addr() function. You could use other ways to
>> retrieve IP address from a socket address, please see <pj/sock.h> for
>> more info.
>>
>> Cheers
>>  Benny
>>
>>
>> > Damien
>> >
>> >
>> >
>> > On Sat, May 17, 2008 at 6:27 AM, Benny Prijono <bennylp at pjsip.org>
>> > wrote:
>> >>
>> >> On Fri, May 16, 2008 at 5:28 PM, Damien Herraud <d.herraud at gmail.com>
>> >> wrote:
>> >> > Thanks for that, I get my address !
>> >> >
>> >> > By the way when I was trying getting my address with another method,
>> >> > I
>> >> > tried
>> >> > to use pj_sockaddr_get_addr() function defined here . I got an error
>> >> > in
>> >> > compilation, saying that this is not declared. I searched PJSIP
>> >> > project
>> >> > for
>> >> > this function with eclipse and I could not find it.
>> >> >
>> >>
>> >> This only exists in SVN version, not in 0.8 release version. Perhaps
>> >> you're using 0.8?
>> >>
>> >> Cheers
>> >>  Benny
>> >>
>> >> > Cheers,
>> >> >
>> >> > Damien
>> >> >
>> >>
>> >> _______________________________________________
>> >> Visit our blog: http://blog.pjsip.org
>> >>
>> >> pjsip mailing list
>> >> pjsip at lists.pjsip.org
>> >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>> >
>> >
>> > _______________________________________________
>> > Visit our blog: http://blog.pjsip.org
>> >
>> > pjsip mailing list
>> > pjsip at lists.pjsip.org
>> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>> >
>> >
>>
>> _______________________________________________
>> Visit our blog: http://blog.pjsip.org
>>
>> pjsip mailing list
>> pjsip at lists.pjsip.org
>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>




More information about the pjsip mailing list